Alexander Larsson
65f1cf993d
Create and use flatpak_file_get_path_cached
...
This is simpler that the one in libgs, as well as lockless. Also, it
removes one more use of libgs.
2016-08-22 10:22:42 +02:00
Alexander Larsson
9c907c992d
Replace gs_shutil_rm_rf with small helper wrapper over libglnx
2016-08-22 10:06:08 +02:00
Alexander Larsson
e0bd22bfe8
Add flatpak_mkdir_p helper and use it
...
This replaces all current callers of gs_file_ensure_directory with
equivalent code.
Actually, two instances were calling gs_file_ensure_directory with
FALSE, i.e. error out on EEXIST, but those cases seem fine with the
do-nothing-if-exists semantics.
2016-08-22 09:29:24 +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
Alexander Larsson
fb3bfae85b
builder: Add --stop-at=module
...
Stop building at a specified module from the json file.
This is useful during development. For instance, you can do --stop-at=main-app
to build all the dependencies into the appdir, then you can do a build of an
already checked out git repo (possibly with changes).
2016-08-19 11:25:23 +02:00
Alexander Larsson
f622b014a7
builder: Handle symbolic icons in rename-icons
2016-08-19 11:05:18 +02:00
Alexander Larsson
0d115fb2e7
builder: Save a copy of the base manifest
2016-08-17 14:24:32 +02:00
Alexander Larsson
7431fff588
Fix up pyo stale file handling
...
We were not doing what the comments said we should, and we also
want to change what happens in the case of an old py file from
a previous layer (such as a base layer in a runtime) has a non-rewritten
.pyc file. In that case we want to assume its correct and fix it up.
2016-08-11 07:54:48 +02:00
Alexander Larsson
348b7f9ab4
builder: Add some printouts if we remove stale .pyc files
...
This makes it easier to figure out why it disappeared
2016-08-11 07:54:25 +02:00
Alexander Larsson
006d9a1927
Correctly handle .pyc mtimes for .py files changing multiple times
...
If a .py file changes multiple times we can end up in a situation
where there is an .py file with corresponding .pyc file that we
rewrote, so both are now mtime==1. Then a new version of the .py file
is added, but the corresponding .pyc file is not updated. This means
that the .pyc file is stale, and python would not normally use it.
However, we will later change the mtime on the .py file to 1, causing
the old .pyo file to look up-to-date even though its stale.
We fix this by detecting the case where the is a new mtime on a .py file
where the .pyc file doesn't match, and remove the stale .pyc file.
2016-08-10 16:24:11 +02:00
Matthew Leeds
392c597c5f
utils: Print a debug message when launching subprocesses
...
This commit makes flatpak print a debug message (which only appears to
the user if the -v option is used) whenever a subprocess is launched.
This should make debugging easier, both for flatpak users and
developers.
2016-08-05 14:15:19 -04: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
Matthias Clasen
75218c4a65
Fix license headers
...
We were referring to the nonexisting "version 2" of the
Lesser GPL. It should be "version 2.1".
2016-07-29 14:27:49 -04:00
Matthias Clasen
3a281d0782
Add locations to some error messages
...
When a file is not found, mention where we looked for it.
This provides useful context for understanding the error.
2016-07-29 14:16:31 -04:00
Matthias Clasen
91b7b0a419
Mention app dir in output
...
This can help making sense out of error messages when something
goes wrong.
2016-07-29 14:15:46 -04:00
Matthew Leeds
b051571de8
builder: Fix a few memory leaks
...
These changes fix some memory leaks that valgrind pointed out.
2016-07-28 16:03:42 -04:00
Matthew Leeds
fcd6da2fa3
builder: Print a message when running flatpak build-finish
...
This commit makes flatpak-builder print the flatpak build-finish command
it constructs before executing it in a subprocess, which matches the
behavior for flatpak build-init and flatpak build.
2016-07-18 14:29:41 -04:00
Simon McVittie
5b8fdb4998
unrpm: prevent shell injection
...
Substituting into a shell command-line without escaping is a bad idea.
If the argument is attacker-controlled, it's a security vulnerability;
if the argument is legitimate-user-controlled (as I think it is here)
it's merely wrong.
We could escape the filename with g_shell_quote(), but it's more
straightforward to take advantage of the shell's argument processing.
The first positional parameter (if given) is $0, and the rest are $@.
Signed-off-by: Simon McVittie <smcv@debian.org>
2016-07-18 14:32:14 +01:00
Christophe Fergeau
2b609c6624
Add RPM archive support
2016-07-15 11:13:28 +02:00
Christophe Fergeau
543d81c2fe
Factor some zip uncompression code in a helper func
2016-07-15 11:13:28 +02:00
Alexander Larsson
b5204c908d
builder: Clear mtime to 1, not 0, to match what new ostree does
2016-07-01 14:25:22 +02:00
Alexander Larsson
eaeb132a5a
builder: Set the new extension properties
...
Set autodelete=true on locale and debug extensions.
Set no-autodownload=true on debug extensions.
Thats what will happen anyway, but its nice to be explicit.
Also, remove subdirectories=true on the locale extensions, as
we're not using that anymore.
2016-06-30 16:55:32 +02:00
Alexander Larsson
9558d7d6ae
builder: Strip "." from locale names too
...
For instance, "C.utf8" => "C" or "en.utf8" => "en".
Mostly this was already handled for e.g. "en_US.utf8" though...
2016-06-30 11:47:45 +02:00
Alexander Larsson
de8d8a36c2
Merge pull request #158 from hadess/wip/use-git-patch
...
Add "use-git" option for patch source types
2016-06-28 15:24:49 +02:00
Alexander Larsson
b00dbed3bd
builder: Report errors to stderr, not stdout
2016-06-28 15:08:09 +02:00
Bastien Nocera
c646f386eb
builder: Add "use-git" option for patch source type
...
Closes #6
2016-06-28 14:24:16 +02:00
Matthias Clasen
d3629b8e72
builder: Add support for a var runtime
...
flatpak build-init as a --var option - support this as a
"var" key in the json.
2016-06-23 10:01:40 +02:00
Alexander Larsson
bd485fbc01
builder: Report error details when failing to checkout cache.
2016-06-09 17:45:44 +02:00
Alexander Larsson
5eb671aac4
builder: Warn for duplicate module names
2016-06-09 12:43:31 +02:00
Matthias Clasen
99e4f83e33
Allow inclusions in the module list
...
When we see a string in the modules array, parse it as a json
file and use the resulting BuilderModule object.
2016-06-09 01:01:37 -04:00
Matthias Clasen
5225e7b1d0
manifest: Prepare expand_modules to report errors
...
Move the expand_modules call from the modules setter to
builder_manifest_start, where we have a chance to report
errors.
2016-06-09 00:29:02 -04:00
Matthias Clasen
e25e379a2a
manifest: expand module list
...
Linearize the tree of modules and submodules when the modules
are set on the manifest, while filtering out disabled modules
at the same time.
Skip source-less modules when building; this makes it possible
to have modules that only contain submodules.
With this approach, we use the tree structure of modules for
serializing and deserializing to and from json, while using
a linear list of modules for building.
2016-06-08 23:56:38 -04:00
Matthias Clasen
2757c63fea
Add a modules property to BuilderModule
...
This will let us load modules recursively.
2016-06-08 23:56:38 -04:00
Matthias Clasen
9a8eef8597
manifest: Skip source-less modules when building
...
Building such modules won't produce anything. And future
commits will make source-less modules useful to support.
2016-06-08 23:56:38 -04:00
Matthias Clasen
914b841481
module: Be a bit more robust
...
When we call builder_module_cleanup_collect on a module that
has no changes, we shouldn't crash.
2016-06-08 23:55:57 -04:00
Alexander Larsson
bd66da0dad
builder: Add support for patching mtime in python bytecode headers
...
This makes them work at runtime (as the mtime will then be 0) and
makes builds more repeatable.
2016-06-08 13:28:27 +02:00
Alexander Larsson
959fec1cd3
Zero out mtime when commiting
...
This means we get the same behaviour as if we checked out of
the cache. Also, its the same as the final behaviour will be
when running in flatpak.
2016-06-08 13:14:09 +02:00
Alexander Larsson
4990dd5f86
builder: Manually zero mtime of cache checkout
...
This works around an ostree bug where this didn't happen in the
mismatched mode (regular checkout, user repo) we're using.
2016-06-08 11:11:24 +02:00
Matthias Clasen
6d1837ce4b
Make an error message more helpful
...
When we see somebody trying to use a command with spaces, we
should be helpful and point out how to do what they want to do.
2016-06-03 09:22:21 -04:00
Alexander Larsson
d950ed338f
Merge pull request #65 from matthiasclasen/builder-messages
...
Add another status message to flatpak-builder
2016-06-02 09:12:08 +02:00
Alexander Larsson
4805d49bdf
Merge pull request #37 from matthiasclasen/command-check
...
flatpak-builder: Ensure after build that the binary listed in "command" is installed
2016-06-02 08:58:30 +02:00
matthiasclasen
5e2be3cb10
builder: Some consistency fixes for output ( #64 )
...
* builder: Some consistency fixes for output
Capitalize all error messages.
2016-06-02 08:50:58 +02:00
Matthias Clasen
7794a70f50
builder: Check that command exists after build
...
This keeps us from creating a non-working flatpak.
2016-06-01 23:31:57 -04:00
Matthias Clasen
c7594e5515
Add another status message to flatpak-builder
...
Add a message for the 'rewriting the desktop file' step.
This helps in providing context for error messages when something
goes wrong.
2016-06-01 16:21:25 -04:00
Alexander Larsson
c7c9505e90
Always initialize autofree variable
2016-05-27 09:19:45 +02:00
Alexander Larsson
8362d9cafe
Merge pull request #36 from matthiasclasen/module-errors
...
flatpak-builder: Print name of failed module on error
2016-05-27 09:02:44 +02:00
Alexander Larsson
f9cbcc3996
Merge pull request #49 from jsoref/spelling
...
spelling fixes
2016-05-27 09:02:14 +02:00
Josh Soref
37409c4095
spelling: sections
2016-05-27 06:46:23 +00:00
Alexander Larsson
6b65972434
Merge pull request #47 from matthiasclasen/build-error
...
builder: Avoid a confusing error
2016-05-27 08:45:21 +02:00
Matthias Clasen
5f928b30ac
builder: Prefix module errors
...
Sprinkle g_prefix_error calls in builder-module.c, to make
sure that module-specific errors get a "module foo:" prefix.
This is not quite perfect, since callers tend to impose their
own prefix as well, but at least it clearly identifies the
module in which the error ocurred.
2016-05-27 00:25:28 -04:00
Matthias Clasen
6d1d9724c5
builder: Warn about bad module names
...
Putting spaces or slashes in module names is a recipe for
cryptic error from one of the many constructed flatpak
commandlines. Better warn early on, as soon as we see such
a name.
2016-05-27 00:05:55 -04:00
Matthias Clasen
c89a610a91
builder: Avoid a confusing error
...
When the sdk is not specified in the manifest, we get a confusing
error from running flatpak info with an invalid commandline.
Avoid that by checking for the the sdk string beforehand.
2016-05-26 23:35:41 -04:00
Alexander Larsson
e9e92b79fe
builder: Support argument to the command with --run
...
For instance, this lets you do:
flatpak-builder app foo.json ls -l
Without flatpak-builder complaining about not knowing "-l".
2016-05-26 12:44:51 +02:00
Alexander Larsson
33c0d49212
builder: Support permission ops with --run
2016-05-26 12:24:43 +02:00
Alexander Larsson
f6b4e8ead6
builder: Make the options and help output for --run a bit nicer
...
We now pre-process for the --run argument in order to only show
related arguments.
2016-05-26 11:20:23 +02:00
Stephan Bergmann
3b6b0da108
exec* returns -1 on error
...
...so use the == -1 idiom as already used in common/flatpak-run.c
(another fix would be to drop the if completely, as exec* doesn't
return on success)
2016-05-24 17:44:33 +02:00
Simon McVittie
a4641280a7
Fix various spelling mistakes
...
Mostly detected by Debian's Lintian tool.
Signed-off-by: Simon McVittie <smcv@debian.org>
2016-05-17 11:43:32 +01:00
Alexander Larsson
9d6bc99649
builder: Untar with --no-same-owner
...
Without this if you run as root (which is generally a poor idea) it will
extract the sources with the user/group specified on the archive, which
is never what you want when building code.
2016-05-12 19:35:32 +02:00
Alexander Larsson
28c1c65d8f
Builder: Support disabled=true to not build a module
...
This is a simple way to "comment out" a module.
2016-05-09 17:24:42 +02:00
Alexander Larsson
8abbc0186e
Rename everything but the on-disk location to flatpak
2016-05-09 11:11:55 +02:00
Alexander Larsson
ba37b22d78
Rename library to libflatpak
2016-05-09 09:46:26 +02: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
098e3e426d
build: Look for files in the same dir as the manifest, not in the CWD
...
This makes more sense, the CWD is not necessary a useful place.
2016-05-04 08:47:38 +02:00
Tristan Van Berkom
51e387159b
build-export: Add --arch option
...
This patch adds the --arch option to the build-export builtin command.
Previously build-export derives this from the metadata and then falls back
to xdg_app_get_arch(), except that this does not work when the metadata does
not specify an arch (such as with extensions like .Debug or .Locale).
https://bugs.freedesktop.org/show_bug.cgi?id=95226
2016-05-03 09:05:56 +02:00
Tristan Van Berkom
aa69c1afef
xdg-app-builder: Add --arch command line option
...
This is only useful for building for architectures which are
compatible with the build host, e.g. building i686 binaries on
an x86_64 build host.
2016-05-02 08:46:52 +02:00
Tristan Van Berkom
bc7bfeef6f
BuilderSourceFile: Delete destination file
...
Sometimes you want to replace an existing file, like a config.sub,
and sometimes that existing config.sub does not have the writable
bits set. Just delete the file if we intend to replace it anyway.
2016-04-27 14:15:05 +02:00
Alexander Larsson
9171c94662
builder: Fix unused return value warnings
...
This just adds a (void) cast to avoid the warnings.
2016-04-21 09:49:24 +02:00
Alexander Larsson
af03d2f5b4
Remove unused local variables reported by clang
2016-04-21 09:48:56 +02:00
Joaquim Rocha
f112d117da
builder: Do not repeat the separate locales path
...
These changes replace all occurrences of 'share/runtime/locale' with a
define so it will avoid possible mistakes when having to be replaced
one day.
2016-04-20 12:32:02 +02:00
Joaquim Rocha
39279c8b8b
builder: Skip separate locales exportation if directory doesn't exist
...
This will avoid errors when separate_locales is set to true but the
locales directory does not exist. This is the case of many apps that do
not support separate locales but haven't specifically set
separate_locales to false in the configuration.
2016-04-20 12:32:02 +02:00
Alexander Larsson
265ba5e528
Merge pull request #128 from matthiasclasen/run-fixes
...
Some fixes for xdg-app-builder --run
2016-04-15 11:50:34 +02:00
Tristan Van Berkom
401c7b2dea
BuilderModule: Use builder_options_get_config_opts()
...
The configure arguments are now a combination of the
default config-opts plus the accumulative sum of the config-opts
specified in the build-options that are active for a given build
context.
https://bugs.freedesktop.org/show_bug.cgi?id=94940
2016-04-15 10:25:55 +02:00
Tristan Van Berkom
17ec9ef3b0
BuilderOptions: Added 'config-opts' option.
...
Allows conditional configure arguments.
https://bugs.freedesktop.org/show_bug.cgi?id=94940
2016-04-15 10:25:55 +02:00
Matthias Clasen
9426438c0b
Fix --run
...
I have a manifest which has --command=terminix in the finish-args,
and xdg-app build doesn't like that option, so filter it out.
2016-04-14 19:11:48 -04:00
Alexander Larsson
416ad53878
Fix typo for no-debuginfo properly
2016-04-14 19:28:08 +02:00
Matthias Clasen
838d109e58
builder: Add an option to erase app dir
...
Having to run rm -rf yourself before every new build attempt
gets old. Lets add an option to have xdg-app-builder do it
for us.
2016-04-13 23:06:59 -04:00
Alexander Larsson
d52cb3b378
builder: better error messages if failing to find desktop file
2016-04-11 11:20:45 +02:00
Alexander Larsson
545a699698
builder: Only create one locale extension
...
Given that each app can have 100 locates, ostree just doesn't scale
to having a branch per app/locale combo. For 100 apps and 100 locales
that would be 10000 branches.
Also, things like xdg-app remote-list doesn't properly handle that
either.
We need to handle this by e.g. supporting subsetting the pull of
the locale extension.
2016-04-07 13:02:36 +02:00
Alexander Larsson
7e6b18eddc
builder: Actually respect the defined branch
2016-03-23 16:42:40 +01:00
Alexander Larsson
d32b13a695
builder: Checksum metadata-platform contents for cache too
2016-03-23 14:54:47 +01:00
Alexander Larsson
d6f9e03a61
builder: Use the right field for the platform cache checksum
...
It was looking at metadata, instead of metadata_platform
2016-03-23 14:49:59 +01:00
Alexander Larsson
b3f9da3648
builder: Build single every-locale extension
...
This is useful for testing, as well as makes building derived runtimes
easier.
2016-03-21 16:37:51 +01:00
Alexander Larsson
08959b4373
xdg-app-builder: Don't export if --build-only specified
2016-03-17 20:55:55 +01:00
Alexander Larsson
728e7a89e1
xdg-app-buildeR: Remove unnecessary spew
2016-03-14 11:57:06 +01:00
Alexander Larsson
6c5e1a8a92
Fix some compiler warning (unused vars)
2016-02-25 16:09:49 +01:00
Alexander Larsson
467e8bf4db
builder: Add sources referenced from debuginfo into Debug runtime
2016-02-23 14:13:36 +01:00
Alexander Larsson
90aaed7f7b
builder: Build runtimes in /run/build-runtime
...
This way we the runtime build dir doesn't conflict with the app dir.
Which is good if we want debuginfo with sources for both.
2016-02-23 14:12:20 +01:00
Alexander Larsson
22d997e712
builder: Add builder_get_debuginfo_file_references
2016-02-23 12:44:01 +01:00
Alexander Larsson
f98f565df0
Add support for separated locales when creating platforms
2016-02-18 21:49:13 +01:00
Alexander Larsson
f1d401e6cd
Migrate locales after importing parent runtime
2016-02-18 21:48:33 +01:00
Alexander Larsson
b44bbc13c3
Move migrate_locales to builder-utils.c
2016-02-18 21:47:29 +01:00
Alexander Larsson
d5d47aa458
builder: Support separating out locale data
2016-02-18 19:22:34 +01:00
Alexander Larsson
bb4d67b086
builder: Support tags
2016-02-17 14:54:16 +01:00
Alexander Larsson
71259fa711
builder: Support local archives with path property
2016-02-17 14:50:01 +01:00
Alexander Larsson
6c5feb4e05
builder: Add support for --run to start a command in the build dir
2016-02-17 10:26:35 +01:00
Alexander Larsson
c07b1807d1
builder: Move CFLAGS/CXXFLAGS handling into BuilderOptions
2016-02-17 10:26:35 +01:00
Alexander Larsson
e233705379
builder: Add build_context_get_build_dir()
2016-02-17 10:26:32 +01:00
Alexander Larsson
393163200d
builder: Always create unversioned symlinks while building modules
...
This way if things go wrong you can always find the latest build
2016-02-17 08:43:29 +01:00
Alexander Larsson
faecde5da5
builder: Report errors if eu_strip fails
...
This was ignoring errors and causing "set-on-top-of-existing-GError"
messages.
2016-02-16 14:45:23 +01:00
Alexander Larsson
ea176cd63a
builder: Put all builds in a .xdg-app-builder/build subdir
...
I.e. instead of .xdg-app-builder/build-foo it will be
.xdg-app-builder/build/foo. This makes it easier to separate these
out, and it allows you to symlink this directory to /run/build to pick
up all sources when you use --keep-build-dirs.
2016-02-10 10:15:25 +01:00
Alexander Larsson
9c6d6242a9
builder: Avoid reusing set GError
...
my_error was used twice, without clearing inbetween, which can
cause issues.
2016-02-08 16:21:28 +01:00
Alexander Larsson
32e9502675
Fix some g_propagate_error typos
2016-02-08 16:16:38 +01:00
Alexander Larsson
1cc94f4f04
builder: Use predictable names for build dirs
...
Instead of random hex, we use a pure counter
2016-02-08 11:30:48 +01:00
Alexander Larsson
43ac6421f9
builder: Store exact sdk commit id in the build cache and manifest
...
This means we rebuild everything if the sdk changes, and you can also
see what version an app was built against.
2016-02-03 10:57:50 +01:00
Alexander Larsson
9f2769e0ce
builder: Use non-parallel-make option instead of looking at .NONPARALLEL
2016-02-01 21:40:22 +01:00
Alexander Larsson
913eccd30f
builder: Add shell source
...
This lets you run shell commands to modify the source
2016-02-01 21:26:20 +01: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
225c359128
Fix include order to build with older libsoup versions
2016-01-28 14:35:46 +01:00
Alexander Larsson
20d16625a8
builder: support using appstream-compose to create appstream files
2016-01-22 15:33:03 +01:00
Alexander Larsson
e8adcc0eb5
builder: Add spew when commiting to cache
2016-01-22 14:08:43 +01:00
Alexander Larsson
5c89d5a4e9
builder: Add some spew before build-init
2016-01-22 12:30:00 +01:00
Alexander Larsson
472405ff7f
builder: Add platform-extensions
2016-01-20 14:41:09 +01:00
Alexander Larsson
6d2aa7b29e
builder: Support sdk-extensions
2016-01-20 14:11:29 +01:00
Alexander Larsson
622adf88d0
builder: Put debuginfo in the right place for runtimes
2016-01-20 14:00:49 +01:00
Alexander Larsson
6189fd3f7a
build-finish: Fix exports
...
This was reading an unintialized variable
2016-01-19 16:53:11 +01:00
Alexander Larsson
1a4f257cbd
builder: Remove leftover debug spew
2016-01-19 13:08:15 +01:00
Alexander Larsson
2f3e790651
builder: Fix error with va_start use
2016-01-19 12:38:16 +01:00
Alexander Larsson
071561637a
Remove unused variables
2016-01-19 12:37:51 +01:00
Alexander Larsson
8b3cc77955
builder: Handle modules with invalid refname characters in the cache
2016-01-19 11:57:37 +01:00
Alexander Larsson
496cbac3db
cache: Don't fail to create cache if parent dir is not created
2016-01-18 17:17:04 +01:00
Alexander Larsson
87ad85116e
builder: Fix random crash due to uninitialized memory
2016-01-18 16:14:42 +01:00
Alexander Larsson
e91a4c79e0
Builder: Support commiting a platform
2016-01-18 15:22:56 +01:00
Alexander Larsson
3341fb08ad
builder: Allow building runtime sdks (based on existing sdk)
...
This includes a few different changes:
* Add build-runtime boolean property
* Rename "app-id" property to "id"
* Add metadata property to use a custom base metadata file
* Default to writable-sdk to TRUE for runtimes
* Default prefix to /usr for runtimes
* Put manifest in usr for runtimes
* Pick up debuginfo from usr for runtimes
* Make build-finish work on runtimes, but only export appdata
2016-01-18 11:43:02 +01:00
Alexander Larsson
701d800059
builder: Correctly handling non-existing app dir when applying cache
2016-01-18 11:36:24 +01:00
Alexander Larsson
f2853a460b
cache: Remove target directory before checking out cache
...
This will be empty anyway, and if its there the checkout fails.
2016-01-17 21:23:03 +01:00
Sam Thursfield
d5c176f440
builder: Don't delete the APPDIR directory
...
A new user might think that APPDIR is the location of the app to be
built, and run something like `xdg-app-builder . ./manifest`. This
could silently the user's entire project that they are trying to
package, which is not acceptable at all! Even if you think it is their
fault for not reading the manual first!
This commit means that APPDIR is no longer deleted. Instead,
xdg-app-builder checks whether it is empty and, if it is not, it asks
the user to delete the contents and then rerun it.
This means you now have to do `rm -Rf APPDIR; xdg-app-builder APPDIR
MANIFEST` when developing your manifest, but I think that's better than
having a build tool that can optionally delete your whole project.
2016-01-17 18:16:05 +00:00
Alexander Larsson
93e8d8bd78
builder: Add some spew when downloading files
2016-01-14 16:45:44 +01:00
Alexander Larsson
f3bf30334c
builder: Also apply cleanup to changes in usr
2016-01-14 11:16:17 +01:00
Alexander Larsson
f8894af8d7
builder: Change the way the cache is indexed
...
Instead of a single ref we use one ref per stage (init, build module X,
cleanup, finish). This means we don't have to iterate in the cache
lookup, and it also means we get clean refs for each stage so one
can easily inspect the differences between the stages.
2016-01-13 09:50:15 +01:00
Alexander Larsson
d43e797b4b
builder: Add support for rename-appdata-file option
2016-01-12 16:30:20 +01:00
Alexander Larsson
f56d6a7290
builder: Fix up cleanup matching
2016-01-12 16:06:53 +01:00
Alexander Larsson
55e934ee76
builder: Fix handling of builddir
2016-01-12 14:25:41 +01:00
Alexander Larsson
4c47951cbd
builder: Add some more spew when exporting
2016-01-12 12:36:07 +01:00
Alexander Larsson
a6eab3e732
builder: Don't break if ccache not enabled.
2016-01-12 12:32:44 +01:00
Alexander Larsson
689c36aa8f
builder: Pass --body, --subject and --gpg-sign to build-export
2016-01-12 12:25:45 +01:00
Alexander Larsson
f95cd2d029
builder: Add option to enable ccache use in build
2016-01-12 12:09:09 +01:00
Alexander Larsson
59c8c49bdd
builder: Run builds in /run/build/$modulename
...
This creates repeatable builds for anything that leaves the build
dir in the resulting files, such as debug info.
2016-01-12 11:05:37 +01:00
Alexander Larsson
13d07d6a6f
builder: Add support for exporting with --repo=foo
2016-01-11 15:35:17 +01:00
Alexander Larsson
69d489bbef
builder: Create metadata.debuginfo if debug info exists
2016-01-11 14:37:30 +01:00
Alexander Larsson
b4fbb84f0a
common: Move path_match_prefix to common
2016-01-11 13:56:07 +01:00
Alexander Larsson
d3e1ffb4f7
builder: Match debuginfo files against regular cleanup patterns
...
I.e. if /lib/foo is cleaned, also clean /lib/debug/lib/foo.debug
2016-01-11 11:41:50 +01:00
Alexander Larsson
1b2ed4fe09
builder: Pass down global cleanups via BuildContext
2016-01-11 11:40:46 +01:00
Alexander Larsson
5896b5ae08
builder: Pass down keep-build-dirs via BuildContext
2016-01-11 11:40:46 +01:00
Alexander Larsson
825611a758
builder: Break out helpers for path matching
2016-01-11 11:40:46 +01:00
Alexander Larsson
98a7d731ad
builder: Add support for separating out debuginfo
2016-01-11 11:40:46 +01:00
Alexander Larsson
62b4ffaa72
builder: Use libelf to detect elf files
...
This additionally looks for already stripped files
2016-01-11 11:40:46 +01:00
Alexander Larsson
8be0031355
builder: Print all files removed by cleanup
2016-01-11 11:40:46 +01: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
67de92042b
apps: Use "branch", not "version" when talking about app branches
2015-12-17 20:07:14 +01:00
Alexander Larsson
619adeb74c
builder: Add cleanup-command property
...
This allows you to do some custom cleanup operations
2015-12-16 14:50:05 +01:00
Alexander Larsson
ef3582325d
builder: Store the cache in BARE_USER mode
...
This has two advantages:
1) If building as non-root, then we can't modify xattrs, such as
selinux ones, yet selinux will write then, making a bare repo
not match the checksums (it has unexpected xattrs that selinux made)
2) We check out as MODE_NONE, not MODE_USER, which in combination with
BARE_USER forces the files to be copied out of the cache, rather
than using hardlinks into the cache which could mutate the cache.
2015-12-16 11:56:56 +01:00
Alexander Larsson
46558798a2
builder: Don't fsync on cache checkouts
2015-12-16 11:18:05 +01:00
Alexander Larsson
739b5ab6db
builder: Support writable-sdk option
2015-12-15 19:36:10 +01:00
Alexander Larsson
a0885d4576
builder: Allow specifying custom prefix
2015-12-15 19:36:06 +01:00
Alexander Larsson
43a09b3646
Fix unused variable warnings
2015-12-15 14:34:52 +01:00
Alexander Larsson
efe378f46c
builder: Fix typo in patch applying
...
It was using git, not patch
2015-12-15 08:14:20 +01:00
Alexander Larsson
a66da8e53c
builder: Fix build with old glib
2015-12-14 14:49:31 +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
54c52d9363
builder: Add --keep-build-dirs option
...
This is useful if you want to later make changes to the built stuff.
2015-12-09 21:10:22 +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
6a82dd4ee3
builder: Support specifying revision in bzr sources
2015-12-09 14:06:59 +01:00
Alexander Larsson
5b6f3749d5
builder: Support data: uri for files
2015-12-09 13:00:30 +01:00
Alexander Larsson
f16cc44a30
builder: Use SoupRequest to simplify download helpers
...
Also, this allows us to support data: uris, etc
2015-12-09 12:55:10 +01:00
Alexander Larsson
3fdfef7e40
builder: Allow optionally specifying remote file sources
2015-12-09 12:01:55 +01:00
Alexander Larsson
e39192b3d6
builder: Break out download_uri helper function in SourceFile
2015-12-09 11:42:04 +01:00
Alexander Larsson
3fb4226c81
builder: Make the builder manifest objects serializable to json
2015-12-09 10:33:54 +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
9fd6ce1779
builder: Don't use ":" in uri-as-filename
...
This confuses some versions of git, thinking the file is a uri
2015-12-02 14:07:09 +01:00
Alexander Larsson
44028aa273
builder: Error out if rename_error is set but not found
...
Also, ignore ENOENT during the traversal
2015-12-02 13:12:35 +01:00
Alexander Larsson
8dc06ba30c
builder: Add support for copy-icon option
2015-12-02 08:47:43 +01:00
Alexander Larsson
7176ca491a
builder: Consider the build_option when checksumming
2015-12-02 08:32:25 +01:00
Alexander Larsson
9dfcd4b452
builder: Fix build with g_autoptr backports
2015-12-01 16:40:45 +01:00
Alexander Larsson
5e96d10128
Fix some warnings
2015-12-01 16:39:01 +01:00
Alexander Larsson
83a59dd5a5
builder: Build with "make", not "make all"
...
This seems more compatible
2015-12-01 16:06:37 +01:00
Alexander Larsson
a8eefe6844
Remove stray semicolons
2015-12-01 12:31:20 +01:00
Alexander Larsson
6f9227d58f
builder: Support building from a subdirectory of the sources
2015-12-01 12:12:53 +01:00
Alexander Larsson
4cd2e1c993
Add script source type
2015-12-01 11:10:13 +01:00
Alexander Larsson
74e30c9b01
builder: Add post-install script support
2015-12-01 10:28:41 +01:00
Alexander Larsson
d6ae9e3d6c
builder: Add submodule support for git sources
2015-11-30 21:09:56 +01:00
Alexander Larsson
79c1f1246c
Remove leftover semicolon
2015-11-30 21:09:22 +01:00
Alexander Larsson
dd099f5769
builder: Fix typo in cmake support
2015-11-30 12:47:35 +01:00
Alexander Larsson
12d926ec65
builder: builddir != srcdir was broken becasue we never created the buildir
2015-11-27 10:23:17 +01:00
Alexander Larsson
2e0f34c435
builder: Add more headers around the spew for each new module
2015-11-27 10:23:17 +01:00
Alexander Larsson
56652c9ea1
builder: Add support for cmake and forced builddir
2015-11-27 10:23:14 +01:00
Alexander Larsson
106a5b06ec
Rename lib/ to common/ in preparation for public xdg-app library
2015-11-26 22:05:38 +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
06062d4428
builder: Add --build-only argument
2015-11-26 14:38:13 +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