Commit Graph

348 Commits

Author SHA1 Message Date
Alexander Larsson
5cd90e416f builder: Fix ldflags support
Due to a cut-and-paste error we set it to cxxflags, not ldflags.
2017-05-04 09:42:52 +02:00
Colin Walters
c50648a594 libglnx: Bump to latest master, use new file copy API
The new `glnx_regfile_copy_bytes()` is better than the previous
`flatpak_copy_bytes()` in that it will use reflink/sendfile if available.

More information in 3a4d0f4684
2017-04-28 10:04:22 -04:00
Alexander Larsson
8788f8a09e builder: Fix up unused variable warnings from clang 2017-04-24 21:48:57 +02:00
Alexander Larsson
8b13d3c5ee builder: Add progress reporing while downloading 2017-04-24 21:23:46 +02:00
Alexander Larsson
48d9cd8eae builder: Strip trailing whitespace in git submodule urls
Seen in the wild in https://github.com/Unvanquished/Unvanquished.git
2017-04-24 21:20:16 +02:00
Alexander Larsson
fa996e704b builder: Update bzr bundling
Never check out directly from the cached dir, instead always
create a .flatpak-builder/bzr/ directory we can later
update from by branching from the cache and then rewriting
the parent location.
2017-04-24 15:24:05 +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
fbde709739 builder: Convert bundle sources to cached stage
Instead of mixing the source bundling with the build we make
it a separate step at the end, with cache support just like the
other stages.

Being at the end means we can reuse the cached stages from the
build if we enable bundle-sources after an existing build.

Also, this changes how the json and local files/patches are stored.
Now they are in a subdirectory called "manifest" in the sources
directory, with proper handling of relative pathnames for included
modules, etc. This also means we don't look for these file in the
extra-sources directory, but rather next to the json like we
do normally.
2017-04-24 13:52:38 +02:00
Alexander Larsson
a30be79d49 builder: Drop the storing of local files to data: uris
This just risks making the manifest very large, in case some
file is large, and it didn't even solve the whole problem,
which bundling sources is.
2017-04-24 12:00:00 +02:00
Alexander Larsson
0a0e311311 Don't bundle inline (data:) URIs
These are already bundled with the json itself.
2017-04-24 11:34:49 +02:00
Alexander Larsson
69123b564e builder: Make git patch apply verbose by default
Git is prone to ignoring patches in some cases, lets
at least print the details.
2017-04-24 10:29:57 +02:00
Alexander Larsson
a5157d445b builder: Use context_find_in_sources_dirs to simplify code
Instead of open-coding the search everywhere. Also some places
are changed to use flatpak_build_file to further simplify
the code.
2017-04-24 09:02:42 +02:00
Alexander Larsson
b593ff04d3 builder: Add builder_context_find_in_sources_dirs
This centralizes the code for searching in the sources
directory.
2017-04-24 09:02:38 +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
4c2c6af4ac builder: Take build-commands into consideration for rebuild 2017-04-20 16:10:04 +02:00
Alexander Larsson
2f24c9bc31 builder: Use module-relative paths for archive sources too 2017-04-20 15:06:06 +02:00
Alexander Larsson
a71cd70ddb builder: Ignore --extra-data in flatpak-builder --run
Fixes https://github.com/flatpak/flatpak/issues/598
2017-04-19 20:53:38 +02:00
Alexander Larsson
b8cd12930a Report full version in http user agent
https://github.com/flatpak/flatpak/issues/635
2017-04-19 20:47:57 +02:00
Alexander Larsson
eebcefa3b2 builder: Print warnings for unknown properties 2017-04-19 20:22:11 +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
Alexander Larsson
d60bfcdf95 builder: handle module-relative paths for json includes
I.e. each include is relative to the location of the "parent"
json directory.
2017-04-19 17:46:28 +02:00
Matthias Clasen
6dd137e6a9 Make it a warning
Lack of rofiles-fuse is a serious enough detriment to the
user experience that we should warn about it.
2017-04-18 12:40:51 +02:00
Matthias Clasen
1adec3f186 Don't fail the build if rofiles-fuse is not available
My understanding is that rofiles-fuse is just an optimization,
and we support building without it anyway (using --disable-rofiles-fuse).

So, instead of failing the build, we can just not use rofiles-fuse
if it is not present on the system, which seems to be the case on
some OSes, we've seen this reported from Debian and Arch.
2017-04-18 12:40:51 +02:00
Chocobo1
32c022df5b builder-module: add "bootstrap.sh" to autogen_names
Projects like libtorrent-rasterbar, qBittorrent are using this name.
2017-04-18 12:35:16 +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
a9e217a729 Bundle sources, bzr: set error when repo can not be found 2017-04-13 13:32:33 +02:00
Simon Schampijer
1bfe54a434 Bundle sources, git_get_mirror_dir: able to pass NULL for is_local
We only need the info in the builder_git_checkout case.
2017-04-13 13:32:33 +02:00
Simon Schampijer
d567b31d3d Bundle sources: initialize app_dir_path later 2017-04-13 13:32:33 +02:00
Simon Schampijer
f31a310a66 Bundle source: use C-style comments 2017-04-13 13:32:33 +02:00
Simon Schampijer
60f96e31d6 Bundle sources: bundle the manifest 2017-04-13 13:32:33 +02:00
Simon Schampijer
f094ab7e55 Bundle sources: use git clone --shared for local sources checkout
Share the data with the read-only repository from
the extra sources.
2017-04-13 13:32:33 +02:00
Simon Schampijer
603801eeb8 Bundle sources: rename option to --extra-sources=DIR
The specified directory is added to the list of sources
and when downloading the sources it is looked up first
before the sources are tried to be downloaded.
2017-04-13 13:32:33 +02:00
Simon Schampijer
4357ba6844 Bundle sources: allow use case to mix local and online sources
Fix checksum check for archives and files when sources are from
a local directory.
2017-04-13 13:32:33 +02:00
Simon Schampijer
16ca129253 Bundle sources: the path is always sources 2017-04-13 13:32:33 +02:00
Simon Schampijer
e473ca3b46 Bundle sources: add flag --bundle-sources to control the bundling
By default the bundling feature is turned off.
2017-04-13 13:32:33 +02:00
Simon Schampijer
057f420b47 Bundle sources: add support to bundle patches as well
Also add the necessary bits to consume the patches
stored.
2017-04-13 13:32:33 +02:00
Simon Schampijer
023dbecea5 Bundle sources: add support for bzr
This adds the bits needed to bundle bzr sources
and to consume them when provided to flatpak-builder
with the command line option.
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
Timm Bäder
4dc8ba3773 builder-manifest: Rename localized icon fields as well
The Icon= field inside desktop files is translatable, so rename all the
translated versions if the translation matches the untranslated icon
name.
2017-04-07 13:20:44 +02:00
Alexander Larsson
3f9e72c793 builder: Support sdk-extensions also for apps
For apps this just means we ensure that the required sdk extension are
available.
2017-04-04 15:52:36 +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
Bartłomiej Piotrowski
ac8ef8f36f builder: make appstream-compose failure fatal 2017-03-30 15:48:38 +02:00
Matthew Leeds
d272a4d4cc builder: Don't pass --require-version along to build
The --require-version option works for build-finish but not build, so
don't pass it along when using a manifest to build.
2017-03-28 08:51:36 +02:00
Matthew Leeds
543c0735f1 builder: Add a hint about --force-clean 2017-03-27 12:52:46 +02:00
Colin Walters
64fd2c2a8d Bump libglnx, use new glnx_throw(), fix callers
One benefit here becomes immediately obvious - `flatpak_fail()` was lacking
`G_GNUC_PRINTF` which meant we missed a lot of type checking. Fix up the
callers.
2017-03-27 10:42:36 +02:00
Alexander Larsson
b00b8b1601 builder: Add --default-branch=BRANCH 2017-03-21 13:16:29 +01:00
Alexander Larsson
c7086364be builder: Handle absolute paths in command
Don't fail with "not found" in this case because we're checking
the absolute path on the host, not in the final sandbox.
2017-03-20 17:55:14 +01:00
Alexander Larsson
9a62c456e3 builder: Remove all SDK extension from the platform
Instead of hardoding the locale and debug one.
This allows us to have SDK-specific extensions that
are not in the platform
2017-03-16 21:20:29 +01:00