Merge pull request #248100 from yihuang/master-1

fix rocksdb rpath on macos
This commit is contained in:
Robert Scott 2023-08-10 23:26:03 +01:00 committed by GitHub
commit 1ae7d9030b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -77,7 +77,7 @@ stdenv.mkDerivation rec {
mkdir -p $tools/bin mkdir -p $tools/bin
cp tools/{ldb,sst_dump}${stdenv.hostPlatform.extensions.executable} $tools/bin/ cp tools/{ldb,sst_dump}${stdenv.hostPlatform.extensions.executable} $tools/bin/
'' + lib.optionalString stdenv.isDarwin '' '' + lib.optionalString stdenv.isDarwin ''
ls -1 $tools/bin/* | xargs -I{} install_name_tool -change "@rpath/librocksdb.7.dylib" $out/lib/librocksdb.dylib {} ls -1 $tools/bin/* | xargs -I{} install_name_tool -change "@rpath/librocksdb.${lib.versions.major version}.dylib" $out/lib/librocksdb.dylib {}
'' + lib.optionalString (stdenv.isLinux && enableShared) '' '' + lib.optionalString (stdenv.isLinux && enableShared) ''
ls -1 $tools/bin/* | xargs -I{} patchelf --set-rpath $out/lib:${stdenv.cc.cc.lib}/lib {} ls -1 $tools/bin/* | xargs -I{} patchelf --set-rpath $out/lib:${stdenv.cc.cc.lib}/lib {}
''; '';