summary refs log tree commit diff
path: root/pkgs/applications/science/math
diff options
context:
space:
mode:
authorAsko Soukka <asko.soukka@iki.fi>2015-06-29 03:42:31 +0300
committerPeter Simons <simons@cryp.to>2016-01-06 22:20:40 +0100
commita225a650bf8659ee30c535d8160f3f5288284837 (patch)
tree34ad92fcc02917588d62b667f331a463529362b7 /pkgs/applications/science/math
parent26f80d7a6fc0e3e8142bb1d09f81f755e51710b8 (diff)
downloadnixlib-a225a650bf8659ee30c535d8160f3f5288284837.tar
nixlib-a225a650bf8659ee30c535d8160f3f5288284837.tar.gz
nixlib-a225a650bf8659ee30c535d8160f3f5288284837.tar.bz2
nixlib-a225a650bf8659ee30c535d8160f3f5288284837.tar.lz
nixlib-a225a650bf8659ee30c535d8160f3f5288284837.tar.xz
nixlib-a225a650bf8659ee30c535d8160f3f5288284837.tar.zst
nixlib-a225a650bf8659ee30c535d8160f3f5288284837.zip
R: fix Darwin build
Merged manually from https://github.com/NixOS/nixpkgs/pull/10623.
Diffstat (limited to 'pkgs/applications/science/math')
-rw-r--r--pkgs/applications/science/math/R/default.nix30
1 files changed, 22 insertions, 8 deletions
diff --git a/pkgs/applications/science/math/R/default.nix b/pkgs/applications/science/math/R/default.nix
index 183a1f503753..edbf8a843a5a 100644
--- a/pkgs/applications/science/math/R/default.nix
+++ b/pkgs/applications/science/math/R/default.nix
@@ -1,7 +1,7 @@
-{ stdenv, fetchurl, bzip2, gfortran, libX11, libXmu, libXt
-, libjpeg, libpng, libtiff, ncurses, pango, pcre, perl, readline, tcl
-, texLive, tk, xz, zlib, less, texinfo, graphviz, icu, pkgconfig, bison
-, imake, which, jdk, openblas, curl
+{ stdenv, fetchurl, bzip2, gfortran, libX11, libXmu, libXt, libjpeg, libpng
+, libtiff, ncurses, pango, pcre, perl, readline, tcl, texLive, tk, xz, zlib
+, less, texinfo, graphviz, icu, pkgconfig, bison, imake, which, jdk, openblas
+, curl, Cocoa, Foundation, cf-private, libobjc, tzdata
 , withRecommendedPackages ? true
 }:
 
@@ -14,10 +14,11 @@ stdenv.mkDerivation rec {
   };
 
   buildInputs = [ bzip2 gfortran libX11 libXmu libXt
-    libXt libjpeg libpng libtiff ncurses pango pcre perl readline tcl
-    texLive tk xz zlib less texinfo graphviz icu pkgconfig bison imake
-    which jdk openblas curl
-  ];
+    libXt libjpeg libpng libtiff ncurses 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 ];
 
   patches = [ ./no-usr-local-search-paths.patch ];
 
@@ -48,10 +49,23 @@ stdenv.mkDerivation rec {
       LDFLAGS="-L${gfortran.cc}/lib"
       RANLIB=$(type -p ranlib)
       R_SHELL="${stdenv.shell}"
+  '' + stdenv.lib.optionalString stdenv.isDarwin ''
+      --without-tcltk
+      --without-aqua
+      --disable-R-framework
+      CC="clang"
+      CXX="clang++"
+      OBJC="clang"
+  '' + ''
     )
     echo "TCLLIBPATH=${tk}/lib" >>etc/Renviron.in
   '';
 
+  postConfigure = stdenv.lib.optionalString stdenv.isDarwin ''
+    sed -i 's|/usr/share/zoneinfo|${tzdata}/share/zoneinfo|g' src/library/base/R/datetime.R
+    sed -i 's|getenv("R_SHARE_DIR")|"${tzdata}/share"|g' src/extra/tzone/localtime.c
+  '';
+
   installTargets = [ "install" "install-info" "install-pdf" ];
 
   doCheck = true;