blob: 158ec9bc23c0d690f12363ee72fb4d66c5f2871b [file] [log] [blame]
Patrick Williamsac13d5f2023-11-24 18:59:46 -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-native \
13 glib-2.0 \
14 e2fsprogs \
15 libcap \
16 zlib \
17 xz \
18 bison-native \
19"
20
21GITHUB_BASE_URI = "https://github.com/ostreedev/ostree/releases"
22SRC_URI = "${GITHUB_BASE_URI}/download/v${PV}/libostree-${PV}.tar.xz \
23 file://run-ptest \
24 "
Patrick Williams39653562024-03-01 08:54:02 -060025SRC_URI[sha256sum] = "5e0daaaa70772bfa00bd3d0c25d11f7c1f6d41a996708fad8bf9941f0a36bc8d"
Patrick Williamsac13d5f2023-11-24 18:59:46 -060026
27S = "${WORKDIR}/libostree-${PV}"
28
29inherit autotools bash-completion gobject-introspection github-releases gtk-doc manpages pkgconfig ptest-gnome systemd
30
Patrick Williamsac13d5f2023-11-24 18:59:46 -060031UNKNOWN_CONFIGURE_OPT_IGNORE = "--disable-introspection --enable-introspection"
32
33# Workaround compile failure:
34# |../git/src/libotutil/zbase32.c:37:1: error: function returns an aggregate [-Werror=aggregate-return]
35# so remove -Og and use -O2 as workaround
36DEBUG_OPTIMIZATION:remove = "-Og"
37DEBUG_OPTIMIZATION:append = " -O2"
38BUILD_OPTIMIZATION:remove = "-Og"
39BUILD_OPTIMIZATION:append = " -O2"
40
41# Package configuration - match ostree defaults, but without rofiles-fuse
42# otherwise we introduce a dependendency on meta-filesystems and swap
43# soup for curl to avoid bringing in deprecated libsoup2 (though
44# to run ptest requires that you have soup2 or soup3).
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 curl \
51"
52
53# We include curl 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 curl \
60"
61
62PACKAGECONFIG:class-nativesdk ??= " \
63 ${@bb.utils.filter('DISTRO_FEATURES', 'selinux smack', d)} \
64 builtin-grub2-mkconfig \
65 gpgme \
66 curl \
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[ed25519-openssl] = "--with-openssl, --without-openssl, openssl"
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[soup2] = "--with-soup, --without-soup, libsoup-2.4, , , soup3"
89PACKAGECONFIG[soup3] = "--with-soup3, --without-soup3, libsoup, , , soup2"
90PACKAGECONFIG[static] = ""
91PACKAGECONFIG[systemd] = "--with-libsystemd --with-systemdsystemunitdir=${systemd_system_unitdir}, --without-libsystemd, systemd"
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"
140
141FILES:${PN} += " \
142 ${nonarch_libdir}/${BPN} \
143 ${nonarch_libdir}/tmpfiles.d \
144 ${systemd_system_unitdir} \
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_system_unitdir}/ostree-prepare-root.service \
162"
163
164RDEPENDS:${PN}-dracut = "bash"
165RDEPENDS:${PN}-mkinitcpio = "bash"
166RDEPENDS:${PN}:class-target = " \
167 ${@bb.utils.contains('PACKAGECONFIG', 'gpgme', 'gnupg', '', d)} \
168 ${PN}-switchroot \
169"
170
171#
172# Note that to get ptest to pass you also need:
173#
174# xattr in DISTRO_FEATURES (default)
175# static ostree-prepare-root
176# overlayfs in your kernel
177# busybox built statically
178# C.UTF-8 locale available (default)
179# Sufficient disk space/RAM (e.g. core-image-sato-sdk)
180#
181# Something like this in your local.conf:
182#
183# PACKAGECONFIG:append:pn-ostree = " static soup3"
184# KERNEL_EXTRA_FEATURES:append = " features/overlayfs/overlayfs.scc"
185# TARGET_CFLAGS:append:pn-busybox = " -static"
186#
187RDEPENDS:${PN}-ptest += " \
188 attr \
189 bash \
190 coreutils \
191 cpio \
192 diffutils \
193 findutils \
194 grep \
195 python3-core \
196 python3-multiprocessing \
197 strace \
198 tar \
199 util-linux \
200 xz \
201 python3-pyyaml \
202 ${@bb.utils.contains('PACKAGECONFIG', 'gjs', 'gjs', '', d)} \
203"
Patrick Williams39653562024-03-01 08:54:02 -0600204RDEPENDS:${PN}-ptest:remove:riscv32 = "strace"
Patrick Williamsac13d5f2023-11-24 18:59:46 -0600205RDEPENDS:${PN}-ptest:append:libc-glibc = " glibc-utils glibc-localedata-en-us"
206
207RRECOMMENDS:${PN}:append:class-target = " kernel-module-overlay"
208
209SYSTEMD_SERVICE:${PN} = "ostree-remount.service ostree-finalize-staged.path"
210SYSTEMD_SERVICE:${PN}-switchroot = "ostree-prepare-root.service"
211
212BBCLASSEXTEND = "native nativesdk"