Commit Graph

24 Commits (master)

Author SHA1 Message Date
Alexander Larsson 3a3ca4d5a0 module: Add builder_module_set_name()
Closes: #308
Approved by: alexlarsson
2019-09-13 13:25:32 +00:00
Ryan Gonzalez b317081048 Support parsing sources files as yaml
Fixes #297.

Closes: #298
Approved by: alexlarsson
2019-09-13 10:30:46 +00:00
Alexander Larsson 15eb895e00 Update platform creation to ensure good mtimes and better cacheing
This splits the platform creation into 3 parts:
 * base - create the initial directory based on the parent platform
 * prepare - run prepare commands and apply all changes
 * cleanup - apply cleanups and cleanup commands

This has cacheing advantages in that prepare_commands and cleanup changes
only cause the minimal amount of rebuilds.

Additionally, it ensures that the mtimes are zeroed out (from the
previous checkout) both when the prepare and cleanup commands are run.
This is actually important, since these often generate caches (for
example fontconfig ones) which rely on zeroed mtimes so they match
what will be deployed.

Closes: #277
Approved by: alexlarsson
2019-04-04 08:48:18 +00:00
Alexander Larsson fd802105c5 Keep x-* properties in manifest.json
This add custom (de)serialization code for the source, module and manifest
objects so that properties starting with "x-" are kep and then put back
in the manifest.

We also add a checksum of the manifest to the "finish" phase so that
if you change them the manifest is re-generated.

Closes: #203
Approved by: TingPing
2018-08-15 16:39:06 +00:00
Alexander Larsson 1a01c7bc61 Warn about using deprecated cmake property.
Closes: #192
Approved by: alexlarsson
2018-08-08 08:42:09 +00:00
Bastien Nocera 4618b50395 module: Respect "no-parallel-make" with ninja
ninja defaults to running in a highly parallel mode, but some bugs in
meson, such as:
https://github.com/mesonbuild/meson/issues/1994
require building serially.

This change makes the cmake-ninja and meson buildsystems respect
"no-parallel-make" during building.

Closes: #190
Approved by: TingPing
2018-08-01 22:09:08 +00:00
Bastien Nocera 1188992d15 Revert "module: Respect "no-parallel-make" with ninja"
This reverts commit 3f2a24df98.
2018-08-01 16:24:30 +02:00
Bastien Nocera 3f2a24df98 module: Respect "no-parallel-make" with ninja
ninja defaults to running in a highly parallel mode, but some bugs in
meson, such as:
https://github.com/mesonbuild/meson/issues/1994
require building serially.

This change makes the cmake-ninja and meson buildsystems respect
"no-parallel-make" during building.
2018-08-01 16:20:30 +02:00
Alexander Larsson bfd599cd4e Set FLATPAK_BUILDER_BUILDDIR in env when building module
This is set to the /run/build/$module directory name so that you
can easily refer to it in the build.

Fixes https://github.com/flatpak/flatpak-builder/issues/172

Closes: #180
Approved by: alexlarsson
2018-07-05 07:54:08 +00:00
Valentin David 9d0a01eda4 Use 'libdir' build option.
Closes: #148
Approved by: alexlarsson
2018-05-07 15:26:15 +00:00
Alexander Larsson 2391d046c3 Set FLATPAK_BUILDER_N_JOBS in build env
This is set to what flatpak itself would otherwise use for make -jN
and can be used in e.g. buildsystem simple modules.
2018-04-26 11:51:59 +02:00
Ryan Gonzalez e24c2218f1 Add YAML support as an alternative to JSON (closes #2)
Closes: #127
Approved by: alexlarsson
2018-04-19 12:44:38 +00:00
Christian Hergert 897fe1b768 utils: add GSubprocessFlags parameter
This allows us to pass it through in the case we're running in the same
pid namespace as the flatpak-builder process.

Closes: #100
Approved by: alexlarsson
2018-01-12 10:06:12 +00:00
Alexander Larsson 6529c39083 Support including json snippet for sources
This allows inclusion of sources from an external json source similar
to how we do it for modules.

For example, you can use:

"sources": [
    {
        "type": "shell",
        "commands": [ "echo BEFORE include" ]
    },
    "include.json",
    {
        "type": "shell",
        "commands": [ "echo AFTER include" ]
    }
]

with include.json containing:
[
    {
        "type": "shell",
        "commands": [ "echo Shell 1" ]
    },
    {
        "type": "shell",
        "commands": [ "echo Shell 2" ]
    }
]

This is very useful in the case where the included file is
auto-generated from some other source, such as an npm lockfile.

Closes: #77
Approved by: alexlarsson
2017-12-08 15:00:56 +00:00
Alexander Larsson 0797c72db7 Add support for running tests
Modules that say "run-tests": true, will run tests after installation,
unless disabled by --disable-tests.

The tests run by default are make check or ninja test, however you
can control the make/ninja target with test-rule, or supply a list
of commands with test-commands. There is also a test-args argument
in build-options, which you can use to give e.g. network access.

The tests are run with readonly access to the install directory, so
they cannot affect the build results.

Closes: #65
Approved by: alexlarsson
2017-11-16 08:09:21 +00:00
Alexander Larsson 34710550ef Automatically compress debug info unless no-debuginfo-compression is set
This uses eu-elfcompress to compress the debuginfo. We use the older
zlib-gnu compression format which is older and has more widespread
support.

Closes: #43
Approved by: alexlarsson
2017-10-05 18:11:21 +00:00
Alexander Larsson 5818790510 Add extra-data source type
All this does is construct a finish arg, but it makes it a lot nicer
to create extra-data using manifest. Additionally, it allows you to
create per-arch extra data if you set only-arches on the source.

Closes: #40
Approved by: alexlarsson
2017-09-29 07:01:53 +00:00
Alexander Larsson 3e65d29fac Remove unused variables
These were reported by clang

Closes: #39
Approved by: alexlarsson
2017-09-28 09:12:10 +00:00
Alexander Larsson d768afabfe Drop all compat from the checksum in preparation of new stable release
This means a lot of caches will rebuild, but we're then in a
stage where we can start adding new things in a compat way in the
stable series.
2017-09-22 17:10:06 +02:00
Alexander Larsson 38f409a041 Add make-args and make-install-args to build-options
This lets you override these on a per-arch level.

Fixes https://github.com/flatpak/flatpak/issues/1029
2017-09-22 17:07:22 +02:00
Alexander Larsson cf6c310f04 Support qmake buildssytem 2017-09-11 16:46:43 +02:00
Alexander Larsson 5068a700d0 builder: Pass --die-with-parent to all flatpak build commands
This is not done by default anymore, as per
 75d7e76276
2017-08-30 11:27:57 +02:00
Alexander Larsson faba587a72 Move common/flatpak-utils.* to src/builder-flatpak-utils.* 2017-08-25 09:36:49 +02:00
Alexander Larsson 5823533bd7 Move builder/ to src/ 2017-08-25 09:30:53 +02:00