about summary refs log tree commit diff
path: root/nixpkgs/pkgs/tools/compression
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2020-06-04 10:19:13 +0000
committerAlyssa Ross <hi@alyssa.is>2020-06-04 22:45:31 +0000
commitda8562f302a145605a3270114ea7063daa82a173 (patch)
treeb27c6d509bad0ee5449f1fcf261a7ec3210df495 /nixpkgs/pkgs/tools/compression
parent17df60ef482ef52b2088e1913de9cd436320612a (diff)
parent467ce5a9f45aaf96110b41eb863a56866e1c2c3c (diff)
downloadnixlib-da8562f302a145605a3270114ea7063daa82a173.tar
nixlib-da8562f302a145605a3270114ea7063daa82a173.tar.gz
nixlib-da8562f302a145605a3270114ea7063daa82a173.tar.bz2
nixlib-da8562f302a145605a3270114ea7063daa82a173.tar.lz
nixlib-da8562f302a145605a3270114ea7063daa82a173.tar.xz
nixlib-da8562f302a145605a3270114ea7063daa82a173.tar.zst
nixlib-da8562f302a145605a3270114ea7063daa82a173.zip
Merge commit '467ce5a9f45aaf96110b41eb863a56866e1c2c3c'
Diffstat (limited to 'nixpkgs/pkgs/tools/compression')
-rw-r--r--nixpkgs/pkgs/tools/compression/dtrx/default.nix17
-rw-r--r--nixpkgs/pkgs/tools/compression/gzip/default.nix12
-rw-r--r--nixpkgs/pkgs/tools/compression/zstd/default.nix25
-rw-r--r--nixpkgs/pkgs/tools/compression/zstd/playtests-darwin.patch18
4 files changed, 52 insertions, 20 deletions
diff --git a/nixpkgs/pkgs/tools/compression/dtrx/default.nix b/nixpkgs/pkgs/tools/compression/dtrx/default.nix
index 81a446066d97..edca969a1e84 100644
--- a/nixpkgs/pkgs/tools/compression/dtrx/default.nix
+++ b/nixpkgs/pkgs/tools/compression/dtrx/default.nix
@@ -1,15 +1,18 @@
 {stdenv, lib, fetchurl, pythonPackages
-, gnutar, unzip, lhasa, rpm, binutils, cpio, gzip, p7zip, cabextract, unrar, unshield
+, gnutar, unzip, lhasa, rpm, binutils, cpio, gzip, cabextract, unrar, unshield
 , bzip2, xz, lzip
-# unzip is handled by p7zip
-, unzipSupport ? false
+# unsafe:
+# ,p7zip
+# unzip is no longer handled by p7zip, since it's unsafe
+, unzipSupport ? true
 , unrarSupport ? false }:
 
 let
-  archivers = lib.makeBinPath ([ gnutar lhasa rpm binutils cpio gzip p7zip cabextract unshield ]
-  ++ lib.optional (unzipSupport) unzip
-  ++ lib.optional (unrarSupport) unrar
-  ++ [ bzip2 xz lzip ]);
+  # p7zip
+  archivers = lib.makeBinPath ([ gnutar lhasa rpm binutils cpio gzip cabextract unshield ]
+                               ++ lib.optional (unzipSupport) unzip
+                               ++ lib.optional (unrarSupport) unrar
+                               ++ [ bzip2 xz lzip ]);
 
 in pythonPackages.buildPythonApplication rec {
   pname = "dtrx";
diff --git a/nixpkgs/pkgs/tools/compression/gzip/default.nix b/nixpkgs/pkgs/tools/compression/gzip/default.nix
index 65760a0b6ccd..eb680ff8a061 100644
--- a/nixpkgs/pkgs/tools/compression/gzip/default.nix
+++ b/nixpkgs/pkgs/tools/compression/gzip/default.nix
@@ -1,4 +1,8 @@
-{ stdenv, fetchurl, xz }:
+{ stdenv
+, fetchurl
+, xz
+, writeText
+}:
 
 stdenv.mkDerivation rec {
   pname = "gzip";
@@ -26,6 +30,12 @@ stdenv.mkDerivation rec {
     }' $out/bin/*
   '';
 
+  # set GZIP env variable to "-n" to stop gzip from adding timestamps
+  # to archive headers: https://github.com/NixOS/nixpkgs/issues/86348
+  setupHook = writeText "setup-hook" ''
+    export GZIP="-n"
+  '';
+
   meta = {
     homepage = "https://www.gnu.org/software/gzip/";
     description = "GNU zip compression program";
diff --git a/nixpkgs/pkgs/tools/compression/zstd/default.nix b/nixpkgs/pkgs/tools/compression/zstd/default.nix
index 50cbc7313653..2f89331f92c6 100644
--- a/nixpkgs/pkgs/tools/compression/zstd/default.nix
+++ b/nixpkgs/pkgs/tools/compression/zstd/default.nix
@@ -6,26 +6,26 @@
 
 stdenv.mkDerivation rec {
   pname = "zstd";
-  version = "1.4.4";
+  version = "1.4.5";
 
   src = fetchFromGitHub {
-    sha256 = "0zn7r8d4m8w2lblnjalqpz18na0spzkdiw3fwq2fzb7drhb32v54";
-    rev = "v${version}";
-    repo = "zstd";
     owner = "facebook";
+    repo = "zstd";
+    rev = "v${version}";
+    sha256 = "0ay3qlk4sffnmcl3b34q4zd7mkcmjds023icmib1mdli97qcp38l";
   };
 
   nativeBuildInputs = [ cmake ]
    ++ stdenv.lib.optional stdenv.isDarwin fixDarwinDylibNames;
 
   patches = [
-    # From https://github.com/facebook/zstd/pull/1883
+    ./playtests-darwin.patch
     (fetchpatch {
-      url = "https://github.com/facebook/zstd/commit/106278e7e5fafaea3b7deb4147bdc8071562d2f0.diff";
-      sha256 = "13z7id1qbc05cv1rmak7c8xrchp7jh1i623bq5pwcihg57wzcyr8";
+      url = "https://github.com/facebook/zstd/pull/2163.patch";
+      sha256 = "07mfjc5f9wy0w2xlj36hyf7g5ax9r2rf6ixhkffhnwc6rwy0q54p";
     })
   ] # This I didn't upstream because if you use posix threads with MinGW it will
-    # work find, and I'm not sure how to write the condition.
+    # work fine, and I'm not sure how to write the condition.
     ++ stdenv.lib.optional stdenv.hostPlatform.isWindows ./mcfgthreads-no-pthread.patch;
 
   cmakeFlags = [
@@ -41,12 +41,13 @@ stdenv.mkDerivation rec {
 
   checkInputs = [ file ];
   doCheck = true;
-  preCheck = ''
-    substituteInPlace ../tests/playTests.sh \
-      --replace 'MD5SUM="md5 -r"' 'MD5SUM="md5sum"'
+  checkPhase = ''
+    runHook preCheck
+    ctest -R playTests # The only relatively fast test.
+    runHook postCheck
   '';
 
-  preInstall = stdenv.lib.optionalString enableShared ''
+  preInstall = ''
     substituteInPlace ../programs/zstdgrep \
       --replace ":-grep" ":-${gnugrep}/bin/grep" \
       --replace ":-zstdcat" ":-$out/bin/zstdcat"
diff --git a/nixpkgs/pkgs/tools/compression/zstd/playtests-darwin.patch b/nixpkgs/pkgs/tools/compression/zstd/playtests-darwin.patch
new file mode 100644
index 000000000000..a98365eec33a
--- /dev/null
+++ b/nixpkgs/pkgs/tools/compression/zstd/playtests-darwin.patch
@@ -0,0 +1,18 @@
+--- a/tests/playTests.sh
++++ b/tests/playTests.sh
+@@ -109,5 +109,2 @@ esac
+ case "$UNAME" in
+-  Darwin) MD5SUM="md5 -r" ;;
+-  FreeBSD) MD5SUM="gmd5sum" ;;
+-  OpenBSD) MD5SUM="md5" ;;
+   *) MD5SUM="md5sum" ;;
+@@ -116,5 +113,2 @@ esac
+ MTIME="stat -c %Y"
+-case "$UNAME" in
+-    Darwin | FreeBSD | OpenBSD) MTIME="stat -f %m" ;;
+-esac
+ 
+@@ -752,3 +746,2 @@ zstd -d --rm dirTestDict/*.zst -D tmpDictC  # note : use internal checksum by de
+ case "$UNAME" in
+-  Darwin) println "md5sum -c not supported on OS-X : test skipped" ;;  # not compatible with OS-X's md5
+   *) $MD5SUM -c tmph1 ;;