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