Commit Graph

118 Commits (master)

Author SHA1 Message Date
Alexander Larsson dad7bc71ce configure: Call LIBGLNX_CONFIGURE
This includes the libglnx configure checks

This fixes detection of e.g. copy_file_range
2018-02-14 18:46:23 +01: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
Alexander Larsson 9d1f1ed59c Delete non-builder files 2017-08-25 09:27:42 +02:00
Philip Withnall 59e4e3f72b build: Add -std=gnu99 to libglnx CFLAGS
It uses inline for loop initialisers, which are a C99 feature. Set
-std=gnu99 like ostree.git does for its libglnx submodule.

Based on a patch by Georges Basile Stavracas Neto
<georges.stavracas@gmail.com>.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2017-07-12 15:58:50 +01: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 7a550f2f68 build: Include config.h using CPPFLAGS
This ensures it’s always included in the build, regardless of whether
someone forgets to #include it from a C file.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2017-06-30 13:41:38 +02:00
Alexander Larsson ea803f1f80 OCI: Add flatpak_oci_sign_data 2017-03-29 17:14:36 +02:00
Colin Walters 2618a19716 Import ostree's compiler warnings, fix up callers
In ostree I maintain what I consider a "baseline" set of compiler
warnings that should *always* be fatal for a modern C project.

I noticed while working on a previous patch that a `-Werror=format`
warning wasn't fatal.

There are a few that are really, really important like
`-Werror=missing-prototypes`. I also take some like `-Werror=misleading-indentation`
which already caught some bugs.  See also https://lwn.net/Articles/678019/
2017-03-27 10:42:36 +02:00
Richard Hughes b3569e4e86 scripts: Fix 'make distcheck' 2017-03-02 12:26:55 +00:00
Thibault Saunier 75388609b3 scripts: Add a script to allow bisecting failures
The CLI is pretty similare to the `git bisect` one and works as follow:

  $ flatpak-bisect org.app.App start # Update application and get the history
  $ flatpak-bisect org.app.App bad # Sets current commit as first bad commit
  $ flatpak-bisect org.app.App checkout GoodHash # Checkout the first known good commit
  $ flatpak-bisect org.app.App good # Sets GoodHash as first good commit

... Here it starts bisection and checkouts a commit on the way, the user should launch the
app to check if the commit is good or bad and run:

  $ flatpak-bisect org.app.App good # if commit is good
  $ flatpak-bisect org.app.App bad # if commit is bad

flatpak-bisect will tell when the first bad commit is found.

Fixes https://github.com/flatpak/flatpak/issues/530
2017-02-23 17:41:06 +01:00
Alexander Larsson 55553af813 Remove old --with-priv-mode=caps
This doesn't work anymore
2017-01-30 12:11:55 +01:00
Simon McVittie 1d6834db4d flatpak-system-helper: remove dangling reference to EXTERNAL_INSTALL_DIR
If EXTERNAL_INSTALL_DIR wasn't defined (which is likely, since nothing
in the build system does), then we would tell the system helper
to search /exports/share, which is not Flatpak's territory
(but is a semi-commonly-used path for site-specific NFS shares,
which might have contents that are inappropriate to search here).

Installations that do define an external installation directory
(Endless OS?) can easily override the Environment to include it
by placing a drop-in in
/etc/systemd/user/flatpak-system-helper.service.d/external.conf
or similar.
2017-01-20 15:05:28 +01:00
Ikey Doherty 3b64fbc4f5 profile: Support alternative profile.d locations
Typically Linux distributions employ /etc/profile.d for system wide
environment manipulation prior to multi-user initialisation. Modern
distribution efforts split the vendor configuration from the local
sysadmin configuration and data, by not using the /etc/ directories,
for example.

To enable this stateless pattern, this change adds a new --with-profile-dir
option to use an alternative location, such as within /usr/share/. This
ensures that the data (not configuration) is owned through the update
process, and does not conflict with changes made locally to the system,
enforcing domains of ownership.

To preserve backwards compatible behaviour, the default directory remains
set to /etc/profile.d.

Signed-off-by: Ikey Doherty <ikey@solus-project.com>
2017-01-19 10:05:13 +01:00
Alexander Larsson 5c2999fe20 Initilize MAINTAINERCLEANFILES so sub-makefiles can append to it 2017-01-16 11:37:44 +01:00
Cosimo Cecchi 78c3391b78 system-helper: make sure to run with XDG_DATA_DIRS set
Otherwise we can see in the log that update-mime-database will complain
about it not being set when installing an application using the system
helper.
2017-01-16 11:36:48 +01:00
Simon McVittie f966605563 build: run install-test-data-hook even if using system bwrap
The !WITH_SYSTEM_BWRAP conditional was too broad here.

Signed-off-by: Simon McVittie <smcv@debian.org>
2016-08-01 11:28:45 +01:00
Ray Strode f5ddf78c79 install dbus systemd service file snippet
flatpak currently installs a gdm env.d and a bash profile.d file to
ensure XDG_DATA_DIRS is set to the right value.  Neither is sufficient
when the dbus daemon is activated as a system --user service.

This commit adds a dbus service file snippet to frob its environment
variable for that case.
2016-07-26 13:33:31 -04:00
Cosimo Cecchi 90a3522148 document-portal: add support to activate paths inside /app
When the document portal is called from within the sandbox with an
app-private file path, translate the path to a document portal URI in
order to make it available to other applications.
2016-07-11 15:58:29 -07:00
Simon McVittie ee99e8afff Add BWRAP and --with-system-bubblewrap configure arguments
This lets distributors share a system copy of bubblewrap (>= 0.1.0)
between Flatpak and any other projects that benefit from it, if they are
careful to keep new versions in sync. The default is still to use the
bundled submodule, ensuring compatibility and simplifying dependencies.

Enable $PATH search everywhere that runs bwrap, so that $BWRAP doesn't
necessarily need to be a fully-qualified path.

Signed-off-by: Simon McVittie <smcv@debian.org>
2016-06-26 11:09:03 +01:00
Simon McVittie c59fba9be3 tests: don't treat helper scripts as though they were tests
We shouldn't install .test metadata for these, and run them as TAP
test scripts. In glib-tap.mk jargon that makes them "extra scripts".

Signed-off-by: Simon McVittie <smcv@debian.org>
2016-06-25 00:45:09 +01:00
Simon McVittie 3fc47aa0d3 Link libselinux into bwrap (if enabled) with LDADD, not LDFLAGS
As explained in bubblewrap commit f6ca3690, libraries should
always go in LDADD and not LDFLAGS, because the order of arguments
to the linker matters. Many distributions' linkers are tolerant
enough that it doesn't matter in practice, but it matters for
static linking, and it might also matter on Ubuntu.

Signed-off-by: Simon McVittie <smcv@debian.org>
2016-06-12 17:08:47 -04:00
Simon McVittie ee77be10b5 tests: clean up what is distributed
Listing variables whose values are conditional in EXTRA_DIST is
problematic: if Flatpak was configured without installed-tests,
we would not distribute those files. This is a problem during
distcheck, where installed-tests are disabled.

For files not placed in a special subdirectory, glib-tap.mk handles
this for us. For the keyring and the databases, we have to do it
ourselves, by arranging for them to be in a dist_ variable that is
special to Automake - when determining what to distribute, Automake
includes anything that is selected for distribution under any
combination of conditionals.

While I'm here, include test keyring's README in tarballs: its advice
is equally applicable in a tarball release.

Signed-off-by: Simon McVittie <smcv@debian.org>
2016-06-12 10:35:13 +01:00
David King b230abe4fe Include README.md in tarball 2016-05-31 10:38:29 +02:00
David King 965b56fcc5 build: Use AM_DISTCHECK_CONFIGURE_FLAGS
DISTCHECK_CONFIGURE_FLAGS is for users and packagers to override
distcheck options, while AM_DISTCHECK_CONFIGURE_FLAGS is for the
maintainer of the software.

https://www.gnu.org/software/automake/manual/automake.html#DISTCHECK_005fCONFIGURE_005fFLAGS
2016-05-31 10:35:14 +02:00
David King fc6282e865 bwrap: Move to under libexecdir
According to the FHS, applications which place internal libraries in
/usr/libexec should not also use /usr/lib for this purpose:

http://refspecs.linuxfoundation.org/FHS_3.0/fhs/ch04s07.html

As several flatpak helpers are already installed in libexecdir, move
the bwrap helper to /usr/libexec/flatpak-bwrap.
2016-05-30 18:40:12 +02:00
Alexander Larsson 70c2da02ed Update PRIV_MODE_SETCAPS with the new required caps
We now need setuid/setgid caps too.
2016-05-24 09:44:48 +02:00
Alexander Larsson c635633e6b Add --with-system-install-dir option 2016-05-18 11:11:03 +02:00
Alexander Larsson aa11387031 tests: Add test-run-system.sh 2016-05-17 17:49:55 +02:00
Alexander Larsson 28b549156a Split out permission store from session helper
This is now available as org.freedesktop.impl.portal.PermissionStore
2016-05-09 14:07:22 +02:00
Alexander Larsson 5e9b247d26 Migrate ~/.local/share/xdg-app to ~/.local/share/flatpak 2016-05-09 12:21:28 +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 6a613d1fab Rename all non-autogenerated symbols to flatpak 2016-05-09 09:00:20 +02:00
Alexander Larsson 1df3e4845b Fix various distcheck issues 2016-05-03 09:36:33 +02:00
Alexander Larsson bffaa12301 Remove old gtester references 2016-05-03 09:25:05 +02:00
Alexander Larsson 4c3bf179e2 Use bubblewrap instead of xdg-app-helper
Bubblewrap is a new tool from project atomic. Its similar to the old
xdg-app-helper, but even more minimal, and a bit more generic. Its designed
to be easy to git submodule install, but at some point we will probably
support using the system installed version too.

Using bubblewraps lets us share the load of security mainainance and
allows other people to use bubblewrap to do their own unprivileged
sandboxes.
2016-04-29 15:52:44 +02:00
Alexander Larsson ee7be7f82d Build bwrap 2016-04-29 15:38:23 +02:00
Alexander Larsson 3d3ebf814d Support installed tests 2016-04-27 16:37:15 +02:00
Alexander Larsson 8ac40150a6 Initial (empty) version of system helper 2016-04-25 18:59:17 +02:00
Alexander Larsson 351c2d5bd2 Read system remotes from /etc/xdg-app/remotes.d/*.conf 2016-04-21 18:47:11 +02:00
Alexander Larsson 40feb18556 Set xdg-app as the log domain 2016-02-22 08:46:49 +01:00
Alexander Larsson 1fa367199a Allow overriding XDG_APP_BINDIR using make vars 2016-02-11 13:36:34 +01:00
Simon McVittie 0a813296d8 Remove unset variable from EXTRA_DIST
Signed-off-by: Simon McVittie <smcv@debian.org>
2016-01-29 09:50:44 +01:00
Simon McVittie a0fc3c1df3 Distribute .service.in files in tarballs
Signed-off-by: Simon McVittie <smcv@debian.org>
2016-01-29 09:50:30 +01:00
Alexander Larsson a754db12a2 Merge pull request #106 from smcv/symbol-hiding
Hide non-public symbols from libglnx and libxdgapp-common
2016-01-29 09:01:37 +01:00
Alexander Larsson 7f20b44679 Merge pull request #107 from smcv/sd-units
Add systemd user units
2016-01-29 09:00:36 +01:00
Alexander Larsson f0e87af929 Merge pull request #109 from smcv/fhs
Move XDG_APP_SYSTEMDIR to /var/lib/xdg-app or similar
2016-01-29 08:54:25 +01:00
Simon McVittie 8cfad98738 Move XDG_APP_SYSTEMDIR to /var/lib/xdg-app or similar
The FHS specifies a limited number of subdirectories for /var,
which do not include xdg-app. Packaging systems like RPM and dpkg
use a subdirectory of /var/lib, so it seems appropriate for system-wide
xdg-app runtimes and apps too.

Signed-off-by: Simon McVittie <smcv@debian.org>
2016-01-29 00:23:35 +01:00
Simon McVittie 9efe31e8d4 Add systemd user units corresponding to the D-Bus session services
Signed-off-by: Simon McVittie <smcv@debian.org>
2016-01-28 23:45:47 +01:00