blob: b0c9849fad7f45a1a5a163edfbdf347ce5e0e3cd [file] [log] [blame]
Andrew Geissler82c905d2020-04-13 13:39:40 -05001SUMMARY = "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 = "LGPLv2.1"
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
20# The Yocto mirror has an old export of ostree:
21# http://downloads.yoctoproject.org/mirror/sources/git2_github.com.ostreedev.ostree.tar.gz
22PREMIRRORS = ""
23
24SRC_URI = " \
William A. Kennington IIIb95905d2021-06-02 12:40:56 -070025 gitsm://github.com/ostreedev/ostree;branch=main \
Andrew Geissler82c905d2020-04-13 13:39:40 -050026 file://run-ptest \
27"
Andrew Geissler69721092021-07-23 12:57:00 -040028SRCREV = "38c14b374567f736533f7f515595208fe359819f"
Andrew Geissler82c905d2020-04-13 13:39:40 -050029
30UPSTREAM_CHECK_GITTAGREGEX = "v(?P<pver>\d+\.\d+)"
31
32S = "${WORKDIR}/git"
33
34inherit autotools bash-completion gobject-introspection gtk-doc manpages pkgconfig ptest-gnome systemd
35
36# Package configuration - match ostree defaults, but without rofiles-fuse
37# otherwise we introduce a dependendency on meta-filesystems
38PACKAGECONFIG ??= " \
39 ${@bb.utils.filter('DISTRO_FEATURES', 'selinux smack', d)} \
40 ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd libmount', '', d)} \
41 glib \
42 gpgme \
43 soup \
44"
45
46# We include soup because ostree can't (currently) be built without
47# soup or curl - https://github.com/ostreedev/ostree/issues/1897
Patrick Williams213cb262021-08-07 19:21:33 -050048PACKAGECONFIG:class-native ??= " \
Andrew Geissler82c905d2020-04-13 13:39:40 -050049 ${@bb.utils.filter('DISTRO_FEATURES', 'selinux smack', d)} \
50 builtin-grub2-mkconfig \
51 gpgme \
52 soup \
53"
54
55PACKAGECONFIG[avahi] = "--with-avahi, --without-avahi, avahi"
56PACKAGECONFIG[builtin-grub2-mkconfig] = "--with-builtin-grub2-mkconfig, --without-builtin-grub2-mkconfig"
57PACKAGECONFIG[curl] = "--with-curl, --without-curl, curl"
58PACKAGECONFIG[dracut] = "--with-dracut, --without-dracut"
59PACKAGECONFIG[glib] = "--with-crypto=glib"
60PACKAGECONFIG[gjs] = "ac_cv_path_GJS=${bindir}/gjs"
61PACKAGECONFIG[gnutls] = "--with-crypto=gnutls, , gnutls"
62PACKAGECONFIG[gpgme] = "--with-gpgme, --without-gpgme, gpgme"
63PACKAGECONFIG[libarchive] = "--with-libarchive, --without-libarchive, libarchive"
64PACKAGECONFIG[libmount] = "--with-libmount, --without-libmount, util-linux"
65PACKAGECONFIG[manpages] = "--enable-man, --disable-man, libxslt-native docbook-xsl-stylesheets-native"
66PACKAGECONFIG[mkinitcpio] = "--with-mkinitcpio, --without-mkinitcpio"
67PACKAGECONFIG[no-http2] = "--disable-http2, --enable-http2"
68PACKAGECONFIG[openssl] = "--with-crypto=openssl, , openssl"
69PACKAGECONFIG[rofiles-fuse] = "--enable-rofiles-fuse, --disable-rofiles-fuse, fuse"
70PACKAGECONFIG[selinux] = "--with-selinux, --without-selinux, libselinux"
71PACKAGECONFIG[smack] = "--with-smack, --without-smack, smack"
72PACKAGECONFIG[soup] = "--with-soup, --without-soup --disable-glibtest, libsoup-2.4"
73PACKAGECONFIG[static] = ""
74PACKAGECONFIG[systemd] = "--with-libsystemd --with-systemdsystemunitdir=${systemd_unitdir}/system, --without-libsystemd, systemd"
75PACKAGECONFIG[trivial-httpd-cmdline] = "--enable-trivial-httpd-cmdline, --disable-trivial-httpd-cmdline"
76
77EXTRA_OECONF = " \
78 ${@bb.utils.contains('PACKAGECONFIG', 'static', '--with-static-compiler=\'${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}\'', '', d)} \
79"
80
81# Makefile-libostree.am overrides this to avoid a build problem with clang,
82# but that fix breaks cross compilation and we don't need it
83EXTRA_OEMAKE = " \
84 INTROSPECTION_SCANNER_ENV= \
85"
86
Patrick Williams213cb262021-08-07 19:21:33 -050087EXTRA_OECONF:class-native = " \
Andrew Geissler82c905d2020-04-13 13:39:40 -050088 --enable-wrpseudo-compat \
89 --disable-otmpfile \
90"
91
92# Path to ${prefix}/lib/ostree/ostree-grub-generator is hardcoded on the
93# do_configure stage so we do depend on it
94SYSROOT_DIR = "${STAGING_DIR_TARGET}"
Patrick Williams213cb262021-08-07 19:21:33 -050095SYSROOT_DIR:class-native = "${STAGING_DIR_NATIVE}"
Andrew Geissler82c905d2020-04-13 13:39:40 -050096do_configure[vardeps] += "SYSROOT_DIR"
97
Patrick Williams213cb262021-08-07 19:21:33 -050098do_configure:prepend() {
Andrew Geissler82c905d2020-04-13 13:39:40 -050099 # this reflects what autogen.sh does, but the OE wrappers for autoreconf
100 # allow it to work without the other gyrations which exist there
101 cp ${S}/libglnx/Makefile-libglnx.am ${S}/libglnx/Makefile-libglnx.am.inc
102 cp ${S}/bsdiff/Makefile-bsdiff.am ${S}/bsdiff/Makefile-bsdiff.am.inc
103}
104
Patrick Williams213cb262021-08-07 19:21:33 -0500105do_install:append:class-native() {
Andrew Geissler82c905d2020-04-13 13:39:40 -0500106 create_wrapper ${D}${bindir}/ostree OSTREE_GRUB2_EXEC="${STAGING_LIBDIR_NATIVE}/ostree/ostree-grub-generator"
107}
108
109PACKAGE_BEFORE_PN = " \
110 ${PN}-dracut \
111 ${PN}-grub \
112 ${PN}-mkinitcpio \
113 ${PN}-switchroot \
114 ${PN}-trivial-httpd \
115"
116
Patrick Williams213cb262021-08-07 19:21:33 -0500117FILES:${PN} += " \
Andrew Geissler82c905d2020-04-13 13:39:40 -0500118 ${nonarch_libdir}/${BPN} \
119 ${nonarch_libdir}/tmpfiles.d \
120 ${systemd_unitdir}/system \
121 ${systemd_unitdir}/system-generators \
122"
Patrick Williams213cb262021-08-07 19:21:33 -0500123FILES:${PN}-dracut = " \
Andrew Geissler82c905d2020-04-13 13:39:40 -0500124 ${sysconfdir}/dracut.conf.d \
125 ${libdir}/dracut \
126"
Patrick Williams213cb262021-08-07 19:21:33 -0500127FILES:${PN}-grub = " \
Andrew Geissler82c905d2020-04-13 13:39:40 -0500128 ${sysconfdir}/grub.d \
129 ${libexecdir}/libostree/grub2-15_ostree \
130"
Patrick Williams213cb262021-08-07 19:21:33 -0500131FILES:${PN}-mkinitcpio = " \
Andrew Geissler82c905d2020-04-13 13:39:40 -0500132 ${sysconfdir}/ostree-mkinitcpio.conf \
133 ${libdir}/initcpio \
134"
Patrick Williams213cb262021-08-07 19:21:33 -0500135FILES:${PN}-switchroot = " \
Andrew Geissler82c905d2020-04-13 13:39:40 -0500136 ${nonarch_libdir}/${BPN}/ostree-prepare-root \
137 ${systemd_unitdir}/system/ostree-prepare-root.service \
138"
Patrick Williams213cb262021-08-07 19:21:33 -0500139FILES:${PN}-trivial-httpd = " \
Andrew Geissler82c905d2020-04-13 13:39:40 -0500140 ${libexecdir}/libostree/ostree-trivial-httpd \
141"
142
Patrick Williams213cb262021-08-07 19:21:33 -0500143RDEPENDS:${PN} = " \
Andrew Geissler82c905d2020-04-13 13:39:40 -0500144 ${@bb.utils.contains('PACKAGECONFIG', 'trivial-httpd-cmdline', '${PN}-trivial-httpd', '', d)} \
145"
Patrick Williams213cb262021-08-07 19:21:33 -0500146RDEPENDS:${PN}-dracut = "bash"
147RDEPENDS:${PN}-mkinitcpio = "bash"
148RDEPENDS:${PN}:class-target = " \
Andrew Geissler82c905d2020-04-13 13:39:40 -0500149 ${@bb.utils.contains('PACKAGECONFIG', 'gpgme', 'gnupg', '', d)} \
150 ${PN}-switchroot \
151"
152
153#
154# Note that to get ptest to pass you also need:
155#
156# xattr in DISTRO_FEATURES
Patrick Williams213cb262021-08-07 19:21:33 -0500157# static ostree-prepare-root (PACKAGECONFIG:append:pn-ostree = " static")
Andrew Geissler82c905d2020-04-13 13:39:40 -0500158# meta-python in your layers
159# overlayfs in your kernel (KERNEL_EXTRA_FEATURES += "features/overlayfs/overlayfs.scc")
160# busybox built statically
161# /var/tmp as a real filesystem (not a tmpfs)
162# Sufficient disk space (IMAGE_ROOTFS_SIZE = "524288") and RAM (QB_MEM = "-m 1024")
163#
Patrick Williams213cb262021-08-07 19:21:33 -0500164RDEPENDS:${PN}-ptest += " \
Andrew Geissler82c905d2020-04-13 13:39:40 -0500165 attr \
166 bash \
167 coreutils \
168 cpio \
169 diffutils \
170 findutils \
171 grep \
172 python3-core \
173 python3-multiprocessing \
174 strace \
175 tar \
176 util-linux \
177 xz \
178 ${PN}-trivial-httpd \
Andrew Geisslerf103a7f2021-05-07 16:09:40 -0500179 python3-pyyaml \
Andrew Geissler82c905d2020-04-13 13:39:40 -0500180 ${@bb.utils.contains('PACKAGECONFIG', 'gjs', 'gjs', '', d)} \
181"
Patrick Williams213cb262021-08-07 19:21:33 -0500182RDEPENDS:${PN}-ptest:append:libc-glibc = " glibc-utils glibc-localedata-en-us"
Andrew Geissler82c905d2020-04-13 13:39:40 -0500183
Patrick Williams213cb262021-08-07 19:21:33 -0500184RRECOMMENDS:${PN} += "kernel-module-overlay"
Andrew Geissler82c905d2020-04-13 13:39:40 -0500185
Patrick Williams213cb262021-08-07 19:21:33 -0500186SYSTEMD_SERVICE:${PN} = "ostree-remount.service ostree-finalize-staged.path"
187SYSTEMD_SERVICE:${PN}-switchroot = "ostree-prepare-root.service"
Andrew Geissler82c905d2020-04-13 13:39:40 -0500188
189BBCLASSEXTEND = "native"