summary refs log tree commit diff
path: root/pkgs/tools/compression
diff options
context:
space:
mode:
authorVladimír Čunát <v@cunat.cz>2020-05-29 15:29:20 +0200
committerVladimír Čunát <v@cunat.cz>2020-05-29 15:29:20 +0200
commit7f76daacdb0190ce91c95111cc3eba49cea41fd7 (patch)
tree471f6e3245a6a8daa0321aaa0df448e4144dfee6 /pkgs/tools/compression
parent414da94fedd80cac992df835dfbd4a1efd388395 (diff)
downloadnixpkgs-7f76daacdb0190ce91c95111cc3eba49cea41fd7.tar
nixpkgs-7f76daacdb0190ce91c95111cc3eba49cea41fd7.tar.gz
nixpkgs-7f76daacdb0190ce91c95111cc3eba49cea41fd7.tar.bz2
nixpkgs-7f76daacdb0190ce91c95111cc3eba49cea41fd7.tar.lz
nixpkgs-7f76daacdb0190ce91c95111cc3eba49cea41fd7.tar.xz
nixpkgs-7f76daacdb0190ce91c95111cc3eba49cea41fd7.tar.zst
nixpkgs-7f76daacdb0190ce91c95111cc3eba49cea41fd7.zip
zstd: get rid of static libs if enableShared
Diffstat (limited to 'pkgs/tools/compression')
-rw-r--r--pkgs/tools/compression/zstd/default.nix3
1 files changed, 3 insertions, 0 deletions
diff --git a/pkgs/tools/compression/zstd/default.nix b/pkgs/tools/compression/zstd/default.nix
index a7ae4d0b3ba..ee006a55ea3 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"
   ];
@@ -54,6 +55,8 @@ stdenv.mkDerivation rec {
     substituteInPlace ../programs/zstdless \
       --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" ];