From 088277aafba9c94c3e311a1b712b7426b447d916 Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Sun, 2 Jan 2022 22:25:18 +0000 Subject: [PATCH] zstd: 1.5.0 -> 1.5.1 (#153103) While at it added trivial updater plumbing. --- pkgs/tools/compression/zstd/default.nix | 17 +++++++++-------- .../compression/zstd/playtests-darwin.patch | 9 ++++++++- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/pkgs/tools/compression/zstd/default.nix b/pkgs/tools/compression/zstd/default.nix index 1f9b4a505ac4..a3184f6d1ede 100644 --- a/pkgs/tools/compression/zstd/default.nix +++ b/pkgs/tools/compression/zstd/default.nix @@ -7,17 +7,18 @@ # these need to be ran on the host, thus disable when cross-compiling , buildContrib ? stdenv.hostPlatform == stdenv.buildPlatform , doCheck ? stdenv.hostPlatform == stdenv.buildPlatform +, nix-update-script }: stdenv.mkDerivation rec { pname = "zstd"; - version = "1.5.0"; + version = "1.5.1"; src = fetchFromGitHub { owner = "facebook"; repo = "zstd"; rev = "v${version}"; - sha256 = "0icc0x89c35rq5bxd4d241vqxnz2i1qj2wwy01xls63p0z93brj7"; + sha256 = "sha256-D9+kuIjPYnmg5ht/ezIeYCpyiLkrtdiH3fwpmemIPGM="; }; nativeBuildInputs = [ cmake ] @@ -28,12 +29,6 @@ stdenv.mkDerivation rec { # This patches makes sure we do not attempt to use the MD5 implementation # of the host platform when running the tests ./playtests-darwin.patch - - # Fixes linking for static builds - (fetchpatch { - url = "https://github.com/facebook/zstd/pull/2724/commits/e1f85dbca3a0ed5ef06c8396912a0914db8dea6a.patch"; - sha256 = "sha256-PuYAqnJWAE+L9bsroOnnBGJhERW8LHrGSLtIEkKU9vg="; - }) ]; postPatch = lib.optionalString (!static) '' @@ -90,6 +85,12 @@ stdenv.mkDerivation rec { ++ lib.optional stdenv.hostPlatform.isUnix "man" ++ [ "out" ]; + passthru = { + updateScript = nix-update-script { + attrPath = pname; + }; + }; + meta = with lib; { description = "Zstandard real-time compression algorithm"; longDescription = '' diff --git a/pkgs/tools/compression/zstd/playtests-darwin.patch b/pkgs/tools/compression/zstd/playtests-darwin.patch index bcb895a697ca..454489a24a12 100644 --- a/pkgs/tools/compression/zstd/playtests-darwin.patch +++ b/pkgs/tools/compression/zstd/playtests-darwin.patch @@ -1,6 +1,6 @@ --- a/tests/playTests.sh +++ b/tests/playTests.sh -@@ -112,22 +112,12 @@ case "$OS" in +@@ -112,29 +112,19 @@ case "$OS" in esac case "$UNAME" in @@ -16,6 +16,13 @@ - Darwin | FreeBSD | OpenBSD | NetBSD) MTIME="stat -f %m" ;; -esac + assertSameMTime() { + MT1=$($MTIME "$1") + MT2=$($MTIME "$2") + echo MTIME $MT1 $MT2 + [ "$MT1" = "$MT2" ] || die "mtime on $1 doesn't match mtime on $2 ($MT1 != $MT2)" + } + GET_PERMS="stat -c %a" -case "$UNAME" in - Darwin | FreeBSD | OpenBSD | NetBSD) GET_PERMS="stat -f %Lp" ;;