]> 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>
Fri, 5 Jun 2026 14:50:15 +0000 (15:50 +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 d462593c4e0164d6044c2f4ed70ee5691df4bea9..4684dbd60c8edda87489adbdef440ebac3263dde 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 4eb235da60a5f888c0aa6deab83c0f6387bc738a..27d747536e4b96a1495b1c6f9a63c0d991cdc232 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 66e326f386e418ca7c5f1017e5f17ecb26c8d83c..8d147dbeed9989b08c4ab6ed8c63eb21b8c00d01 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 \