blob: b3b34a15e694615d9b699d296ef49bcaa02829fc [file] [log] [blame]
Brad Bishop0a921262019-09-24 07:40:45 -04001SUMMARY = "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 gpgme \
14 e2fsprogs \
15 libcap \
16 zlib \
17 xz \
18 bison-native \
19"
20
21# The Yocto mirror has an old export of ostree:
22# http://downloads.yoctoproject.org/mirror/sources/git2_github.com.ostreedev.ostree.tar.gz
23PREMIRRORS = ""
24
25SRC_URI = " \
26 gitsm://github.com/ostreedev/ostree \
27 file://0001-macros-Add-TEMP_FAILURE_RETRY-for-musl.patch \
Brad Bishop2f973922019-11-11 07:58:48 -050028 file://run-ptest \
29 file://0001-tests-core-Fallback-to-en_US.UTF-8-locale.patch \
30 file://0001-tests-Handle-EPIPE-failures-when-head-terminates.patch \
31 file://0002-tests-core-Assume-C.UTF-8-if-locale-isn-t-found.patch \
32 file://0003-tests-Avoid-musl-failure-with-cp-a.patch \
33 file://0001-build-create-tests-directory-for-split-builds.patch \
Brad Bishop0a921262019-09-24 07:40:45 -040034"
Brad Bishop2f973922019-11-11 07:58:48 -050035SRCREV = "980ca07b03b3aa7e0012729dd6c84b0878775d93"
Brad Bishop0a921262019-09-24 07:40:45 -040036
37UPSTREAM_CHECK_GITTAGREGEX = "v(?P<pver>\d+\.\d+)"
38
39S = "${WORKDIR}/git"
40
Brad Bishop2f973922019-11-11 07:58:48 -050041inherit autotools bash-completion gobject-introspection gtk-doc pkgconfig ptest-gnome systemd
Brad Bishop0a921262019-09-24 07:40:45 -040042
Brad Bishop2f973922019-11-11 07:58:48 -050043# Package configuration - match ostree defaults, but without rofiles-fuse
Brad Bishop0a921262019-09-24 07:40:45 -040044# otherwise we introduce a dependendency on meta-filesystems
45PACKAGECONFIG ??= " \
46 ${@bb.utils.filter('DISTRO_FEATURES', 'selinux smack', d)} \
47 ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd libmount', '', d)} \
48 soup \
49"
50
51# We include soup 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 soup \
56"
57
58PACKAGECONFIG[avahi] = "--with-avahi, --without-avahi, avahi"
59PACKAGECONFIG[curl] = "--with-curl, --without-curl, curl"
60PACKAGECONFIG[dracut] = "--with-dracut, --without-dracut"
61PACKAGECONFIG[gnutls] = "--with-crypto=gnutls, , gnutls"
62PACKAGECONFIG[libarchive] = "--with-libarchive, --without-libarchive, libarchive"
63PACKAGECONFIG[libmount] = "--with-libmount, --without-libmount, util-linux"
64PACKAGECONFIG[man] = "--enable-man, --disable-man, libxslt-native docbook-xsl-stylesheets-native"
65PACKAGECONFIG[mkinitcpio] = "--with-mkinitcpio, --without-mkinitcpio"
66PACKAGECONFIG[no-http2] = "--disable-http2, --enable-http2"
67PACKAGECONFIG[openssl] = "--with-crypto=openssl, , openssl"
68PACKAGECONFIG[rofiles-fuse] = "--enable-rofiles-fuse, --disable-rofiles-fuse, fuse"
69PACKAGECONFIG[selinux] = "--with-selinux, --without-selinux, libselinux"
70PACKAGECONFIG[smack] = "--with-smack, --without-smack, smack"
71PACKAGECONFIG[soup] = "--with-soup, --without-soup --disable-glibtest, libsoup-2.4"
72PACKAGECONFIG[static] = ""
73PACKAGECONFIG[systemd] = "--with-libsystemd --with-systemdsystemunitdir=${systemd_unitdir}/system, --without-libsystemd, systemd"
74PACKAGECONFIG[trivial-httpd-cmdline] = "--enable-trivial-httpd-cmdline, --disable-trivial-httpd-cmdline"
75
76EXTRA_OECONF = " \
77 ${@bb.utils.contains('PACKAGECONFIG', 'static', '--with-static-compiler=\'${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}\'', '', d)} \
78"
79
80# Makefile-libostree.am overrides this to avoid a build problem with clang,
81# but that fix breaks cross compilation and we don't need it
82EXTRA_OEMAKE = " \
83 INTROSPECTION_SCANNER_ENV= \
84"
85
86EXTRA_OECONF_class-native = " \
87 --with-builtin-grub2-mkconfig \
88 --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}"
95SYSROOT_DIR_class-native = "${STAGING_DIR_NATIVE}"
96do_configure[vardeps] += "SYSROOT_DIR"
97
98do_configure_prepend() {
99 # 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
105do_install_append_class-native() {
106 create_wrapper ${D}${bindir}/ostree OSTREE_GRUB2_EXEC="${STAGING_LIBDIR_NATIVE}/ostree/ostree-grub-generator"
107}
108
109PACKAGES += " \
110 ${PN}-dracut \
111 ${PN}-grub \
112 ${PN}-mkinitcpio \
113 ${PN}-switchroot \
Brad Bishop2f973922019-11-11 07:58:48 -0500114 ${PN}-trivial-httpd \
Brad Bishop0a921262019-09-24 07:40:45 -0400115"
116
117FILES_${PN} = " \
118 ${bindir}/ostree \
119 ${bindir}/rofiles-fuse \
120 ${datadir}/${BPN} \
121 ${datadir}/gir-1.0 \
122 ${libdir}/${BPN}/ostree-remount \
123 ${libdir}/girepository-1.0 \
124 ${libdir}/lib*${SOLIBS} \
125 ${libdir}/tmpfiles.d/ostree-tmpfiles.conf \
Brad Bishop0a921262019-09-24 07:40:45 -0400126 ${sysconfdir}/ostree/remotes.d \
127 ${systemd_unitdir}/system-generators/ostree-system-generator \
128 ${systemd_unitdir}/system/ostree-finalize-staged.path \
129 ${systemd_unitdir}/system/ostree-finalize-staged.service \
130 ${systemd_unitdir}/system/ostree-remount.service \
131"
132FILES_${PN}-dracut = " \
133 ${sysconfdir}/dracut.conf.d \
134 ${libdir}/dracut \
135"
136FILES_${PN}-grub = " \
137 ${sysconfdir}/grub.d \
138 ${libexecdir}/libostree/grub2-15_ostree \
139"
140FILES_${PN}-mkinitcpio = " \
141 ${sysconfdir}/ostree-mkinitcpio.conf \
142 ${libdir}/initcpio \
143"
144FILES_${PN}-switchroot = " \
145 ${libdir}/ostree/ostree-prepare-root \
146 ${systemd_unitdir}/system/ostree-prepare-root.service \
147"
Brad Bishop2f973922019-11-11 07:58:48 -0500148FILES_${PN}-trivial-httpd = " \
149 ${libexecdir}/libostree/ostree-trivial-httpd \
150"
Brad Bishop0a921262019-09-24 07:40:45 -0400151
Brad Bishop2f973922019-11-11 07:58:48 -0500152RDEPENDS_${PN} = " \
153 ${@bb.utils.contains('PACKAGECONFIG', 'trivial-httpd-cmdline', '${PN}-trivial-httpd', '', d)} \
154"
Brad Bishop0a921262019-09-24 07:40:45 -0400155RDEPENDS_${PN}-dracut = "bash"
156RDEPENDS_${PN}-mkinitcpio = "bash"
157RDEPENDS_${PN}_class-target = " \
158 gnupg \
159 ${PN}-switchroot \
160"
Brad Bishop2f973922019-11-11 07:58:48 -0500161RDEPENDS_${PN}-ptest += " \
162 attr \
163 bash \
164 coreutils \
165 cpio \
166 diffutils \
167 findutils \
168 grep \
169 python3-core \
170 python3-multiprocessing \
171 python3-pyyaml \
172 ${PN}-trivial-httpd \
173"
174RDEPENDS_${PN}-ptest_append_libc-glibc = " glibc-utils glibc-localedata-en-us"
Brad Bishop0a921262019-09-24 07:40:45 -0400175
176RRECOMMENDS_${PN} += "kernel-module-overlay"
Brad Bishop2f973922019-11-11 07:58:48 -0500177RRECOMMENDS_${PN}-ptest += "strace"
Brad Bishop0a921262019-09-24 07:40:45 -0400178
179SYSTEMD_SERVICE_${PN} = "ostree-remount.service ostree-finalize-staged.path"
180SYSTEMD_SERVICE_${PN}-switchroot = "ostree-prepare-root.service"
181
182BBCLASSEXTEND = "native"
Brad Bishop2f973922019-11-11 07:58:48 -0500183
184python __anonymous() {
185 if not bb.data.inherits_class('native', d) and bb.utils.contains('PTEST_ENABLED', '1', 'True', 'False', d):
186 if not bb.utils.contains_any('BBFILE_COLLECTIONS', 'meta-python', 'True', 'False', d):
187 raise bb.parse.SkipRecipe('ptest requires meta-python to be present.')
188 elif not bb.utils.contains_any('PACKAGECONFIG', 'soup curl', 'True', 'False', d):
189 raise bb.parse.SkipRecipe('ptest requires soup enabled in PACKAGECONFIG.')
190 elif not oe.utils.any_distro_features(d, "xattr"):
191 raise bb.parse.SkipRecipe('ptest requires xattr enabled in DISTRO_FEATURES.')
192}