aboutsummaryrefslogtreecommitdiff
path: root/pkgs/tools/compression
diff options
context:
space:
mode:
authorVladimír Čunát <v@cunat.cz>2020-05-29 15:31:19 +0200
committerVladimír Čunát <v@cunat.cz>2020-05-29 15:37:55 +0200
commitafa9962538b12237f5a4604017fe9c0914404800 (patch)
tree314d63f212523aee8732c82aa331e8f9a03c785e /pkgs/tools/compression
parent3a4fec82326f53fd14721aa3c4fd8560752f8982 (diff)
parent7f76daacdb0190ce91c95111cc3eba49cea41fd7 (diff)
Merge #78910: libarchive: link to zstd (into staging)
Also split outputs and don't provide static lib by default.
Diffstat (limited to 'pkgs/tools/compression')
-rw-r--r--pkgs/tools/compression/zstd/default.nix9
1 files changed, 7 insertions, 2 deletions
diff --git a/pkgs/tools/compression/zstd/default.nix b/pkgs/tools/compression/zstd/default.nix
index 2f89331f92c6..f919fb92ed1d 100644
--- a/pkgs/tools/compression/zstd/default.nix
+++ b/pkgs/tools/compression/zstd/default.nix
@@ -30,6 +30,7 @@ stdenv.mkDerivation rec {
cmakeFlags = [
"-DZSTD_BUILD_SHARED:BOOL=${if enableShared then "ON" else "OFF"}"
+ # They require STATIC for bin/zstd and tests.
"-DZSTD_LEGACY_SUPPORT:BOOL=${if legacySupport then "ON" else "OFF"}"
"-DZSTD_BUILD_TESTS:BOOL=ON"
];
@@ -50,11 +51,15 @@ stdenv.mkDerivation rec {
preInstall = ''
substituteInPlace ../programs/zstdgrep \
--replace ":-grep" ":-${gnugrep}/bin/grep" \
- --replace ":-zstdcat" ":-$out/bin/zstdcat"
+ --replace ":-zstdcat" ":-$bin/bin/zstdcat"
substituteInPlace ../programs/zstdless \
- --replace "zstdcat" "$out/bin/zstdcat"
+ --replace "zstdcat" "$bin/bin/zstdcat"
'';
+ # Don't duplicate the library code in runtime closures.
+ postInstall = stdenv.lib.optionalString enableShared ''rm "$out"/lib/libzstd.a'';
+
+ outputs = [ "bin" "dev" "man" "out" ];
meta = with stdenv.lib; {
description = "Zstandard real-time compression algorithm";