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