From 7f76daacdb0190ce91c95111cc3eba49cea41fd7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20=C4=8Cun=C3=A1t?= Date: Fri, 29 May 2020 15:29:20 +0200 Subject: [PATCH] zstd: get rid of static libs if enableShared --- pkgs/tools/compression/zstd/default.nix | 3 +++ 1 file changed, 3 insertions(+) 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" ];