zstd: Add pzstd to compiled binaries

This commit is contained in:
Marc Seeger 2021-06-30 15:14:57 -07:00 committed by Jonathan Ringer
parent a7cb61bc54
commit 9889bdb6fb

View File

@ -40,6 +40,7 @@ stdenv.mkDerivation rec {
(name: value: "-DZSTD_${name}:BOOL=${if value then "ON" else "OFF"}") { (name: value: "-DZSTD_${name}:BOOL=${if value then "ON" else "OFF"}") {
BUILD_SHARED = !static; BUILD_SHARED = !static;
BUILD_STATIC = static; BUILD_STATIC = static;
BUILD_CONTRIB = true;
PROGRAMS_LINK_SHARED = !static; PROGRAMS_LINK_SHARED = !static;
LEGACY_SUPPORT = legacySupport; LEGACY_SUPPORT = legacySupport;
BUILD_TESTS = doCheck; BUILD_TESTS = doCheck;
@ -62,12 +63,16 @@ stdenv.mkDerivation rec {
''; '';
preInstall = '' preInstall = ''
mkdir -p $bin/bin
cp contrib/pzstd/pzstd $bin/bin/pzstd
substituteInPlace ../programs/zstdgrep \ substituteInPlace ../programs/zstdgrep \
--replace ":-grep" ":-${gnugrep}/bin/grep" \ --replace ":-grep" ":-${gnugrep}/bin/grep" \
--replace ":-zstdcat" ":-$bin/bin/zstdcat" --replace ":-zstdcat" ":-$bin/bin/zstdcat"
substituteInPlace ../programs/zstdless \ substituteInPlace ../programs/zstdless \
--replace "zstdcat" "$bin/bin/zstdcat" --replace "zstdcat" "$bin/bin/zstdcat"
'' + lib.optionalString stdenv.isDarwin ''
install_name_tool -change @rpath/libzstd.1.dylib $out/lib/libzstd.1.dylib $bin/bin/pzstd
''; '';
outputs = [ "bin" "dev" ] outputs = [ "bin" "dev" ]