2018-12-05 18:40:06 +01:00
|
|
|
{ runCommand, R, makeWrapper, recommendedPackages, packages }:
|
2014-05-04 15:20:51 +02:00
|
|
|
|
2018-12-05 18:40:06 +01:00
|
|
|
runCommand (R.name + "-wrapper") {
|
|
|
|
preferLocalBuild = true;
|
|
|
|
allowSubstitutes = false;
|
2014-05-04 15:20:51 +02:00
|
|
|
|
2018-12-05 18:40:06 +01:00
|
|
|
buildInputs = [R] ++ recommendedPackages ++ packages;
|
2014-05-04 15:20:51 +02:00
|
|
|
|
2018-12-05 18:40:06 +01:00
|
|
|
nativeBuildInputs = [makeWrapper];
|
2014-05-04 15:20:51 +02:00
|
|
|
|
2018-12-05 18:40:06 +01:00
|
|
|
# Make the list of recommended R packages accessible to other packages such as rpy2
|
|
|
|
passthru = { inherit recommendedPackages; };
|
2014-05-04 15:20:51 +02:00
|
|
|
}
|
2018-12-05 18:40:06 +01:00
|
|
|
''
|
|
|
|
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
|
|
|
|
''
|