zstd: get rid of static libs if enableShared

This commit is contained in:
Vladimír Čunát 2020-05-29 15:29:20 +02:00
parent 414da94fed
commit 7f76daacdb
No known key found for this signature in database
GPG Key ID: E747DF1F9575A3AA

View File

@ -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" ];