summary refs log tree commit diff
path: root/pkgs/development/libraries/arrow-cpp
diff options
context:
space:
mode:
authorDmitry Kalinkin <dmitry.kalinkin@gmail.com>2020-02-27 12:50:23 -0500
committerDmitry Kalinkin <dmitry.kalinkin@gmail.com>2020-02-27 12:50:23 -0500
commit56c2b7cb9a97f2ac86685c19488d32d91e5105cf (patch)
tree2528c04a49fabea2059cac4d7b9c8d78c2d6baf4 /pkgs/development/libraries/arrow-cpp
parent4b65f859c945b699e1ba91c62b6eb464ec314892 (diff)
downloadnixpkgs-56c2b7cb9a97f2ac86685c19488d32d91e5105cf.tar
nixpkgs-56c2b7cb9a97f2ac86685c19488d32d91e5105cf.tar.gz
nixpkgs-56c2b7cb9a97f2ac86685c19488d32d91e5105cf.tar.bz2
nixpkgs-56c2b7cb9a97f2ac86685c19488d32d91e5105cf.tar.lz
nixpkgs-56c2b7cb9a97f2ac86685c19488d32d91e5105cf.tar.xz
nixpkgs-56c2b7cb9a97f2ac86685c19488d32d91e5105cf.tar.zst
nixpkgs-56c2b7cb9a97f2ac86685c19488d32d91e5105cf.zip
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.
Diffstat (limited to 'pkgs/development/libraries/arrow-cpp')
-rw-r--r--pkgs/development/libraries/arrow-cpp/default.nix13
1 files changed, 6 insertions, 7 deletions
diff --git a/pkgs/development/libraries/arrow-cpp/default.nix b/pkgs/development/libraries/arrow-cpp/default.nix
index e152848a70f..50de0c88a5b 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";