blob: 0704c9162fd30d469de9cb00a514b44bf2b4fa95 [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 Williams169d7bc2024-01-05 11:33:25 -060025SRC_URI[sha256sum] = "b6fffc267188e40d60755e6d7f2be65831795baa53b0fd9dd6c6809c7e54796d"
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
31COMPATIBLE_HOST:riscv32 = "${@bb.utils.contains('DISTRO_FEATURES', 'ptest', 'null', 'riscv32', d)}"
32
33UNKNOWN_CONFIGURE_OPT_IGNORE = "--disable-introspection --enable-introspection"
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 and swap
45# soup for curl to avoid bringing in deprecated libsoup2 (though
46# to run ptest requires that you have soup2 or soup3).
47PACKAGECONFIG ??= " \
48 ${@bb.utils.filter('DISTRO_FEATURES', 'selinux smack', d)} \
49 ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd libmount', '', d)} \
50 glib \
51 gpgme \
52 curl \
53"
54
55# We include curl because ostree can't (currently) be built without
56# soup or curl - https://github.com/ostreedev/ostree/issues/1897
57PACKAGECONFIG:class-native ??= " \
58 ${@bb.utils.filter('DISTRO_FEATURES', 'selinux smack', d)} \
59 builtin-grub2-mkconfig \
60 gpgme \
61 curl \
62"
63
64PACKAGECONFIG:class-nativesdk ??= " \
65 ${@bb.utils.filter('DISTRO_FEATURES', 'selinux smack', d)} \
66 builtin-grub2-mkconfig \
67 gpgme \
68 curl \
69"
70
71PACKAGECONFIG[avahi] = "--with-avahi, --without-avahi, avahi"
72PACKAGECONFIG[builtin-grub2-mkconfig] = "--with-builtin-grub2-mkconfig, --without-builtin-grub2-mkconfig"
73PACKAGECONFIG[curl] = "--with-curl, --without-curl, curl"
74PACKAGECONFIG[dracut] = "--with-dracut, --without-dracut"
75PACKAGECONFIG[ed25519-libsodium] = "--with-ed25519-libsodium, --without-ed25519-libsodium, libsodium"
76PACKAGECONFIG[ed25519-openssl] = "--with-openssl, --without-openssl, openssl"
77PACKAGECONFIG[gjs] = "ac_cv_path_GJS=${bindir}/gjs"
78PACKAGECONFIG[glib] = "--with-crypto=glib, , , , , gnutls openssl"
79PACKAGECONFIG[gnutls] = "--with-crypto=gnutls, , gnutls, , , glib openssl"
80PACKAGECONFIG[gpgme] = "--with-gpgme, --without-gpgme, gpgme"
81PACKAGECONFIG[libarchive] = "--with-libarchive, --without-libarchive, libarchive"
82PACKAGECONFIG[libmount] = "--with-libmount, --without-libmount, util-linux"
83PACKAGECONFIG[manpages] = "--enable-man, --disable-man, libxslt-native docbook-xsl-stylesheets-native"
84PACKAGECONFIG[mkinitcpio] = "--with-mkinitcpio, --without-mkinitcpio"
85PACKAGECONFIG[no-http2] = "--disable-http2, --enable-http2"
86PACKAGECONFIG[openssl] = "--with-crypto=openssl, , openssl, , , glib gnutls"
87PACKAGECONFIG[rofiles-fuse] = "--enable-rofiles-fuse, --disable-rofiles-fuse, fuse3"
88PACKAGECONFIG[selinux] = "--with-selinux, --without-selinux, libselinux, bubblewrap"
89PACKAGECONFIG[smack] = "--with-smack, --without-smack, smack"
90PACKAGECONFIG[soup2] = "--with-soup, --without-soup, libsoup-2.4, , , soup3"
91PACKAGECONFIG[soup3] = "--with-soup3, --without-soup3, libsoup, , , soup2"
92PACKAGECONFIG[static] = ""
93PACKAGECONFIG[systemd] = "--with-libsystemd --with-systemdsystemunitdir=${systemd_system_unitdir}, --without-libsystemd, systemd"
94
95EXTRA_OECONF = " \
96 ${@bb.utils.contains('PACKAGECONFIG', 'static', '--with-static-compiler=\'${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}\'', '', d)} \
97"
98
99# Makefile-libostree.am overrides this to avoid a build problem with clang,
100# but that fix breaks cross compilation and we don't need it
101EXTRA_OEMAKE = " \
102 INTROSPECTION_SCANNER_ENV= \
103"
104
105EXTRA_OECONF:class-native = " \
106 --enable-wrpseudo-compat \
107 --disable-otmpfile \
108"
109
110EXTRA_OECONF:class-nativesdk = " \
111 --enable-wrpseudo-compat \
112 --disable-otmpfile \
113"
114
115# Path to ${prefix}/lib/ostree/ostree-grub-generator is hardcoded on the
116# do_configure stage so we do depend on it
117SYSROOT_DIR = "${STAGING_DIR_TARGET}"
118SYSROOT_DIR:class-native = "${STAGING_DIR_NATIVE}"
119do_configure[vardeps] += "SYSROOT_DIR"
120
121do_configure:prepend() {
122 # this reflects what autogen.sh does, but the OE wrappers for autoreconf
123 # allow it to work without the other gyrations which exist there
124 cp ${S}/libglnx/Makefile-libglnx.am ${S}/libglnx/Makefile-libglnx.am.inc
125 cp ${S}/bsdiff/Makefile-bsdiff.am ${S}/bsdiff/Makefile-bsdiff.am.inc
126}
127
128do_install:append:class-native() {
129 create_wrapper ${D}${bindir}/ostree OSTREE_GRUB2_EXEC="${STAGING_LIBDIR_NATIVE}/ostree/ostree-grub-generator"
130}
131
132do_install:append:class-nativesdk() {
133 create_wrapper ${D}${bindir}/ostree OSTREE_GRUB2_EXEC="\$OECORE_NATIVE_SYSROOT/usr/lib/ostree/ostree-grub-generator"
134}
135
136PACKAGE_BEFORE_PN = " \
137 ${PN}-dracut \
138 ${PN}-grub \
139 ${PN}-mkinitcpio \
140 ${PN}-switchroot \
141"
142
143FILES:${PN} += " \
144 ${nonarch_libdir}/${BPN} \
145 ${nonarch_libdir}/tmpfiles.d \
146 ${systemd_system_unitdir} \
147 ${systemd_unitdir}/system-generators \
148"
149FILES:${PN}-dracut = " \
150 ${sysconfdir}/dracut.conf.d \
151 ${libdir}/dracut \
152"
153FILES:${PN}-grub = " \
154 ${sysconfdir}/grub.d \
155 ${libexecdir}/libostree/grub2-15_ostree \
156"
157FILES:${PN}-mkinitcpio = " \
158 ${sysconfdir}/ostree-mkinitcpio.conf \
159 ${libdir}/initcpio \
160"
161FILES:${PN}-switchroot = " \
162 ${nonarch_libdir}/${BPN}/ostree-prepare-root \
163 ${systemd_system_unitdir}/ostree-prepare-root.service \
164"
165
166RDEPENDS:${PN}-dracut = "bash"
167RDEPENDS:${PN}-mkinitcpio = "bash"
168RDEPENDS:${PN}:class-target = " \
169 ${@bb.utils.contains('PACKAGECONFIG', 'gpgme', 'gnupg', '', d)} \
170 ${PN}-switchroot \
171"
172
173#
174# Note that to get ptest to pass you also need:
175#
176# xattr in DISTRO_FEATURES (default)
177# static ostree-prepare-root
178# overlayfs in your kernel
179# busybox built statically
180# C.UTF-8 locale available (default)
181# Sufficient disk space/RAM (e.g. core-image-sato-sdk)
182#
183# Something like this in your local.conf:
184#
185# PACKAGECONFIG:append:pn-ostree = " static soup3"
186# KERNEL_EXTRA_FEATURES:append = " features/overlayfs/overlayfs.scc"
187# TARGET_CFLAGS:append:pn-busybox = " -static"
188#
189RDEPENDS:${PN}-ptest += " \
190 attr \
191 bash \
192 coreutils \
193 cpio \
194 diffutils \
195 findutils \
196 grep \
197 python3-core \
198 python3-multiprocessing \
199 strace \
200 tar \
201 util-linux \
202 xz \
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"