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