Commit Graph

400 Commits (9d1f1ed59c7615237d06fd5ccdc1812f02877a6d)

Author SHA1 Message Date
Alexander Larsson 9d1f1ed59c Delete non-builder files 2017-08-25 09:27:42 +02:00
Alexander Larsson a44bae6936 builder: Install all subpaths when installing dependencies
This means we e.g. always get the entire locale.
2017-08-21 17:26:03 +02:00
Alexander Larsson c6ef29c06b builder: Add support for defining extensions in flatpak-builder
This takes a list of properties and generate finish arguments.
Additionally you can specify "bundle": true, which causes f-b to emit
an actual extension implementation, similar to e.g. the locale
and debuginfo extension.
2017-08-21 15:46:06 +02:00
Alexander Larsson 37fa3461c9 builder: Add --delete-build-dirs
This makes sure we always delete build dirs, even if there
was a build failure. This is useful for automatic build systems
like flathub or continuous integration.

This fixes https://github.com/flatpak/flatpak/issues/646
2017-08-18 16:29:17 +02:00
Alexander Larsson 18451644ff Update to latest libglnx (and fix some callers) 2017-08-18 15:34:29 +02:00
Philip Withnall 5b002edf06 builder: Add collection ID support to the flatpak builder
Pass a --collection-id argument through to `flatpak build-export`.

Also add a ‘collection-id’ property to manifest files, which can be used
to set the collection ID on an exported repo (when using --repo) without
having to provide a command line option.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2017-08-18 14:23:03 +02:00
Alexander Larsson f9a06a0fcd builder: Add --install-deps-from=REMOTE
This allows you to automatically install/update dependencies required
by the manifest. The dependencies include:
 Runtime, Sdk, Base, Sdk Extensions and Platform Extensions

There is also a --install-deps-only switch to make the build
stop after the dependencies are installed.

Fixes https://github.com/flatpak/flatpak/issues/955
2017-08-18 11:04:13 +02:00
Alexander Larsson 4e15d9a5f8 common: Add GSubprocessFlags to flatpak_spawnv
This is useful to e.g. hide stderr
2017-08-18 10:56:15 +02:00
Philip Withnall ecbf42d7fa builder/utils: Remove an unnecessary if-condition
We unconditionally allocate s above, so it can’t be NULL.

Coverity issue: 1376586

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2017-08-15 12:26:05 +01:00
Philip Withnall 0cd65edc8b builder/module: Drop some unreachable code
use_builddir is TRUE if meson is TRUE, so there can never be a meson
case in the !use_builddir case.

Coverity issue: 1452428

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2017-08-15 12:24:01 +01:00
Philip Withnall 2106b80965 builder/module: Fix a crash if realpath() fails
If realpath() fails (unlikely) it returns NULL, which we later merrily
dereference. Fix that by taking the unexpanded path.

Also fix a minor indentation problem later on.

Coverity issue 1452435.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2017-08-15 12:22:45 +01:00
Philip Withnall 4bb3f4da36 builder/context: Add a missing va_end() call
This prevents a resource leak, although not really in practice because
va_args are free on common platforms.

Coverity issue 1452430.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2017-08-15 12:16:16 +01:00
Alexander Larsson 9c06cbb360 Add support for --extra-sources-url=URL
This makes flatpak-builder look in the specified URL for mirrored
sources before downloading the original URL.
2017-07-29 17:43:10 +02:00
Matthias Clasen 9ef22bed1d Catch some more errors in option parsing
flatpak-builder was running into an assertion when --run was
used after a non-option. Catch this and exit with a clear error
message. Same for --show-deps
2017-07-09 23:06:00 -04:00
Matthias Clasen ed08538f92 Merge pull request #900 from pwithnall/lan-and-usb-preparation
LAN/USB preparation refactoring
2017-07-08 20:54:28 -04:00
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
Philip Withnall 81301f0ef4 general: Remove trailing \n from GLib log messages
The GLib logging framework automatically appends a \n to messages, so it
doesn’t need to be added by callers.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2017-07-07 17:18:24 +01: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