R: don't install the "recommended packages"

These packages come with R, but if we install them as part of this build, then
we cannot update them without re-building R as well. Instead, we add those
packages to the R environment through the r-wrapper. This means that
recommended packages can be updated in cran-packgaes.nix, and those updates
have an effect on the installation without re-building R itself.
This commit is contained in:
Peter Simons 2014-05-04 21:12:34 +02:00
parent a329900977
commit a9258080b1
3 changed files with 11 additions and 3 deletions

View File

@ -2,6 +2,7 @@
, libjpeg, libpng, libtiff, ncurses, pango, pcre, perl, readline, tcl
, texLive, tk, xz, zlib, less, texinfo, graphviz, icu, pkgconfig, bison
, imake, which, jdk, atlas
, withRecommendedPackages ? true
}:
stdenv.mkDerivation rec {
@ -23,6 +24,7 @@ stdenv.mkDerivation rec {
preConfigure = ''
configureFlagsArray=(
--disable-lto
--with${stdenv.lib.optionalString (!withRecommendedPackages) "out"}-recommended-packages
--with-blas="-L${atlas}/lib -lf77blas -latlas"
--with-lapack="-L${liblapack}/lib -llapack"
--with-readline

View File

@ -1,9 +1,9 @@
{ stdenv, R, packages, makeWrapper }:
{ stdenv, R, makeWrapper, recommendedPackages, packages }:
stdenv.mkDerivation {
name = R.name + "-wrapper";
buildInputs = [makeWrapper R] ++ packages;
buildInputs = [makeWrapper R] ++ recommendedPackages ++ packages;
unpackPhase = ":";

View File

@ -6431,9 +6431,15 @@ let
R = callPackage ../applications/science/math/R {
inherit (xlibs) libX11 libXt;
texLive = texLiveAggregationFun { paths = [ texLive texLiveExtra ]; };
withRecommendedPackages = false;
};
rWrapper = callPackage ../development/r-modules/generic/wrapper.nix {
rWrapper = callPackage ../development/r-modules/wrapper {
# Those packages are usually installed as part of the R build.
recommendedPackages = with rPackages; [ MASS lattice Matrix nlme
survival boot cluster codetools foreign KernSmooth rpart class
nnet spatial mgcv ];
# Override this attribute to register additional libraries.
packages = [];
};