blob: 3028c4c92ad9cf6f3a9cb8c7235fdc5b029809b8 [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 = " \
Andrew Geissler3eeda902023-05-19 10:14:02 -050012 glib-2.0-native \
Andrew Geissler517393d2023-01-13 08:55:19 -060013 glib-2.0 \
14 e2fsprogs \
15 libcap \
16 zlib \
17 xz \
18 bison-native \
19"
20
Andrew Geissler6aa7eec2023-03-03 12:41:14 -060021GITHUB_BASE_URI = "https://github.com/ostreedev/ostree/releases"
Patrick Williams520786c2023-06-25 16:20:36 -050022SRC_URI = "${GITHUB_BASE_URI}/download/v${PV}/libostree-${PV}.tar.xz \
23 file://run-ptest \
Patrick Williams520786c2023-06-25 16:20:36 -050024 "
Andrew Geissler8f840682023-07-21 09:09:43 -050025SRC_URI[sha256sum] = "bc593afb31fe1ac3d50419f917fafe321a0a3561d7bb2ba498a83740fe3adb14"
Andrew Geissler517393d2023-01-13 08:55:19 -060026
27S = "${WORKDIR}/libostree-${PV}"
28
Andrew Geissler6aa7eec2023-03-03 12:41:14 -060029inherit autotools bash-completion gobject-introspection github-releases gtk-doc manpages pkgconfig ptest-gnome systemd
Andrew Geissler517393d2023-01-13 08:55:19 -060030
Andrew Geissler3eeda902023-05-19 10:14:02 -050031UNKNOWN_CONFIGURE_OPT_IGNORE = "--disable-introspection --enable-introspection"
32
Andrew Geissler517393d2023-01-13 08:55:19 -060033# 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
Patrick Williamsb542dec2023-06-09 01:26:37 -050044# to run ptest requires that you have soup2 or soup3).
Andrew Geissler517393d2023-01-13 08:55:19 -060045PACKAGECONFIG ??= " \
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[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, fuse3"
85PACKAGECONFIG[selinux] = "--with-selinux, --without-selinux, libselinux, bubblewrap"
86PACKAGECONFIG[smack] = "--with-smack, --without-smack, smack"
Patrick Williamsb542dec2023-06-09 01:26:37 -050087PACKAGECONFIG[soup2] = "--with-soup, --without-soup, libsoup-2.4, , , soup3"
88PACKAGECONFIG[soup3] = "--with-soup3, --without-soup3, libsoup, , , soup2"
Andrew Geissler517393d2023-01-13 08:55:19 -060089PACKAGECONFIG[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
Andrew Geissler6aa7eec2023-03-03 12:41:14 -0600186# C.UTF-8 locale available (default)
Andrew Geissler517393d2023-01-13 08:55:19 -0600187# Sufficient disk space/RAM (e.g. core-image-sato-sdk)
188#
189# Something like this in your local.conf:
190#
Patrick Williamsb542dec2023-06-09 01:26:37 -0500191# PACKAGECONFIG:append:pn-ostree = " static soup3"
Andrew Geissler517393d2023-01-13 08:55:19 -0600192# KERNEL_EXTRA_FEATURES:append = " features/overlayfs/overlayfs.scc"
193# TARGET_CFLAGS:append:pn-busybox = " -static"
Andrew Geissler517393d2023-01-13 08:55:19 -0600194#
195RDEPENDS:${PN}-ptest += " \
196 attr \
197 bash \
198 coreutils \
199 cpio \
200 diffutils \
201 findutils \
202 grep \
203 python3-core \
204 python3-multiprocessing \
205 strace \
206 tar \
207 util-linux \
208 xz \
209 ${PN}-trivial-httpd \
210 python3-pyyaml \
211 ${@bb.utils.contains('PACKAGECONFIG', 'gjs', 'gjs', '', d)} \
212"
213RDEPENDS:${PN}-ptest:append:libc-glibc = " glibc-utils glibc-localedata-en-us"
214
215RRECOMMENDS:${PN}:append:class-target = " kernel-module-overlay"
216
217SYSTEMD_SERVICE:${PN} = "ostree-remount.service ostree-finalize-staged.path"
218SYSTEMD_SERVICE:${PN}-switchroot = "ostree-prepare-root.service"
219
220BBCLASSEXTEND = "native nativesdk"