Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions pkgs/tools/compression/zstd/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 ]
Expand All @@ -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) ''
Expand Down Expand Up @@ -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 = ''
Expand Down
9 changes: 8 additions & 1 deletion pkgs/tools/compression/zstd/playtests-darwin.patch
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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" ;;
Expand Down