From a225a650bf8659ee30c535d8160f3f5288284837 Mon Sep 17 00:00:00 2001 From: Asko Soukka Date: Mon, 29 Jun 2015 03:42:31 +0300 Subject: R: fix Darwin build Merged manually from https://github.com/NixOS/nixpkgs/pull/10623. --- pkgs/applications/science/math/R/default.nix | 30 ++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) (limited to 'pkgs/applications/science/math') 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; -- cgit 1.4.1