2021-01-18 09:29:56 +00:00
|
|
|
{ symlinkJoin, R, makeWrapper, recommendedPackages, packages }:
|
|
|
|
symlinkJoin {
|
|
|
|
name = R.name + "-wrapper";
|
2018-12-05 17:40:06 +00:00
|
|
|
preferLocalBuild = true;
|
|
|
|
allowSubstitutes = false;
|
2014-05-04 14:20:51 +01:00
|
|
|
|
2018-12-05 17:40:06 +00:00
|
|
|
buildInputs = [R] ++ recommendedPackages ++ packages;
|
2021-01-18 09:29:56 +00:00
|
|
|
paths = [ R ];
|
2014-05-04 14:20:51 +01:00
|
|
|
|
2018-12-05 17:40:06 +00:00
|
|
|
nativeBuildInputs = [makeWrapper];
|
2014-05-04 14:20:51 +01:00
|
|
|
|
2021-01-18 09:29:56 +00:00
|
|
|
postBuild = ''
|
|
|
|
cd ${R}/bin
|
|
|
|
for exe in *; do
|
|
|
|
rm "$out/bin/$exe"
|
|
|
|
|
|
|
|
makeWrapper "${R}/bin/$exe" "$out/bin/$exe" \
|
|
|
|
--prefix "R_LIBS_SITE" ":" "$R_LIBS_SITE"
|
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
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; };
|
2021-01-18 09:29:56 +00:00
|
|
|
|
|
|
|
meta = R.meta // {
|
|
|
|
# To prevent builds on hydra
|
|
|
|
hydraPlatforms = [];
|
|
|
|
# prefer wrapper over the package
|
|
|
|
priority = (R.meta.priority or 0) - 1;
|
|
|
|
};
|
2014-05-04 14:20:51 +01:00
|
|
|
}
|