From 6817991464d89c7ac350275915d63f520d8829b8 Mon Sep 17 00:00:00 2001 From: Orivej Desh Date: Sat, 23 May 2020 14:44:00 +0000 Subject: [PATCH] zstd: 1.4.4 -> 1.4.5 (#88609) The previous CMake version did not run any tests, the current version tries to run all tests (I could not await their completion), and the last GNU Make version ran `make -C tests shortest` which ran only playTests.sh, so I've enabled only the playTests test. --- pkgs/tools/compression/zstd/default.nix | 25 ++++++++++--------- .../compression/zstd/playtests-darwin.patch | 18 +++++++++++++ 2 files changed, 31 insertions(+), 12 deletions(-) create mode 100644 pkgs/tools/compression/zstd/playtests-darwin.patch diff --git a/pkgs/tools/compression/zstd/default.nix b/pkgs/tools/compression/zstd/default.nix index 50cbc7313653..2f89331f92c6 100644 --- a/pkgs/tools/compression/zstd/default.nix +++ b/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/pkgs/tools/compression/zstd/playtests-darwin.patch b/pkgs/tools/compression/zstd/playtests-darwin.patch new file mode 100644 index 000000000000..a98365eec33a --- /dev/null +++ b/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 ;;