From 56c2b7cb9a97f2ac86685c19488d32d91e5105cf Mon Sep 17 00:00:00 2001 From: Dmitry Kalinkin Date: Thu, 27 Feb 2020 12:50:23 -0500 Subject: [PATCH] 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. --- pkgs/development/libraries/arrow-cpp/default.nix | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/pkgs/development/libraries/arrow-cpp/default.nix b/pkgs/development/libraries/arrow-cpp/default.nix index e152848a70f0..50de0c88a5be 100644 --- a/pkgs/development/libraries/arrow-cpp/default.nix +++ b/pkgs/development/libraries/arrow-cpp/default.nix @@ -101,18 +101,17 @@ in stdenv.mkDerivation rec { "-DARROW_PROTOBUF_USE_SHARED=OFF" "-DARROW_TEST_LINKAGE=static" "-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"; doInstallCheck = true; PARQUET_TEST_DATA = if doInstallCheck then "${parquet-testing}/data" else null; installCheckInputs = [ perl which ]; - installCheckPhase = (lib.optionalString stdenv.isDarwin '' - for f in release/*test{,s}; do - install_name_tool -add_rpath "$out"/lib "$f" - done - '') - + (let + installCheckPhase = + let excludedTests = lib.optionals stdenv.isDarwin [ # 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 @@ -122,7 +121,7 @@ in stdenv.mkDerivation rec { in '' ctest -L unittest -V \ --exclude-regex '^(${builtins.concatStringsSep "|" excludedTests})$' - ''); + ''; meta = { description = "A cross-language development platform for in-memory data";