summary refs log tree commit diff
path: root/pkgs/applications/science
diff options
context:
space:
mode:
authorDaiderd Jordan <daiderd@gmail.com>2018-01-24 00:22:40 +0100
committerDaiderd Jordan <daiderd@gmail.com>2018-01-24 00:23:16 +0100
commit55698517457be17cfe921a4d0320139ec483d9a2 (patch)
tree13e6ec52b2c66af0ea6f5efe7026a56dc96014b2 /pkgs/applications/science
parentd9604c861a29e2632f48e2e11678fe47d0ff79ea (diff)
downloadnixpkgs-55698517457be17cfe921a4d0320139ec483d9a2.tar
nixpkgs-55698517457be17cfe921a4d0320139ec483d9a2.tar.gz
nixpkgs-55698517457be17cfe921a4d0320139ec483d9a2.tar.bz2
nixpkgs-55698517457be17cfe921a4d0320139ec483d9a2.tar.lz
nixpkgs-55698517457be17cfe921a4d0320139ec483d9a2.tar.xz
nixpkgs-55698517457be17cfe921a4d0320139ec483d9a2.tar.zst
nixpkgs-55698517457be17cfe921a4d0320139ec483d9a2.zip
R: fix dylib install_name on darwin
Diffstat (limited to 'pkgs/applications/science')
-rw-r--r--pkgs/applications/science/math/R/default.nix12
1 files changed, 7 insertions, 5 deletions
diff --git a/pkgs/applications/science/math/R/default.nix b/pkgs/applications/science/math/R/default.nix
index d2188673fb7..725b3f342c3 100644
--- a/pkgs/applications/science/math/R/default.nix
+++ b/pkgs/applications/science/math/R/default.nix
@@ -19,10 +19,14 @@ stdenv.mkDerivation rec {
     pango pcre perl readline texLive xz zlib less texinfo graphviz icu
     pkgconfig bison imake which jdk openblas curl
   ] ++ stdenv.lib.optionals (!stdenv.isDarwin) [ tcl tk ]
-    ++ stdenv.lib.optionals stdenv.isDarwin [ Cocoa Foundation cf-private libobjc ];
+    ++ stdenv.lib.optionals stdenv.isDarwin [ Cocoa Foundation libobjc ];
 
   patches = [ ./no-usr-local-search-paths.patch ];
 
+  prePatch = stdenv.lib.optionalString stdenv.isDarwin ''
+    substituteInPlace configure --replace "-install_name libR.dylib" "-install_name $out/lib/R/lib/libR.dylib"
+  '';
+
   preConfigure = ''
     configureFlagsArray=(
       --disable-lto
@@ -40,8 +44,8 @@ stdenv.mkDerivation rec {
       --enable-R-shlib
       AR=$(type -p ar)
       AWK=$(type -p gawk)
-      CC=$(type -p gcc)
-      CXX=$(type -p g++)
+      CC=$(type -p cc)
+      CXX=$(type -p c++)
       FC="${gfortran}/bin/gfortran" F77="${gfortran}/bin/gfortran"
       JAVA_HOME="${jdk}"
       RANLIB=$(type -p ranlib)
@@ -50,8 +54,6 @@ stdenv.mkDerivation rec {
       --without-tcltk
       --without-aqua
       --disable-R-framework
-      CC="clang"
-      CXX="clang++"
       OBJC="clang"
   '' + ''
     )