Commit Graph

384 Commits

Author SHA1 Message Date
Matthias Clasen
261ff03b63 Merge pull request #907 from smcv/metadata
Document all metadata groups and keys
2017-07-07 17:50:15 -04:00
Matthias Clasen
d1189d6d79 Merge pull request #904 from chergert/wip/term-titles
Update terminal title with build progress
2017-07-07 17:08:29 -04:00
Christian Hergert
59c4aec237 builder: update terminal title when build progress
This tries to be similar to jhbuild in that we update the
terminal title at various stages of the build process.

This is useful for casual command line users. It is also useful
for applications automating the use of flatpak-builder as then
can display progress to the user without having to parse all
stdout content.

For build systems that support progress (such as ninja), this
allows for both a build message (the term title) and progress
bars (generated from %d/%d build system output).
2017-07-07 14:04:30 -07:00
Simon McVittie
489bfddfb3 common: Add and use constants for flatpak-metadata(5) groups and keys
This makes it easier to avoid typos, and also makes it easier to see
what groups and keys are in use. In the header file, they are
clustered according to the group in which the keys are used.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2017-07-07 16:06:21 +01:00
Christian Hergert
2c6d05cf9f builder: add helper to set terminal title on TTYs
If isatty(STDOUT_FILE) is true, then we can possibly send
escape sequences to set the title of the terminal. This is
useful for both terminals like gnome-terminal as well as
programs scripting flatpak-builder such as Builder. This allows
those programs to get information about the current build
progress without having to parse the command line output which
is muxed with build information.
2017-07-06 14:22:19 -07:00
Philip Withnall
f47a696392 build: Add AM_* variables to all per-target special variables
For example, add $(AM_CFLAGS) to mumble_CFLAGS. Since $(WARN_CFLAGS) is
only added to $(AM_CFLAGS), this fixes the lack of inclusion of the
compiler warning flags in the compilation of half of flatpak.

Note that $(AM_*) variables are only used by automake if a more specific
(per-target) special variable is not defined instead. So if you define
mumble_CFLAGS, AM_CFLAGS will not be used for that target unless
explicitly included in mumble_CFLAGS.

See
https://www.gnu.org/software/automake/manual/html_node/Flag-Variables-Ordering.html.

Do the same for $(AM_LIBADD), $(AM_LDFLAGS), etc. These are not
currently defined, but it’s good practice to include them in
mumble_LIBADD (etc.) just in case they’re defined in future. Hopefully
their inclusions will be cargo-culted to any new targets which are
added, retaining full coverage of the code base.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2017-07-06 15:05:58 +01:00
Philip Withnall
a7f5b1c3ef builder: Remove an unused variable
Fix a compiler warning.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2017-07-06 15:05:58 +01:00
Philip Withnall
5771527286 builder: Add a missing function to the header file
All the similarly named functions were in the header file, but this one
was left out. Stop it feeling sad and lonely by putting it in the header
file with its friends.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2017-07-06 14:41:21 +01:00
Philip Withnall
548f60ebc0 general: Add missing static modifier to various local methods
The compiler warning flag which was supposed to warn about this was not
being included in the CFLAGS for these targets. That will be fixed in an
upcoming commit.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2017-07-06 14:41:21 +01:00
Alexander Larsson
d7d82d1f2a builder: When bundling git sources, reuse cache
Fixes https://github.com/flatpak/flatpak/issues/885
2017-06-30 18:00:14 +02:00
Philip Withnall
15bc368188 builder: Rearrange args to do_export() to make mandatory ones obvious
Previously, the mandatory location, directory and branch positional
arguments were passed as part of the varargs. This meant the varargs
were conflating flags and positional arguments, making it harder to add
new positional arguments.

Move the mandatory positional arguments to separate parameters for
do_export(). This introduces no functional changes, but makes later
commits easier.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2017-06-30 13:41:38 +02:00
Philip Chimento
86bc5f39be builder: Use build-args during cleanup
Any build-args specified in the manifest should be used during the
cleanup and platform-cleanup stages. This is because if you are using
QEMU to build for another architecture, for example, you need to pass
--bind-mount in the build-args, and the bind mount also needs to be
present while running cleanup commands.
2017-06-30 10:23:52 +02:00
Alexander Larsson
7bc44f0903 builder: Allow building modules with no sources if buildsystem=simple
This makes a lot of sense to have for simple things like just directly
modifying the /app root.
2017-06-26 12:19:17 +02:00
Alexander Larsson
1b584b42da builder: Inherit parent version for inherited extension
If you inherit an extension, and it has no explicit version, then
use the version of the parent, as that is what would automatically
be used for the parent.
2017-06-20 11:11:41 +02:00
Alexander Larsson
9777ade7e4 builder: Add ExtensionOf group to created extensions (Debug/Locale) 2017-06-19 21:19:49 +02:00
Alexander Larsson
1820ebdc72 builder: Better handling of default-branch
Instead of constantly looking at the option we change the
manifest value if its unset. This means we can access the
default branch outside of builder-main.c, and that we get
it into the serialized manifest in the build.
2017-06-19 21:16:46 +02:00
Alexander Larsson
8c6f31f9a8 builder: Add inherit-extensions features
This lets runtimes like the gnome and kde one easily inherit
extension points from the parent sdk.
2017-06-19 10:58:49 +02:00
Alexander Larsson
bc7ebd20e2 builder: Allow .pyc files without .py
This is common for binary-only releases, for example as described
in:
https://lists.freedesktop.org/archives/flatpak/2017-June/000697.html
2017-06-13 11:17:06 +02:00
Philip Withnall
0888ec4701 builder-options: Fix setting CPPFLAGS
They were being set to an uninitialised set of flags from cxxflags.
Spotted as a compiler warning.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2017-06-06 20:09:16 +01:00
Alexander Larsson
05f9c8730c builder: Add --export-only feature
This allows you to export a previous build, and still get features
like debug and locale extensions.

Fixes https://github.com/flatpak/flatpak/issues/824
2017-05-31 14:08:36 +02:00
Alexander Larsson
e69237f792 Handle app ids with dashes when ignoring locale/debug.
org.foo.foo-bar extensions become org.foo.foo_bar.Locale, etc, so
we need to handle this properly.
2017-05-30 18:07:46 +02:00
Alexander Larsson
333f308a2b builder: Don't warn for unknown properties starting with x-
Fixes https://github.com/flatpak/flatpak/issues/809
2017-05-26 16:34:43 +02:00
Mathieu Bridon
8b9df0ddcf Automatically use a separate builddir with Meson
Meson does not support builddir == srcdir, so there is no reason to
require developers to set "builddir" to true in their manifests, when we
can just do the right thing.
2017-05-24 15:18:26 +02:00
Alexander Larsson
e41cb789fa builder: Add support for screenshot mirroring
Specify --mirror-screenshots-url=URL and then copy the resulting
appdata/screenshots directory to the URL, then these
will be used instead of the upstream screenshots.
2017-05-22 16:18:45 +02:00
Matthias Clasen
c2ed604b2e Add some hints when icons are not found
We have some extra conditions here that are not evident
from the rename-icon key in the manifest, so add some
verbose output to make it easier to figure out why an
icon is not renamed.
2017-05-22 09:25:44 +02:00
Alexander Larsson
4f828942f7 Update to latest libglnx and use the new GLnxTmpFile API 2017-05-22 09:08:49 +02:00
Alexander Larsson
f4d8f5680b builder: Add CPPFLAGS similar to the existing flags 2017-05-22 08:50:18 +02:00
Alexander Larsson
ff8c9ddef6 builder: Make c/cxx/ldflags not override env
This allows you to easily construct flags by appending,
but also lets you override it completely if necessary.
2017-05-22 08:41:30 +02:00
Alexander Larsson
617e3a4e4f builder: Fix segfault if appstream-compose fails
We were returning FALSE without initializing the GError.

Fixes https://github.com/flatpak/flatpak/issues/775
2017-05-19 12:00:58 +02:00
Alexander Larsson
411107a942 builder: Better debug output from the rofiles-fuse code
We now show the mount point and the source correctly.
2017-05-19 11:34:37 +02:00
Colin Walters
bcced9adc7 Bump libglnx, port to new tmpfile API
I think the new tmpfile here is a lot better; there were places in flatpak where
we weren't doing "unlink on failure" etc.
2017-05-19 09:27:03 +02:00
Alexander Larsson
461084d1a9 builder: Add a install-rule to allow customized install
Fixes: https://github.com/flatpak/flatpak/issues/791
2017-05-15 09:38:22 +02:00
Alexander Larsson
4774b3c80f builder: Take "buildsystem" into consideration for cache freshness 2017-05-15 09:38:22 +02:00
Alexander Larsson
fcfc732904 fix clang warning
clang complained about the undefined g_rmdir (because we didn't include
gstdio.h), so we use the regular rmdir instead.
2017-05-11 10:55:26 +02:00
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
3d1b51b5c0 builder: Use mkdtemp for initial git/bzr checkout
Rather than just prepending _tmp this creates a unique
directory name, which means we don't run into issues
when retrying if the first checkout fails.

Fixes https://github.com/flatpak/flatpak/issues/786
2017-05-11 10:29:51 +02:00
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