summaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-extended/ostree
diff options
context:
space:
mode:
authorAlex Kiernan <alex.kiernan@gmail.com>2019-09-22 13:06:38 +0100
committerKhem Raj <raj.khem@gmail.com>2019-09-22 08:13:17 -0700
commit59180f9f910cfd541d95f0619c597a870093dc1c (patch)
tree0e3971fd7be7ed237ac0fb19421ff64bc946a84f /meta-oe/recipes-extended/ostree
parent1849429a791457250236778793c36a12f0df3194 (diff)
downloadmeta-openembedded-59180f9f910cfd541d95f0619c597a870093dc1c.tar.gz
ostree: Add recipe
Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-oe/recipes-extended/ostree')
-rw-r--r--meta-oe/recipes-extended/ostree/ostree/0001-Always-enable-trivial-httpd-for-tests.patch59
-rw-r--r--meta-oe/recipes-extended/ostree/ostree/0001-macros-Add-TEMP_FAILURE_RETRY-for-musl.patch40
-rw-r--r--meta-oe/recipes-extended/ostree/ostree/0002-Gate-ostree-trivial-httpd-on-BUILDOPT_TRIVIAL_HTTPD.patch51
-rw-r--r--meta-oe/recipes-extended/ostree/ostree_2019.3.bb157
4 files changed, 307 insertions, 0 deletions
diff --git a/meta-oe/recipes-extended/ostree/ostree/0001-Always-enable-trivial-httpd-for-tests.patch b/meta-oe/recipes-extended/ostree/ostree/0001-Always-enable-trivial-httpd-for-tests.patch
new file mode 100644
index 000000000..c9e1306af
--- /dev/null
+++ b/meta-oe/recipes-extended/ostree/ostree/0001-Always-enable-trivial-httpd-for-tests.patch
@@ -0,0 +1,59 @@
1From 44e0647230b22cd136ae2fb252ce90eed4751970 Mon Sep 17 00:00:00 2001
2From: Alex Kiernan <alex.kiernan@gmail.com>
3Date: Wed, 4 Sep 2019 17:29:15 +0100
4Subject: [PATCH 1/2] Always enable trivial-httpd for tests
5
6When running tests we always need ostree-trivial-httpd, so enable it
7unconditionally
8
9Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
10Upstream-Status: Submitted [https://github.com/ostreedev/ostree/pull/1912]
11---
12 Makefile.am | 1 +
13 ci/build.sh | 5 +++++
14 ci/travis-build.sh | 1 +
15 3 files changed, 7 insertions(+)
16
17diff --git a/Makefile.am b/Makefile.am
18index cd04a055045a..673dbf88de55 100644
19--- a/Makefile.am
20+++ b/Makefile.am
21@@ -39,6 +39,7 @@ AM_DISTCHECK_CONFIGURE_FLAGS += \
22 --enable-gtk-doc \
23 --enable-man \
24 --disable-maintainer-mode \
25+ --enable-trivial-httpd-cmdline \
26 $(NULL)
27
28 GITIGNOREFILES = aclocal.m4 build-aux/ buildutil/*.m4 config.h.in gtk-doc.make
29diff --git a/ci/build.sh b/ci/build.sh
30index 0901507498f2..806af050b780 100755
31--- a/ci/build.sh
32+++ b/ci/build.sh
33@@ -22,6 +22,11 @@ case "${CONFIGOPTS:-}" in
34 fi
35 ;;
36 esac
37+# unless libsoup is disabled, enable trivial-httpd for the tests
38+case "${CONFIGOPTS:-}" in
39+ *--without-soup*) ;;
40+ *) CONFIGOPTS="${CONFIGOPTS:-} --enable-trivial-httpd-cmdline" ;;
41+esac
42
43 # always fail on warnings; https://github.com/ostreedev/ostree/pull/971
44 # NB: this disables the default set of flags from configure.ac
45diff --git a/ci/travis-build.sh b/ci/travis-build.sh
46index 3fd969bdced6..7c85313a2d32 100755
47--- a/ci/travis-build.sh
48+++ b/ci/travis-build.sh
49@@ -85,6 +85,7 @@ make="make -j${ci_parallel} V=1 VERBOSE=1"
50
51 ../configure \
52 --enable-always-build-tests \
53+ --enable-trivial-httpd-cmdline \
54 ${ci_configopts}
55 "$@"
56
57--
582.17.1
59
diff --git a/meta-oe/recipes-extended/ostree/ostree/0001-macros-Add-TEMP_FAILURE_RETRY-for-musl.patch b/meta-oe/recipes-extended/ostree/ostree/0001-macros-Add-TEMP_FAILURE_RETRY-for-musl.patch
new file mode 100644
index 000000000..d8c044cb9
--- /dev/null
+++ b/meta-oe/recipes-extended/ostree/ostree/0001-macros-Add-TEMP_FAILURE_RETRY-for-musl.patch
@@ -0,0 +1,40 @@
1From 5a4f2ddb0a6c656b425a3caa41f5af766ed5f44b Mon Sep 17 00:00:00 2001
2From: Alex Kiernan <alex.kiernan@gmail.com>
3Date: Mon, 9 Sep 2019 14:19:18 +0100
4Subject: [PATCH] macros: Add TEMP_FAILURE_RETRY for musl
5
6TEMP_FAILURE_RETRY is glibc specific, add a definition for musl.
7
8See https://github.com/ostreedev/ostree/issues/731
9
10Signed-off-by: Leon Woestenberg <leon@sidebranch.com>
11Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
12Upstream-Status: Accepted [https://gitlab.gnome.org/GNOME/libglnx/commit/15c06468804014fc49f6f340132930703f919b19]
13---
14 glnx-macros.h | 10 ++++++++++
15 1 file changed, 10 insertions(+)
16
17diff --git a/libglnx.glnx-macros.h b/libglnx/glnx-macros.h
18index 6d8aca93f8a3..700fc75ceed0 100644
19--- a/libglnx.glnx-macros.h
20+++ b/libglnx/glnx-macros.h
21@@ -31,6 +31,16 @@ G_BEGIN_DECLS
22 /* All of these are for C only. */
23 #ifndef __GI_SCANNER__
24
25+/* fixes builds against musl, taken from glibc unistd.h */
26+#ifndef TEMP_FAILURE_RETRY
27+#define TEMP_FAILURE_RETRY(expression) \
28+ (__extension__ \
29+ ({ long int __result; \
30+ do __result = (long int) (expression); \
31+ while (__result == -1L && errno == EINTR); \
32+ __result; }))
33+#endif
34+
35 /* Taken from https://github.com/systemd/systemd/src/basic/string-util.h
36 * at revision v228-666-gcf6c8c4
37 */
38--
392.17.1
40
diff --git a/meta-oe/recipes-extended/ostree/ostree/0002-Gate-ostree-trivial-httpd-on-BUILDOPT_TRIVIAL_HTTPD.patch b/meta-oe/recipes-extended/ostree/ostree/0002-Gate-ostree-trivial-httpd-on-BUILDOPT_TRIVIAL_HTTPD.patch
new file mode 100644
index 000000000..362b2f36a
--- /dev/null
+++ b/meta-oe/recipes-extended/ostree/ostree/0002-Gate-ostree-trivial-httpd-on-BUILDOPT_TRIVIAL_HTTPD.patch
@@ -0,0 +1,51 @@
1From 2629328b39ae117876f4854409c2231220a30b9c Mon Sep 17 00:00:00 2001
2From: Alex Kiernan <alex.kiernan@gmail.com>
3Date: Thu, 5 Sep 2019 13:22:15 +0100
4Subject: [PATCH 2/2] Gate ostree-trivial-httpd on BUILDOPT_TRIVIAL_HTTPD
5
6When building without --enable-trivial-httpd-cmdline, don't build or install
7the ostree-trivial-httpd binary.
8
9Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
10Upstream-Status: Submitted [https://github.com/ostreedev/ostree/pull/1912]
11---
12 Makefile-ostree.am | 3 ++-
13 configure.ac | 3 +++
14 2 files changed, 5 insertions(+), 1 deletion(-)
15
16diff --git a/Makefile-ostree.am b/Makefile-ostree.am
17index 76f39cad4b74..7b53cb148960 100644
18--- a/Makefile-ostree.am
19+++ b/Makefile-ostree.am
20@@ -143,12 +143,13 @@ ostree_SOURCES += src/ostree/ot-builtin-pull.c
21 endif
22
23 if USE_LIBSOUP
24-# Eventually once we stop things from using this, we should support disabling this
25+if BUILDOPT_TRIVIAL_HTTPD
26 ostree_SOURCES += src/ostree/ot-builtin-trivial-httpd.c
27 pkglibexec_PROGRAMS += ostree-trivial-httpd
28 ostree_trivial_httpd_SOURCES = src/ostree/ostree-trivial-httpd.c
29 ostree_trivial_httpd_CFLAGS = $(ostree_bin_shared_cflags) $(OT_INTERNAL_SOUP_CFLAGS)
30 ostree_trivial_httpd_LDADD = $(ostree_bin_shared_ldadd) $(OT_INTERNAL_SOUP_LIBS)
31+endif
32
33 if !USE_CURL
34 # This is necessary for the cookie jar bits
35diff --git a/configure.ac b/configure.ac
36index 069bab01752e..ffc67980d507 100644
37--- a/configure.ac
38+++ b/configure.ac
39@@ -192,6 +192,9 @@ AC_ARG_ENABLE(trivial-httpd-cmdline,
40 [Continue to support "ostree trivial-httpd" [default=no]])],,
41 enable_trivial_httpd_cmdline=no)
42 AM_CONDITIONAL(BUILDOPT_TRIVIAL_HTTPD, test x$enable_trivial_httpd_cmdline = xyes)
43+AS_IF([test x$with_soup = xno && test x$enable_trivial_httpd_cmdline = xyes], [
44+ AC_MSG_ERROR([trivial-httpd enabled, but libsoup is not; libsoup is needed for trivial-httpd])
45+])
46 AM_COND_IF(BUILDOPT_TRIVIAL_HTTPD,
47 [AC_DEFINE([BUILDOPT_ENABLE_TRIVIAL_HTTPD_CMDLINE], 1, [Define if we are enabling ostree trivial-httpd entrypoint])]
48 )
49--
502.17.1
51
diff --git a/meta-oe/recipes-extended/ostree/ostree_2019.3.bb b/meta-oe/recipes-extended/ostree/ostree_2019.3.bb
new file mode 100644
index 000000000..1fe7dcf21
--- /dev/null
+++ b/meta-oe/recipes-extended/ostree/ostree_2019.3.bb
@@ -0,0 +1,157 @@
1SUMMARY = "Versioned Operating System Repository."
2DESCRIPTION = "libostree is both a shared library and suite of command line \
3tools that combines a \"git-like\" model for committing and downloading \
4bootable filesystem trees, along with a layer for deploying them and managing \
5the bootloader configuration."
6HOMEPAGE = "https://ostree.readthedocs.io"
7LICENSE = "LGPLv2.1"
8
9LIC_FILES_CHKSUM = "file://COPYING;md5=5f30f0716dfdd0d91eb439ebec522ec2"
10
11DEPENDS = " \
12 glib-2.0 \
13 gpgme \
14 e2fsprogs \
15 libcap \
16 zlib \
17 xz \
18 bison-native \
19"
20
21# The Yocto mirror has an old export of ostree:
22# http://downloads.yoctoproject.org/mirror/sources/git2_github.com.ostreedev.ostree.tar.gz
23PREMIRRORS = ""
24
25SRC_URI = " \
26 gitsm://github.com/ostreedev/ostree \
27 file://0001-macros-Add-TEMP_FAILURE_RETRY-for-musl.patch \
28 file://0001-Always-enable-trivial-httpd-for-tests.patch \
29 file://0002-Gate-ostree-trivial-httpd-on-BUILDOPT_TRIVIAL_HTTPD.patch \
30"
31SRCREV = "5c1697da78ebf6250a7130b8b9e6cbfbeaa34296"
32
33UPSTREAM_CHECK_GITTAGREGEX = "v(?P<pver>\d+\.\d+)"
34
35S = "${WORKDIR}/git"
36
37inherit autotools bash-completion gobject-introspection gtk-doc pkgconfig systemd
38
39# package configuration - match ostree defaults, but without rofiles-fuse
40# otherwise we introduce a dependendency on meta-filesystems
41PACKAGECONFIG ??= " \
42 ${@bb.utils.filter('DISTRO_FEATURES', 'selinux smack', d)} \
43 ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd libmount', '', d)} \
44 soup \
45"
46
47# We include soup because ostree can't (currently) be built without
48# soup or curl - https://github.com/ostreedev/ostree/issues/1897
49PACKAGECONFIG_class-native ??= " \
50 ${@bb.utils.filter('DISTRO_FEATURES', 'selinux smack', d)} \
51 soup \
52"
53
54PACKAGECONFIG[avahi] = "--with-avahi, --without-avahi, avahi"
55PACKAGECONFIG[curl] = "--with-curl, --without-curl, curl"
56PACKAGECONFIG[dracut] = "--with-dracut, --without-dracut"
57PACKAGECONFIG[gnutls] = "--with-crypto=gnutls, , gnutls"
58PACKAGECONFIG[libarchive] = "--with-libarchive, --without-libarchive, libarchive"
59PACKAGECONFIG[libmount] = "--with-libmount, --without-libmount, util-linux"
60PACKAGECONFIG[man] = "--enable-man, --disable-man, libxslt-native docbook-xsl-stylesheets-native"
61PACKAGECONFIG[mkinitcpio] = "--with-mkinitcpio, --without-mkinitcpio"
62PACKAGECONFIG[no-http2] = "--disable-http2, --enable-http2"
63PACKAGECONFIG[openssl] = "--with-crypto=openssl, , openssl"
64PACKAGECONFIG[rofiles-fuse] = "--enable-rofiles-fuse, --disable-rofiles-fuse, fuse"
65PACKAGECONFIG[selinux] = "--with-selinux, --without-selinux, libselinux"
66PACKAGECONFIG[smack] = "--with-smack, --without-smack, smack"
67PACKAGECONFIG[soup] = "--with-soup, --without-soup --disable-glibtest, libsoup-2.4"
68PACKAGECONFIG[static] = ""
69PACKAGECONFIG[systemd] = "--with-libsystemd --with-systemdsystemunitdir=${systemd_unitdir}/system, --without-libsystemd, systemd"
70PACKAGECONFIG[trivial-httpd-cmdline] = "--enable-trivial-httpd-cmdline, --disable-trivial-httpd-cmdline"
71
72EXTRA_OECONF = " \
73 ${@bb.utils.contains('PACKAGECONFIG', 'static', '--with-static-compiler=\'${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}\'', '', d)} \
74"
75
76# Makefile-libostree.am overrides this to avoid a build problem with clang,
77# but that fix breaks cross compilation and we don't need it
78EXTRA_OEMAKE = " \
79 INTROSPECTION_SCANNER_ENV= \
80"
81
82EXTRA_OECONF_class-native = " \
83 --with-builtin-grub2-mkconfig \
84 --enable-wrpseudo-compat \
85 --disable-otmpfile \
86"
87
88# Path to ${prefix}/lib/ostree/ostree-grub-generator is hardcoded on the
89# do_configure stage so we do depend on it
90SYSROOT_DIR = "${STAGING_DIR_TARGET}"
91SYSROOT_DIR_class-native = "${STAGING_DIR_NATIVE}"
92do_configure[vardeps] += "SYSROOT_DIR"
93
94do_configure_prepend() {
95 # this reflects what autogen.sh does, but the OE wrappers for autoreconf
96 # allow it to work without the other gyrations which exist there
97 cp ${S}/libglnx/Makefile-libglnx.am ${S}/libglnx/Makefile-libglnx.am.inc
98 cp ${S}/bsdiff/Makefile-bsdiff.am ${S}/bsdiff/Makefile-bsdiff.am.inc
99}
100
101do_install_append_class-native() {
102 create_wrapper ${D}${bindir}/ostree OSTREE_GRUB2_EXEC="${STAGING_LIBDIR_NATIVE}/ostree/ostree-grub-generator"
103}
104
105PACKAGES += " \
106 ${PN}-dracut \
107 ${PN}-grub \
108 ${PN}-mkinitcpio \
109 ${PN}-switchroot \
110"
111
112FILES_${PN} = " \
113 ${bindir}/ostree \
114 ${bindir}/rofiles-fuse \
115 ${datadir}/${BPN} \
116 ${datadir}/gir-1.0 \
117 ${libdir}/${BPN}/ostree-remount \
118 ${libdir}/girepository-1.0 \
119 ${libdir}/lib*${SOLIBS} \
120 ${libdir}/tmpfiles.d/ostree-tmpfiles.conf \
121 ${libexecdir}/libostree/ostree-trivial-httpd \
122 ${sysconfdir}/ostree/remotes.d \
123 ${systemd_unitdir}/system-generators/ostree-system-generator \
124 ${systemd_unitdir}/system/ostree-finalize-staged.path \
125 ${systemd_unitdir}/system/ostree-finalize-staged.service \
126 ${systemd_unitdir}/system/ostree-remount.service \
127"
128FILES_${PN}-dracut = " \
129 ${sysconfdir}/dracut.conf.d \
130 ${libdir}/dracut \
131"
132FILES_${PN}-grub = " \
133 ${sysconfdir}/grub.d \
134 ${libexecdir}/libostree/grub2-15_ostree \
135"
136FILES_${PN}-mkinitcpio = " \
137 ${sysconfdir}/ostree-mkinitcpio.conf \
138 ${libdir}/initcpio \
139"
140FILES_${PN}-switchroot = " \
141 ${libdir}/ostree/ostree-prepare-root \
142 ${systemd_unitdir}/system/ostree-prepare-root.service \
143"
144
145RDEPENDS_${PN}-dracut = "bash"
146RDEPENDS_${PN}-mkinitcpio = "bash"
147RDEPENDS_${PN}_class-target = " \
148 gnupg \
149 ${PN}-switchroot \
150"
151
152RRECOMMENDS_${PN} += "kernel-module-overlay"
153
154SYSTEMD_SERVICE_${PN} = "ostree-remount.service ostree-finalize-staged.path"
155SYSTEMD_SERVICE_${PN}-switchroot = "ostree-prepare-root.service"
156
157BBCLASSEXTEND = "native"