Commit Graph

41 Commits

Author SHA1 Message Date
Alexander Larsson
8c78700363 builder: Allow specifying the git commit if the branch is a tag
If the ref specified in "branch" is actually a tag, we were requiring
that the "commit" property must match "git rev-parse $branch", but
in the case of a tagname that actually expands to the id of the
tag object, not the commit id. We now also try to match against
"rev-parse $branch^{commit}" which expands to the actual commit
object.

We still allow the tag object for backwards compat.
2017-05-11 10:52:30 +02:00
Alexander Larsson
8788f8a09e builder: Fix up unused variable warnings from clang 2017-04-24 21:48:57 +02:00
Alexander Larsson
f4f2625f59 builder: Change how we handle pre-existing git sources
We always have a local git checkout in .flatpak-builder/git
so that we can later update in it. However, if --extra-sources
is used and the git repo exists there, we use the data there
to clone the initial repo, to avoid lots of traffic on the network.

Additionally, if --disable-update is specified we just straight
clone the local cache repo, and then rewrite the origin to the
real one. This means we never do any network i/o to the original
pull.
2017-04-24 14:13:36 +02:00
Alexander Larsson
3058d413f0 builder: Use flatpak_mkdir_p instead of query + mkdir 2017-04-21 16:38:05 +02:00
Simon Schampijer
bb11ef3c37 Merge remote-tracking branch 'upstream/master' into bundle-sources 2017-04-21 00:13:01 +02:00
Alexander Larsson
63978c299a builder: Load source files from the directory of the module
This means if you include a json snippet in a subdirectory, then
that module will load e.g. patches from the same subdirectory.
2017-04-19 18:54:33 +02:00
Simon Schampijer
5d52f93a25 Bundle sources: bundling has to happen before the extracting
In the case of the source-file we have code that handle
the file inline. When we extract the source we do set
the url with that inline data. In get_download_location
that is also used by the bundling code we do then
check against this url and fail.
2017-04-13 13:57:56 +02:00
Simon Schampijer
d567b31d3d Bundle sources: initialize app_dir_path later 2017-04-13 13:32:33 +02:00
Simon Schampijer
894311e243 flatpak-builder: bundle module sources as runtime
This adds a step to the build process to bundle
the module sources, used for building the flatpak,
as a runtime extension.

The sources can then be installed like the
debug or translation runtime.

This also adds an option to flatpak-builder
for specifying sources directories. One can specify
source dirctories with the use-sources argument. This
will skip the download part of the processing
and will extract the sources from the given sources
directory directly for further processing.

Those source directories do need the same
structure as the ones that flatpak-builder
creates during processing in .flatpak-builder
and which is also used in the exported sources
runtime.
2017-04-13 13:32:33 +02:00
Alexander Larsson
fae922584c builder: Add commit property to git source
If branch is unset this is just a nicer way to set a
particular commit. However if both are set, then we verify
that the branch/tag is at that particular commit. This is
a nice way to document that we want to use a particular tag
but still protect against the tag changing or a MITM attack
modifying what that tag means.
2017-04-04 15:21:11 +02:00
Alexander Larsson
3459ef8655 builder: Add disable-fsckobjects to git sources
This lets you work around clone problems for broken
git repositories.

Fixes https://github.com/flatpak/flatpak/issues/661
2017-04-04 14:31:48 +02:00
Alexander Larsson
b136e7fdc6 builder: extract git mirroring code to builder-git.c
This way we can resuse it outside the git source
2017-02-21 11:58:35 +01:00
Matthew Leeds
8b50648ec0 builder: Check if .gitmodules exists before showing it. Fixes #366
This commit checks if <revision>:.gitmodules exists in the repo before
calling git-show on it, so an error message doesn't show up in the
program's output.
2016-11-01 09:30:31 +01:00
Mathieu Bridon
d165475e17 builder: Don't fail when submodule path isn't a gitlink
This is what git itself does, so we just should do the same.

cda1bbd474/builtin/submodule--helper.c (L247-L248)
2016-09-13 00:24:42 +02:00
Mathieu Bridon
5430d4d40e builder: Properly check for gitlink trees
Instead of expecting the second word to be "commit", we should do like
git does and check for the file mode, which is 160000 for gitlink trees.

cda1bbd474/cache.h (L96)
2016-09-13 00:24:42 +02:00
Alexander Larsson
fba645a999 Remove unused local variables reported by clang 2016-09-12 11:11:35 +02:00
Alexander Larsson
e792686892 builder: Propagate build-args to shell sources
This way you can e.g. do network i/o in them.
Thats not a recommended way to do it though, as you work around
a lot of the feature in flatpak-builder like the caching and
verification.
2016-09-05 22:01:56 +02:00
Mathieu Bridon
63cddfa80e builder: Handle submodules using with relative URLs
Some projects declare their Git submodules with URLs relative to their
own.

For example, gedit is hosted at git://git.gnome.org/gedit, and has its
libgd submodule declared with the ../libgd URL. We should treat the
latter as git://git.gnome.org/libgd.

This was in fact properly done in the past, but I broke it in commit
1171e1d202.

This fixes it again.
2016-08-24 21:06:00 +02:00
Alexander Larsson
b03b21f416 Merge branch 'builder-git-submodules' of git://github.com/bochecha/flatpak into bochecha-builder-git-submodules 2016-08-22 16:08:39 +02:00
Alexander Larsson
6578d37984 Drop libgsystem dependency 2016-08-22 16:00:33 +02:00
Alexander Larsson
9c907c992d Replace gs_shutil_rm_rf with small helper wrapper over libglnx 2016-08-22 10:06:08 +02:00
Mathieu Bridon
1171e1d202 builder: Redo git submodules handling
flatpak-builder was mixing the path and the name of a submodule, which
would lead to download failures when they were different.

Fixes #216
2016-08-20 12:44:27 +02:00
Matthew Leeds
25d88477c5 builder: Allow git sources to be specified as paths
Currently to use a local copy of a git repo you have to specify the url
as "file:///path/to/repo". This commit allows you to specify a path directly
as "/path/to/repo", which is faster and more space-efficient because
git-clone will hardlink the objects rather than copying them.
2016-07-29 16:01:30 -04:00
Alexander Larsson
c24528d369 Rename source files to flatpak 2016-05-09 09:00:20 +02:00
Alexander Larsson
6a613d1fab Rename all non-autogenerated symbols to flatpak 2016-05-09 09:00:20 +02:00
Alexander Larsson
1ffdf27d92 uncruftify: Initial run, all non-problematic changes 2016-05-06 16:03:27 +02:00
Alexander Larsson
3a70dcf430 builder: Style fixes 2016-01-28 21:52:45 +01:00
Michael Spencer
ba5b5bc6b8 builder: Skip checking out disabled submodules 2016-01-28 12:46:40 -06:00
Alexander Larsson
1264335458 builder: Add --disable-updates
Download sources, but never update existing sources (like git or bzr).
2015-12-21 10:39:23 +01:00
Alexander Larsson
43a09b3646 Fix unused variable warnings 2015-12-15 14:34:52 +01:00
Alexander Larsson
2c92fcb1d6 builder: After fetching the mirrored git repo, set back the right origin
This is nice if you want to later pull new data into the repo.
2015-12-09 21:32:18 +01:00
Alexander Larsson
873492af62 builder: Remove accidental leftover spew 2015-12-09 21:21:48 +01:00
Alexander Larsson
b716e0d8eb Builder: Add a resolved version of the manifest to the built app 2015-12-09 14:26:41 +01:00
Alexander Larsson
dfc11d5e87 builder: Support specifying commit ids as git branches 2015-12-09 14:07:33 +01:00
Alexander Larsson
237fd57cd0 builder: Allow git uris to be relative to the base directory
This allows you to use ".git" as the git uri, thus building from the
current source directory.
2015-12-08 14:34:34 +01:00
Alexander Larsson
ab7699bb04 builder: Prune old branches when updating mirror 2015-12-04 08:51:14 +01:00
Alexander Larsson
374e7d1166 builder: Be a bit more verbose when pulling VCS 2015-12-04 08:51:08 +01:00
Alexander Larsson
e76da99cdc builder: Merge spawn helpers to single base helper 2015-12-03 13:29:08 +01:00
Alexander Larsson
d6ae9e3d6c builder: Add submodule support for git sources 2015-11-30 21:09:56 +01:00
Alexander Larsson
f710eb9322 Correct license, we're LGPL 2+, not 3+
Some files accidentally got the LGPL 3+ header, but we
want to be LGPL2+.
2015-11-26 14:50:21 +01:00
Alexander Larsson
b2790349d6 Add xdg-app-builder
This is a tool that makes it easy to build applications and their
dependecies by automating the configure && make && make install steps.
2015-11-25 15:26:32 +01:00