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:
@@ -2,6 +2,7 @@
|
|||||||
, libjpeg, libpng, libtiff, ncurses, pango, pcre, perl, readline, tcl
|
, libjpeg, libpng, libtiff, ncurses, pango, pcre, perl, readline, tcl
|
||||||
, texLive, tk, xz, zlib, less, texinfo, graphviz, icu, pkgconfig, bison
|
, texLive, tk, xz, zlib, less, texinfo, graphviz, icu, pkgconfig, bison
|
||||||
, imake, which, jdk, atlas
|
, imake, which, jdk, atlas
|
||||||
|
, withRecommendedPackages ? true
|
||||||
}:
|
}:
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
@@ -23,6 +24,7 @@ stdenv.mkDerivation rec {
|
|||||||
preConfigure = ''
|
preConfigure = ''
|
||||||
configureFlagsArray=(
|
configureFlagsArray=(
|
||||||
--disable-lto
|
--disable-lto
|
||||||
|
--with${stdenv.lib.optionalString (!withRecommendedPackages) "out"}-recommended-packages
|
||||||
--with-blas="-L${atlas}/lib -lf77blas -latlas"
|
--with-blas="-L${atlas}/lib -lf77blas -latlas"
|
||||||
--with-lapack="-L${liblapack}/lib -llapack"
|
--with-lapack="-L${liblapack}/lib -llapack"
|
||||||
--with-readline
|
--with-readline
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
{ stdenv, R, packages, makeWrapper }:
|
{ stdenv, R, makeWrapper, recommendedPackages, packages }:
|
||||||
|
|
||||||
stdenv.mkDerivation {
|
stdenv.mkDerivation {
|
||||||
name = R.name + "-wrapper";
|
name = R.name + "-wrapper";
|
||||||
|
|
||||||
buildInputs = [makeWrapper R] ++ packages;
|
buildInputs = [makeWrapper R] ++ recommendedPackages ++ packages;
|
||||||
|
|
||||||
unpackPhase = ":";
|
unpackPhase = ":";
|
||||||
|
|
||||||
|
|||||||
@@ -6431,9 +6431,15 @@ let
|
|||||||
R = callPackage ../applications/science/math/R {
|
R = callPackage ../applications/science/math/R {
|
||||||
inherit (xlibs) libX11 libXt;
|
inherit (xlibs) libX11 libXt;
|
||||||
texLive = texLiveAggregationFun { paths = [ texLive texLiveExtra ]; };
|
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 = [];
|
packages = [];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user