blob: a21c473f0a737d1bf24644e859c1a1bf84ecfa6d [file] [log] [blame]
Patrick Williams92b42cb2022-09-03 06:53:57 -05001SUMMARY = "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 = "LGPL-2.1-only"
8
9LIC_FILES_CHKSUM = "file://COPYING;md5=5f30f0716dfdd0d91eb439ebec522ec2"
10
11DEPENDS = " \
12 glib-2.0 \
13 e2fsprogs \
14 libcap \
15 zlib \
16 xz \
17 bison-native \
18"
19
20SRC_URI = " \
21 gitsm://github.com/ostreedev/ostree;branch=main;protocol=https \
22 file://0001-Remove-unused-linux-fs.h-includes.patch \
23 file://0001-libostree-Remove-including-sys-mount.h.patch \
24 file://0001-s390x-se-luks-gencpio-There-is-no-bashism.patch \
25 file://run-ptest \
26"
27SRCREV = "15740d042c9c5258a1c082b5e228cf6f115edbb0"
28
29UPSTREAM_CHECK_GITTAGREGEX = "v(?P<pver>\d+\.\d+)"
30
31S = "${WORKDIR}/git"
32
33inherit autotools bash-completion gobject-introspection gtk-doc manpages pkgconfig ptest-gnome systemd
34
35# Workaround compile failure:
36# |../git/src/libotutil/zbase32.c:37:1: error: function returns an aggregate [-Werror=aggregate-return]
37# so remove -Og and use -O2 as workaround
38DEBUG_OPTIMIZATION:remove = "-Og"
39DEBUG_OPTIMIZATION:append = " -O2"
40BUILD_OPTIMIZATION:remove = "-Og"
41BUILD_OPTIMIZATION:append = " -O2"
42
43# Package configuration - match ostree defaults, but without rofiles-fuse
44# otherwise we introduce a dependendency on meta-filesystems
45PACKAGECONFIG ??= " \
46 ${@bb.utils.filter('DISTRO_FEATURES', 'selinux smack', d)} \
47 ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd libmount', '', d)} \
48 glib \
49 gpgme \
50 soup \
51"
52
53# We include soup because ostree can't (currently) be built without
54# soup or curl - https://github.com/ostreedev/ostree/issues/1897
55PACKAGECONFIG:class-native ??= " \
56 ${@bb.utils.filter('DISTRO_FEATURES', 'selinux smack', d)} \
57 builtin-grub2-mkconfig \
58 gpgme \
59 soup \
60"
61
62PACKAGECONFIG:class-nativesdk ??= " \
63 ${@bb.utils.filter('DISTRO_FEATURES', 'selinux smack', d)} \
64 builtin-grub2-mkconfig \
65 gpgme \
66 soup \
67"
68
69PACKAGECONFIG[avahi] = "--with-avahi, --without-avahi, avahi"
70PACKAGECONFIG[builtin-grub2-mkconfig] = "--with-builtin-grub2-mkconfig, --without-builtin-grub2-mkconfig"
71PACKAGECONFIG[curl] = "--with-curl, --without-curl, curl"
72PACKAGECONFIG[dracut] = "--with-dracut, --without-dracut"
73PACKAGECONFIG[ed25519-libsodium] = "--with-ed25519-libsodium, --without-ed25519-libsodium, libsodium"
74PACKAGECONFIG[gjs] = "ac_cv_path_GJS=${bindir}/gjs"
75PACKAGECONFIG[glib] = "--with-crypto=glib, , , , , gnutls openssl"
76PACKAGECONFIG[gnutls] = "--with-crypto=gnutls, , gnutls, , , glib openssl"
77PACKAGECONFIG[gpgme] = "--with-gpgme, --without-gpgme, gpgme"
78PACKAGECONFIG[libarchive] = "--with-libarchive, --without-libarchive, libarchive"
79PACKAGECONFIG[libmount] = "--with-libmount, --without-libmount, util-linux"
80PACKAGECONFIG[manpages] = "--enable-man, --disable-man, libxslt-native docbook-xsl-stylesheets-native"
81PACKAGECONFIG[mkinitcpio] = "--with-mkinitcpio, --without-mkinitcpio"
82PACKAGECONFIG[no-http2] = "--disable-http2, --enable-http2"
83PACKAGECONFIG[openssl] = "--with-crypto=openssl, , openssl, , , glib gnutls"
84PACKAGECONFIG[rofiles-fuse] = "--enable-rofiles-fuse, --disable-rofiles-fuse, fuse"
85PACKAGECONFIG[selinux] = "--with-selinux, --without-selinux, libselinux"
86PACKAGECONFIG[smack] = "--with-smack, --without-smack, smack"
87PACKAGECONFIG[soup] = "--with-soup, --without-soup --disable-glibtest, libsoup-2.4"
88PACKAGECONFIG[static] = ""
89PACKAGECONFIG[systemd] = "--with-libsystemd --with-systemdsystemunitdir=${systemd_unitdir}/system, --without-libsystemd, systemd"
90PACKAGECONFIG[trivial-httpd-cmdline] = "--enable-trivial-httpd-cmdline, --disable-trivial-httpd-cmdline"
91
92EXTRA_OECONF = " \
93 ${@bb.utils.contains('PACKAGECONFIG', 'static', '--with-static-compiler=\'${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}\'', '', d)} \
94"
95
96# Makefile-libostree.am overrides this to avoid a build problem with clang,
97# but that fix breaks cross compilation and we don't need it
98EXTRA_OEMAKE = " \
99 INTROSPECTION_SCANNER_ENV= \
100"
101
102EXTRA_OECONF:class-native = " \
103 --enable-wrpseudo-compat \
104 --disable-otmpfile \
105"
106
107EXTRA_OECONF:class-nativesdk = " \
108 --enable-wrpseudo-compat \
109 --disable-otmpfile \
110"
111
112# Path to ${prefix}/lib/ostree/ostree-grub-generator is hardcoded on the
113# do_configure stage so we do depend on it
114SYSROOT_DIR = "${STAGING_DIR_TARGET}"
115SYSROOT_DIR:class-native = "${STAGING_DIR_NATIVE}"
116do_configure[vardeps] += "SYSROOT_DIR"
117
118do_configure:prepend() {
119 # this reflects what autogen.sh does, but the OE wrappers for autoreconf
120 # allow it to work without the other gyrations which exist there
121 cp ${S}/libglnx/Makefile-libglnx.am ${S}/libglnx/Makefile-libglnx.am.inc
122 cp ${S}/bsdiff/Makefile-bsdiff.am ${S}/bsdiff/Makefile-bsdiff.am.inc
123}
124
125do_install:append:class-native() {
126 create_wrapper ${D}${bindir}/ostree OSTREE_GRUB2_EXEC="${STAGING_LIBDIR_NATIVE}/ostree/ostree-grub-generator"
127}
128
129do_install:append:class-nativesdk() {
130 create_wrapper ${D}${bindir}/ostree OSTREE_GRUB2_EXEC="\$OECORE_NATIVE_SYSROOT/usr/lib/ostree/ostree-grub-generator"
131}
132
133PACKAGE_BEFORE_PN = " \
134 ${PN}-dracut \
135 ${PN}-grub \
136 ${PN}-mkinitcpio \
137 ${PN}-switchroot \
138 ${PN}-trivial-httpd \
139"
140
141FILES:${PN} += " \
142 ${nonarch_libdir}/${BPN} \
143 ${nonarch_libdir}/tmpfiles.d \
144 ${systemd_unitdir}/system \
145 ${systemd_unitdir}/system-generators \
146"
147FILES:${PN}-dracut = " \
148 ${sysconfdir}/dracut.conf.d \
149 ${libdir}/dracut \
150"
151FILES:${PN}-grub = " \
152 ${sysconfdir}/grub.d \
153 ${libexecdir}/libostree/grub2-15_ostree \
154"
155FILES:${PN}-mkinitcpio = " \
156 ${sysconfdir}/ostree-mkinitcpio.conf \
157 ${libdir}/initcpio \
158"
159FILES:${PN}-switchroot = " \
160 ${nonarch_libdir}/${BPN}/ostree-prepare-root \
161 ${systemd_unitdir}/system/ostree-prepare-root.service \
162"
163FILES:${PN}-trivial-httpd = " \
164 ${libexecdir}/libostree/ostree-trivial-httpd \
165"
166
167RDEPENDS:${PN} = " \
168 ${@bb.utils.contains('PACKAGECONFIG', 'trivial-httpd-cmdline', '${PN}-trivial-httpd', '', d)} \
169"
170RDEPENDS:${PN}-dracut = "bash"
171RDEPENDS:${PN}-mkinitcpio = "bash"
172RDEPENDS:${PN}:class-target = " \
173 ${@bb.utils.contains('PACKAGECONFIG', 'gpgme', 'gnupg', '', d)} \
174 ${PN}-switchroot \
175"
176
177#
178# Note that to get ptest to pass you also need:
179#
180# xattr in DISTRO_FEATURES
181# static ostree-prepare-root (PACKAGECONFIG:append:pn-ostree = " static")
182# meta-python in your layers
183# overlayfs in your kernel (KERNEL_EXTRA_FEATURES += "features/overlayfs/overlayfs.scc")
184# busybox built statically
185# /var/tmp as a real filesystem (not a tmpfs)
186# Sufficient disk space (IMAGE_ROOTFS_SIZE = "524288") and RAM (QB_MEM = "-m 1024")
187#
188RDEPENDS:${PN}-ptest += " \
189 attr \
190 bash \
191 coreutils \
192 cpio \
193 diffutils \
194 findutils \
195 grep \
196 python3-core \
197 python3-multiprocessing \
198 strace \
199 tar \
200 util-linux \
201 xz \
202 ${PN}-trivial-httpd \
203 python3-pyyaml \
204 ${@bb.utils.contains('PACKAGECONFIG', 'gjs', 'gjs', '', d)} \
205"
206RDEPENDS:${PN}-ptest:append:libc-glibc = " glibc-utils glibc-localedata-en-us"
207
208RRECOMMENDS:${PN}:append:class-target = " kernel-module-overlay"
209
210SYSTEMD_SERVICE:${PN} = "ostree-remount.service ostree-finalize-staged.path"
211SYSTEMD_SERVICE:${PN}-switchroot = "ostree-prepare-root.service"
212
213BBCLASSEXTEND = "native nativesdk"