build: add zstd support to pack/unpack functions
authorMatthias Schiffer <mschiffer@universe-factory.net>
Sun, 17 May 2020 11:18:10 +0000 (13:18 +0200)
committerMatthias Schiffer <mschiffer@universe-factory.net>
Sun, 31 May 2020 09:03:30 +0000 (11:03 +0200)
Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
include/download.mk
include/unpack.mk

index 14d68bf8f5e929fb4bdf6908f0d428c2d584f19e..9c8ada052b04a049b1fe4eec1061534b10771906 100644 (file)
@@ -50,6 +50,7 @@ endef
 dl_pack/bz2=bzip2 -c > $(1)
 dl_pack/gz=gzip -nc > $(1)
 dl_pack/xz=xz -zc -7e > $(1)
+dl_pack/zst=zstd -T0 --ultra -20 -c > $(1)
 dl_pack/unknown=$(error ERROR: Unknown pack format for file $(1))
 define dl_pack
        $(if $(dl_pack/$(call ext,$(1))),$(dl_pack/$(call ext,$(1))),$(dl_pack/unknown))
index 6141b1c7225db7ecee4e73bd493d736897871b2a..5bb27d41c9a9eea33940ff65c4c9d7aa216ab83f 100644 (file)
@@ -31,6 +31,10 @@ ifeq ($(strip $(UNPACK_CMD)),)
       EXT:=$(call ext,$(PKG_SOURCE:.$(EXT)=))
       DECOMPRESS_CMD:=xzcat $(DL_DIR)/$(PKG_SOURCE) |
     endif
+    ifeq (zst,$(EXT))
+      EXT:=$(call ext,$(PKG_SOURCE:.$(EXT)=))
+      DECOMPRESS_CMD:=zstdcat $(DL_DIR)/$(PKG_SOURCE) |
+    endif
     ifeq ($(filter tgz tbz tbz2 txz,$(EXT1)),$(EXT1))
       EXT:=tar
     endif