]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core.git/commitdiff
base: Allow zstd and xz decompression from the host tools
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 5 Jun 2026 09:11:53 +0000 (10:11 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 8 Jun 2026 17:03:16 +0000 (18:03 +0100)
We have xz and zstd in HOSTTOOLS but not ASSUME_PROVIDED. In most cases where
we have a dependency on xz-native or zstd-native, we need to compress files
or we need the libraries those recipes provide. In some cases we just need
decompression though.

Compression output is version dependent so we need those dependencies. Libraries
need headers so those are needed too. THe main place we could benefit are the
unpack dependencies from base.bbclass.

Therefore add "XXX-decompress" PROVIDES to those recipes, then change the
dependency in base.bbclass to indicate decompression only. We can then
ASSUME_PROVIDED the decompression side of things to optimise builds whilst
still keeping the other dependencies functional.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes-global/base.bbclass
meta/conf/bitbake.conf
meta/recipes-extended/xz/xz_5.8.3.bb
meta/recipes-extended/zstd/zstd_1.5.7.bb

index 62f2814bb71f1ccd3a7f825a70aba6fdc9e4fdeb..0030cdb2ba8dbd38cf6dbf5eda974a109d8dcc2e 100644 (file)
@@ -663,7 +663,7 @@ python () {
 
         # *.zst should DEPEND on zstd-native for unpacking
         elif path.endswith('.zst'):
-            d.appendVarFlag('do_unpack', 'depends', ' zstd-native:do_populate_sysroot')
+            d.appendVarFlag('do_unpack', 'depends', ' zstd-decompress-native:do_populate_sysroot')
 
         # *.lz should DEPEND on lzip-native for unpacking
         elif path.endswith('.lz'):
@@ -671,7 +671,7 @@ python () {
 
         # *.xz should DEPEND on xz-native for unpacking
         elif path.endswith('.xz') or path.endswith('.txz'):
-            d.appendVarFlag('do_unpack', 'depends', ' xz-native:do_populate_sysroot')
+            d.appendVarFlag('do_unpack', 'depends', ' xz-decompress-native:do_populate_sysroot')
 
         # .zip should DEPEND on unzip-native for unpacking
         elif path.endswith('.zip') or path.endswith('.jar'):
@@ -679,11 +679,11 @@ python () {
 
         # Some rpm files may be compressed internally using xz (for example, rpms from Fedora)
         elif path.endswith('.rpm'):
-            d.appendVarFlag('do_unpack', 'depends', ' xz-native:do_populate_sysroot')
+            d.appendVarFlag('do_unpack', 'depends', ' xz-decompress-native:do_populate_sysroot')
 
         # *.deb should DEPEND on xz-native for unpacking
         elif path.endswith('.deb'):
-            d.appendVarFlag('do_unpack', 'depends', ' xz-native:do_populate_sysroot')
+            d.appendVarFlag('do_unpack', 'depends', ' xz-decompress-native:do_populate_sysroot')
 
         # *.7z should DEPEND on 7zip-native for unpacking
         elif path.endswith('.7z'):
index 181221facd6fdc3c786543573f3dbcfb79afa34f..2d834357222ae5a58c52e6b2167af3aff3c9c373 100644 (file)
@@ -234,6 +234,8 @@ ASSUME_PROVIDED = "\
     virtual/libiconv-native \
     virtual/libintl-native \
     wget-native \
+    xz-decompress-native \
+    zstd-decompress-native \
     "
 # gzip-native should be listed above?
 
index 74efe561c6b831f99851120e928d1129381bebc0..0c0886fa7aab1de58b167739ab0ee35b9ebc77b6 100644 (file)
@@ -3,6 +3,8 @@ HOMEPAGE = "https://tukaani.org/xz/"
 DESCRIPTION = "XZ Utils is free general-purpose data compression software with a high compression ratio. XZ Utils were written for POSIX-like systems, but also work on some not-so-POSIX systems. XZ Utils are the successor to LZMA Utils."
 SECTION = "base"
 
+PROVIDES += "xz-decompress"
+
 # The source includes bits of 0BSD, GPL-2.0, GPL-3.0, LGPL-2.1-or-later, but the
 # only file which is GPL-3.0 is an m4 macro which isn't shipped in any of our
 # packages, and the LGPL bits are under lib/, which appears to be used for
index 0e872b95aafef368799884640a46e200eed7a578..e5088e2d0d1a09cacbd4a45f671a8404ccdfda1e 100644 (file)
@@ -5,6 +5,8 @@ It's backed by a very fast entropy stage, provided by Huff0 and FSE library."
 HOMEPAGE = "http://www.zstd.net/"
 SECTION = "console/utils"
 
+PROVIDES += "zstd-decompress"
+
 LICENSE = "BSD-3-Clause | GPL-2.0-only"
 LIC_FILES_CHKSUM = "file://LICENSE;md5=0822a32f7acdbe013606746641746ee8 \
                     file://COPYING;md5=39bba7d2cf0ba1036f2a6e2be52fe3f0 \