Skip to content

Commit

Permalink
flatpak: new package
Browse files Browse the repository at this point in the history
Flatpak is a system for building, distributing, and running sandboxed desktop
applications on Linux.

Signed-off-by: Christian Stewart <[email protected]>
  • Loading branch information
paralin committed Mar 28, 2019
1 parent d6a4dc7 commit 7a3510e
Show file tree
Hide file tree
Showing 7 changed files with 243 additions and 0 deletions.
1 change: 1 addition & 0 deletions package/Config.in
Original file line number Diff line number Diff line change
Expand Up @@ -2163,6 +2163,7 @@ menu "System tools"
source "package/efibootmgr/Config.in"
source "package/efivar/Config.in"
source "package/emlog/Config.in"
source "package/flatpak/Config.in"
source "package/ftop/Config.in"
source "package/getent/Config.in"
source "package/htop/Config.in"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
From e2bba019451770372b51b1eabcea078454d4de38 Mon Sep 17 00:00:00 2001
From: Christian Stewart <[email protected]>
Date: Fri, 7 Dec 2018 00:16:42 -0800
Subject: [PATCH 1/2] Remove quirks in autotools setup process

The autogen.sh script ordinarily creates the gtk-doc.make file. The configure.ac
file has an error, the po/Makefile.in is written twice in the array, which
causes a configure-time error. This patch creates the gtk-doc.make file and
removes the duplicate makefile array entry.

Signed-off-by: Christian Stewart <[email protected]>
---
.gitignore | 1 -
configure.ac | 1 -
gtk-doc.make | 2 ++
3 files changed, 2 insertions(+), 2 deletions(-)
create mode 100644 gtk-doc.make

diff --git a/.gitignore b/.gitignore
index 7d643205..310c332d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -29,7 +29,6 @@ missing
stamp-h1
config.h.in
stamp-*
-gtk-doc.make
flatpak
flatpak-*.tar.xz
flatpak-session-helper
diff --git a/configure.ac b/configure.ac
index 91f9b826..21f3cf38 100644
--- a/configure.ac
+++ b/configure.ac
@@ -436,7 +436,6 @@ flatpak.pc
common/flatpak-version-macros.h
doc/reference/version.xml
doc/flatpak-docs.xml
-po/Makefile.in
])
AC_OUTPUT

diff --git a/gtk-doc.make b/gtk-doc.make
new file mode 100644
index 00000000..14f18fd4
--- /dev/null
+++ b/gtk-doc.make
@@ -0,0 +1,2 @@
+EXTRA_DIST =
+CLEANFILES =
--
2.18.1

Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
From 983639ae3d607893653deaaea834cea37b5df5f9 Mon Sep 17 00:00:00 2001
From: Christian Stewart <[email protected]>
Date: Fri, 7 Dec 2018 00:20:31 -0800
Subject: [PATCH 2/2] Fix HAVE_INTROSPECTION does not appear in AM_CONDITIONAL

This is a fix for HAVE_INTROSPECTION related errors derived from a fix
originally submitted to the Buildroot project by the author:

Hadrien Boutteville <[email protected]>

Apply the fix to the same issue in Flatpak:

During autoreconf GOBJECT_INTROSPECTION_CHECK could not be resolved because we
don't have introspection which provides its custom m4 macro. Reconfigure fails
with:

gdk/Makefile.am:196: error: HAVE_INTROSPECTION does not appear in AM_CONDITIONAL
gtk/Makefile.am:1347: error: HAVE_INTROSPECTION does not appear in AM_CONDITIONAL

We avoid to add a copy of introspection.m4 in the m4 directory of libgtk3 by
adding a check, as performed in Systemd.

Signed-off-by: Christian Stewart <[email protected]>
---
configure.ac | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index 21f3cf38..2be0d3a2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -316,7 +316,10 @@ if test x$enable_documentation = xyes; then
fi
AM_CONDITIONAL(BUILD_DOCUMENTATION, test x$enable_documentation = xyes)

-GOBJECT_INTROSPECTION_CHECK([1.40.0])
+m4_ifdef([GOBJECT_INTROSPECTION_CHECK],
+ [GOBJECT_INTROSPECTION_CHECK(1.40.0)],
+ [AM_CONDITIONAL([HAVE_INTROSPECTION], [false])
+ enable_introspection=no])

# gtkdocize greps for ^GTK_DOC_CHECK, so we need to put it on its own line
m4_ifdef([GTK_DOC_CHECK], [
--
2.18.1

37 changes: 37 additions & 0 deletions package/flatpak/Config.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
config BR2_PACKAGE_FLATPAK
bool "flatpak"
depends on !BR2_STATIC_LIBS # ostree, libfuse
depends on !BR2_TOOLCHAIN_USES_MUSL # ostree
depends on BR2_INSTALL_LIBSTDCPP
depends on BR2_PACKAGE_LIBGPG_ERROR_ARCH_SUPPORTS # libgpgme, libgpg-error
depends on BR2_TOOLCHAIN_HAS_THREADS # ostree, glib2
depends on BR2_USE_MMU # ostree, e2fsprogs, libfuse, libgpgme, glib2
depends on BR2_USE_WCHAR # ostree, glib2
select BR2_PACKAGE_APPSTREAM_GLIB
select BR2_PACKAGE_GDK_PIXBUF # appstream-glib
select BR2_PACKAGE_JSON_GLIB # appstream-glib
select BR2_PACKAGE_LIBARCHIVE
select BR2_PACKAGE_LIBCAP
select BR2_PACKAGE_LIBGLIB2 # json-glib appstream-glib
select BR2_PACKAGE_LIBGPGME
select BR2_PACKAGE_LIBOSTREE
select BR2_PACKAGE_LIBSOUP
select BR2_PACKAGE_LIBSOUP_SSL
select BR2_PACKAGE_LIBYAML # appstream-glib
select BR2_PACKAGE_LIBXML2
select BR2_PACKAGE_POLKIT
select BR2_PACKAGE_XLIB_LIBXAU
select BR2_PACKAGE_XORGPROTO # libXau
select BR2_PACKAGE_XUTIL_UTIL_MACROS # libXau
help
Flatpak is a system for building, distributing, and running sandboxed
desktop applications on Linux.

https://github.com/flatpak/flatpak

comment "flatpak needs a toolchain w/ C++, threads, dynamic library, wchar"
depends on !BR2_TOOLCHAIN_HAS_THREADS || BR2_STATIC_LIBS \
|| !BR2_USE_WCHAR || BR2_TOOLCHAIN_USES_MUSL \
|| !BR2_INSTALL_LIBSTDCPP
depends on BR2_PACKAGE_LIBGPG_ERROR_ARCH_SUPPORTS
depends on BR2_USE_MMU
3 changes: 3 additions & 0 deletions package/flatpak/flatpak.hash
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Locally calculated:
sha256 c45ad363d34b23a1a46e706593eeb61dcb5d6dadb0f5a4db4926ba9b89c6d447 flatpak-1.0.6.tar.gz
sha256 dc626520dcd53a22f727af3ee42c770e56c97a64fe3adb063799d8ab032fe551 COPYING
87 changes: 87 additions & 0 deletions package/flatpak/flatpak.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
################################################################################
#
# flatpak
#
################################################################################

FLATPAK_VERSION = 1.0.6
FLATPAK_SITE = https://github.com/flatpak/flatpak
FLATPAK_SITE_METHOD = git
FLATPAK_GIT_SUBMODULES = YES

FLATPAK_AUTORECONF = YES
FLATPAK_GETTEXTIZE = YES
FLATPAK_LICENSE = LGPL-2.1+
FLATPAK_LICENSE_FILES = COPYING

FLATPAK_INSTALL_TARGET_OPTS = DESTDIR=$(TARGET_DIR) DSTROOT=$(TARGET_DIR) install

FLATPAK_CONF_OPTS = \
--enable-sandboxed-triggers \
--enable-xauth \
--without-system-bubblewrap \
--with-system-helper
FLATPAK_CONF_ENV += \
ac_cv_path_GPGME_CONFIG=$(STAGING_DIR)/usr/bin/gpgme-config \
ac_cv_path_GPGERR_CONFIG=$(STAGING_DIR)/usr/bin/gpg-error-config
FLATPAK_DEPENDENCIES = \
appstream-glib \
host-autoconf \
host-automake \
host-libtool \
host-pkgconf \
json-glib \
libarchive \
libcap \
libglib2 \
libgpgme \
libostree \
libsoup \
libxml2 \
polkit \
xlib_libXau \
xorgproto \
xutil_util-macros

# see autogen.sh in flatpak
define FLATPAK_TOUCHUP_VENDOR
cd $(@D); \
sed -e 's,$$(libglnx_srcpath),libglnx,g' <\
libglnx/Makefile-libglnx.am >\
libglnx/Makefile-libglnx.am.inc; \
sed -e 's,$$(bwrap_srcpath),bubblewrap,g' <\
bubblewrap/Makefile-bwrap.am >\
bubblewrap/Makefile-bwrap.am.inc
endef
FLATPAK_PRE_CONFIGURE_HOOKS += FLATPAK_TOUCHUP_VENDOR

ifeq ($(BR2_PACKAGE_SYSTEMD),y)
FLATPAK_CONF_OPTS += --with-systemd=/usr/lib/systemd/system \
--enable-systemd
FLATPAK_DEPENDENCIES += systemd
else
FLATPAK_CONF_OPTS += --disable-systemd
endif

ifeq ($(BR2_PACKAGE_DBUS),y)
FLATPAK_CONF_OPTS += --enable-dbus
FLATPAK_DEPENDENCIES += dbus
else
FLATPAK_CONF_OPTS += --disable-dbus
endif

ifeq ($(BR2_PACKAGE_GNUTLS),y)
FLATPAK_CONF_OPTS += --enable-gnutls
FLATPAK_DEPENDENCIES += gnutls
else
FLATPAK_CONF_OPTS += --disable-gnutls
endif

ifeq ($(BR2_PACKAGE_LIBSECCOMP),y)
FLATPAK_CONF_OPTS += --enable-seccomp
FLATPAK_DEPENDENCIES += libseccomp host-pkgconf
else
FLATPAK_CONF_OPTS += --disable-seccomp
endif

$(eval $(autotools-package))
16 changes: 16 additions & 0 deletions package/flatpak/flatpak.pc.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
prefix=/usr
exec_prefix=/usr
libdir=${exec_prefix}/lib
includedir=${prefix}/include
datarootdir=@datarootdir@
datadir=@datadir@

interfaces_dir=${datadir}/dbus-1/interfaces/

Name: flatpak
Description: Application sandboxing framework
Version: @PACKAGE_VERSION@
Requires: glib-2.0 gio-2.0
Requires.private: gio-unix-2.0 ostree-1
Libs: -L${libdir} -lflatpak
Cflags: -I${includedir}/flatpak

0 comments on commit 7a3510e

Please sign in to comment.