arrow-cpp: fix RPATH on darwin
Instead of patching test binaries with install_name_tool just set CMAKE_SKIP_BUILD_RPATH to OFF let cmake compile them with RPATH set correctly. Add CMAKE_INSTALL_RPATH to set correct RPATH for the installed executables for parquet tools. We could set it to an absolute path using "-DCMAKE_INSTALL_RPATH=${placeholder "out"}", but instead we use @loader_path to provide a relocable solution.
This commit is contained in:
parent
4b65f859c9
commit
56c2b7cb9a
@ -101,18 +101,17 @@ in stdenv.mkDerivation rec {
|
|||||||
"-DARROW_PROTOBUF_USE_SHARED=OFF"
|
"-DARROW_PROTOBUF_USE_SHARED=OFF"
|
||||||
"-DARROW_TEST_LINKAGE=static"
|
"-DARROW_TEST_LINKAGE=static"
|
||||||
"-DOPENSSL_USE_STATIC_LIBS=ON"
|
"-DOPENSSL_USE_STATIC_LIBS=ON"
|
||||||
|
] ++ lib.optionals stdenv.isDarwin [
|
||||||
|
"-DCMAKE_SKIP_BUILD_RPATH=OFF" # needed for tests
|
||||||
|
"-DCMAKE_INSTALL_RPATH=@loader_path/../lib" # needed for tools executables
|
||||||
] ++ lib.optional (!stdenv.isx86_64) "-DARROW_USE_SIMD=OFF";
|
] ++ lib.optional (!stdenv.isx86_64) "-DARROW_USE_SIMD=OFF";
|
||||||
|
|
||||||
doInstallCheck = true;
|
doInstallCheck = true;
|
||||||
PARQUET_TEST_DATA =
|
PARQUET_TEST_DATA =
|
||||||
if doInstallCheck then "${parquet-testing}/data" else null;
|
if doInstallCheck then "${parquet-testing}/data" else null;
|
||||||
installCheckInputs = [ perl which ];
|
installCheckInputs = [ perl which ];
|
||||||
installCheckPhase = (lib.optionalString stdenv.isDarwin ''
|
installCheckPhase =
|
||||||
for f in release/*test{,s}; do
|
let
|
||||||
install_name_tool -add_rpath "$out"/lib "$f"
|
|
||||||
done
|
|
||||||
'')
|
|
||||||
+ (let
|
|
||||||
excludedTests = lib.optionals stdenv.isDarwin [
|
excludedTests = lib.optionals stdenv.isDarwin [
|
||||||
# Some plasma tests need to be patched to use a shorter AF_UNIX socket
|
# Some plasma tests need to be patched to use a shorter AF_UNIX socket
|
||||||
# path on Darwin. See https://github.com/NixOS/nix/pull/1085
|
# path on Darwin. See https://github.com/NixOS/nix/pull/1085
|
||||||
@ -122,7 +121,7 @@ in stdenv.mkDerivation rec {
|
|||||||
in ''
|
in ''
|
||||||
ctest -L unittest -V \
|
ctest -L unittest -V \
|
||||||
--exclude-regex '^(${builtins.concatStringsSep "|" excludedTests})$'
|
--exclude-regex '^(${builtins.concatStringsSep "|" excludedTests})$'
|
||||||
'');
|
'';
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
description = "A cross-language development platform for in-memory data";
|
description = "A cross-language development platform for in-memory data";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user