pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc/mk



Module Name:    pkgsrc
Committed By:   schmonz
Date:           Thu Jan  6 10:19:12 UTC 2022

Modified Files:
        pkgsrc/mk/extract: bsd.extract-vars.mk extract extract.mk
        pkgsrc/mk/tools: defaults.mk replace.mk

Log Message:
Extract .zst distfiles using archivers/zstd.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 pkgsrc/mk/extract/bsd.extract-vars.mk
cvs rdiff -u -r1.19 -r1.20 pkgsrc/mk/extract/extract
cvs rdiff -u -r1.42 -r1.43 pkgsrc/mk/extract/extract.mk
cvs rdiff -u -r1.62 -r1.63 pkgsrc/mk/tools/defaults.mk
cvs rdiff -u -r1.292 -r1.293 pkgsrc/mk/tools/replace.mk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/mk/extract/bsd.extract-vars.mk
diff -u pkgsrc/mk/extract/bsd.extract-vars.mk:1.20 pkgsrc/mk/extract/bsd.extract-vars.mk:1.21
--- pkgsrc/mk/extract/bsd.extract-vars.mk:1.20  Fri Mar 20 17:16:34 2020
+++ pkgsrc/mk/extract/bsd.extract-vars.mk       Thu Jan  6 10:19:11 2022
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.extract-vars.mk,v 1.20 2020/03/20 17:16:34 rillig Exp $
+# $NetBSD: bsd.extract-vars.mk,v 1.21 2022/01/06 10:19:11 schmonz Exp $
 #
 # This file configures how a package extracts its distfiles after
 # downloading them.
@@ -107,4 +107,7 @@ USE_TOOLS+= gem
 .if !empty(EXTRACT_ONLY:M*.7z)
 USE_TOOLS+=    7za
 .endif
+.if !empty(EXTRACT_ONLY:M*.zst)
+USE_TOOLS+=    zstd
+.endif
 

Index: pkgsrc/mk/extract/extract
diff -u pkgsrc/mk/extract/extract:1.19 pkgsrc/mk/extract/extract:1.20
--- pkgsrc/mk/extract/extract:1.19      Fri Aug  2 11:48:17 2019
+++ pkgsrc/mk/extract/extract   Thu Jan  6 10:19:11 2022
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: extract,v 1.19 2019/08/02 11:48:17 nia Exp $
+# $NetBSD: extract,v 1.20 2022/01/06 10:19:11 schmonz Exp $
 #
 # Copyright (c) 2006 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -84,6 +84,7 @@
 #      EXTRACT_OPTS_RPM
 #      EXTRACT_OPTS_TAR
 #      EXTRACT_OPTS_ZIP
+#      EXTRACT_OPTS_ZSTD
 #      EXTRACT_OPTS_ZOO
 #              These variables set additional arguments passed to the
 #              underlying extraction tool to unpack their respective
@@ -114,6 +115,7 @@ set -u              # treat undefined variables as e
 : ${UNZOO:=unzoo}
 : ${P7ZA:="7za x"}
 : ${P7ZA_SO:="7za x -so"}
+: ${ZSTD:="zstd"}
 
 : ${TMPDIR:=/tmp}
 
@@ -202,7 +204,7 @@ esac
 
 # Derive the format of the archive based on the file extension.
 case "$distfile" in
-*.tar.gz|*.tgz|*-tar.gz|*_tar.gz|*.tar.bz2|*.txz|*.tbz|*.tbz2|*.tar.lz|*.tar.lzma|*.tar.xz|*.tar.Z|*.tar.z|*.tar|*.tar.bz|*.tar.7z|*.crate)
+*.tar.gz|*.tgz|*-tar.gz|*_tar.gz|*.tar.bz2|*.txz|*.tbz|*.tbz2|*.tar.lz|*.tar.lzma|*.tar.xz|*.tar.Z|*.tar.z|*.tar|*.tar.bz|*.tar.7z|*.tar.zst|*.crate)
                _format=tar ;;
 *.cpio|*.cpio.gz|*.cpio.bz2)
                _format=cpio ;;
@@ -218,6 +220,7 @@ case "$distfile" in
 *.bin|*.sh)    _format=jre-bin ;;
 *.gem)         _format=gem ;;
 *.7z)          _format=7z ;;
+*.zst)         _format=zstd ;;
 *)             _format=none ;;
 esac
 ${TEST} -n "$format" || format="$_format"
@@ -345,6 +348,12 @@ gem)
        ${P7ZA} "$distfile"
        ;;
 
+zst)
+       ${ECHO} 1>&2 "$self: SCHMONZ: looks like $format is .zst"
+       : ${EXTRACT_OPTS_ZSTD=}
+       ${ZSTD} -d ${EXTRACT_OPTS_ZSTD} "$distfile" ${1+"$@"}
+       ;;
+
 none)
        # By default, copy the distfile over to the current working directory.
        ${CP} "$distfile" .

Index: pkgsrc/mk/extract/extract.mk
diff -u pkgsrc/mk/extract/extract.mk:1.42 pkgsrc/mk/extract/extract.mk:1.43
--- pkgsrc/mk/extract/extract.mk:1.42   Tue Mar 30 16:47:03 2021
+++ pkgsrc/mk/extract/extract.mk        Thu Jan  6 10:19:11 2022
@@ -1,4 +1,4 @@
-# $NetBSD: extract.mk,v 1.42 2021/03/30 16:47:03 ryoon Exp $
+# $NetBSD: extract.mk,v 1.43 2022/01/06 10:19:11 schmonz Exp $
 #
 # The following variables may be set by the package Makefile and
 # specify how extraction happens:
@@ -166,6 +166,7 @@ _EXTRACT_ENV+=      ${EXTRACT_OPTS_RAR:D    EXTR
 _EXTRACT_ENV+= ${EXTRACT_OPTS_RPM:D    EXTRACT_OPTS_LHA=${EXTRACT_OPTS_RPM:Q}}
 _EXTRACT_ENV+= ${EXTRACT_OPTS_TAR:D    EXTRACT_OPTS_TAR=${EXTRACT_OPTS_TAR:Q}}
 _EXTRACT_ENV+= ${EXTRACT_OPTS_ZIP:D    EXTRACT_OPTS_ZIP=${EXTRACT_OPTS_ZIP:Q}}
+_EXTRACT_ENV+= ${EXTRACT_OPTS_ZSTD:D   EXTRACT_OPTS_ZSTD=${EXTRACT_OPTS_ZSTD:Q}}
 _EXTRACT_ENV+= ${EXTRACT_OPTS_ZOO:D    EXTRACT_OPTS_ZOO=${EXTRACT_OPTS_ZOO:Q}}
 _EXTRACT_ENV+= ${TOOLS_CMDLINE_BZCAT:D         BZCAT=${TOOLS_CMDLINE_BZCAT:Q}}
 _EXTRACT_ENV+= ${TOOLS_CAT:D           CAT=${TOOLS_CAT:Q}}
@@ -185,6 +186,7 @@ _EXTRACT_ENV+=      ${TOOLS_UNZIP_CMD:D     UNZIP
 _EXTRACT_ENV+= ${TOOLS_UNZOO:D         UNZOO=${TOOLS_UNZOO:Q}}
 _EXTRACT_ENV+= ${TOOLS_XZCAT:D         XZCAT=${TOOLS_XZCAT:Q}}
 _EXTRACT_ENV+= ${TOOLS_7ZA:D           P7ZA=${TOOLS_7ZA:Q}}
+_EXTRACT_ENV+= ${TOOLS_ZSTD:D          ZSTD=${TOOLS_ZSTD:Q}}
 _EXTRACT_ENV+= ${EXTRACT_ENV}
 
 .if !empty(EXTRACT_USING:Mbsdtar)

Index: pkgsrc/mk/tools/defaults.mk
diff -u pkgsrc/mk/tools/defaults.mk:1.62 pkgsrc/mk/tools/defaults.mk:1.63
--- pkgsrc/mk/tools/defaults.mk:1.62    Wed Aug 22 20:48:37 2018
+++ pkgsrc/mk/tools/defaults.mk Thu Jan  6 10:19:11 2022
@@ -1,4 +1,4 @@
-# $NetBSD: defaults.mk,v 1.62 2018/08/22 20:48:37 maya Exp $
+# $NetBSD: defaults.mk,v 1.63 2022/01/06 10:19:11 schmonz Exp $
 #
 # Copyright (c) 2005 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -143,6 +143,7 @@ _TOOLS_VARNAME.xmkmf=               XMKMF_CMD
 _TOOLS_VARNAME.xz=             XZ
 _TOOLS_VARNAME.xzcat=          XZCAT
 _TOOLS_VARNAME.yacc=           YACC
+_TOOLS_VARNAME.zstd=           ZSTD
 
 ######################################################################
 

Index: pkgsrc/mk/tools/replace.mk
diff -u pkgsrc/mk/tools/replace.mk:1.292 pkgsrc/mk/tools/replace.mk:1.293
--- pkgsrc/mk/tools/replace.mk:1.292    Mon Jul 19 09:55:04 2021
+++ pkgsrc/mk/tools/replace.mk  Thu Jan  6 10:19:11 2022
@@ -1,4 +1,4 @@
-# $NetBSD: replace.mk,v 1.292 2021/07/19 09:55:04 triaxx Exp $
+# $NetBSD: replace.mk,v 1.293 2022/01/06 10:19:11 schmonz Exp $
 #
 # Copyright (c) 2005 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -203,6 +203,16 @@ _TOOLS_USE_PKGSRC.${_t_}?= yes
 # command, e.g., TOOLS_TBL, TOOLS_YACC, etc., provided that "TOOL" has
 # been associated with <tool>.
 #
+.if !defined(TOOLS_IGNORE.zstd) && !empty(_USE_TOOLS:Mzstd)
+.  if !empty(PKGPATH:Marchivers/zstd)
+MAKEFLAGS+=                    TOOLS_IGNORE.zstd=
+.  elif !empty(_TOOLS_USE_PKGSRC.zstd:M[yY][eE][sS])
+TOOLS_DEPENDS.zstd?=           zstd>=1.5.0:../../archivers/zstd
+TOOLS_CREATE+=                 zstd
+TOOLS_PATH.zstd=               ${LOCALBASE}/bin/zstd
+.  endif
+.endif
+
 .if !defined(TOOLS_IGNORE.7za) && !empty(_USE_TOOLS:M7za)
 .  if !empty(PKGPATH:Marchivers/p7zip)
 MAKEFLAGS+=                    TOOLS_IGNORE.7za=



Home | Main Index | Thread Index | Old Index