2014-05-04 20:12:34 +01:00
|
|
|
{ stdenv, R, makeWrapper, recommendedPackages, packages }:
|
2014-05-04 14:20:51 +01:00
|
|
|
|
2017-05-01 13:59:43 +01:00
|
|
|
stdenv.mkDerivation {
|
2014-05-04 14:20:51 +01:00
|
|
|
name = R.name + "-wrapper";
|
|
|
|
|
2014-05-04 20:12:34 +01:00
|
|
|
buildInputs = [makeWrapper R] ++ recommendedPackages ++ packages;
|
2014-05-04 14:20:51 +01:00
|
|
|
|
2018-11-27 17:24:37 +00:00
|
|
|
# Make the list of recommended R packages accessible to other packages such as rpy2
|
|
|
|
passthru.recommendedPackages = recommendedPackages;
|
|
|
|
|
2014-05-04 14:20:51 +01:00
|
|
|
unpackPhase = ":";
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/bin
|
|
|
|
cd ${R}/bin
|
|
|
|
for exe in *; do
|
|
|
|
makeWrapper ${R}/bin/$exe $out/bin/$exe \
|
|
|
|
--prefix "R_LIBS_SITE" ":" "$R_LIBS_SITE"
|
|
|
|
done
|
|
|
|
'';
|
2016-08-02 17:06:29 +01:00
|
|
|
|
|
|
|
meta = {
|
|
|
|
platforms = stdenv.lib.platforms.unix;
|
|
|
|
};
|
2014-05-04 14:20:51 +01:00
|
|
|
}
|