zstd: fix cross-compilation on darwin

This commit is contained in:
Tim Cuthbertson 2023-01-19 15:03:50 +11:00
parent 2d38b664b4
commit 7584d9fbf8

View file

@ -77,11 +77,13 @@ stdenv.mkDerivation rec {
substituteInPlace ../programs/zstdless \
--replace "zstdcat" "$bin/bin/zstdcat"
'' + lib.optionalString buildContrib ''
cp contrib/pzstd/pzstd $bin/bin/pzstd
'' + lib.optionalString stdenv.isDarwin ''
install_name_tool -change @rpath/libzstd.1.dylib $out/lib/libzstd.1.dylib $bin/bin/pzstd
'';
'' + lib.optionalString buildContrib (
''
cp contrib/pzstd/pzstd $bin/bin/pzstd
'' + lib.optionalString stdenv.isDarwin ''
install_name_tool -change @rpath/libzstd.1.dylib $out/lib/libzstd.1.dylib $bin/bin/pzstd
''
);
outputs = [ "bin" "dev" ]
++ lib.optional stdenv.hostPlatform.isUnix "man"