2023-03-05 14:42:32 +01:00
|
|
|
{ lib
|
|
|
|
, runCommand
|
|
|
|
, R
|
|
|
|
, radian
|
|
|
|
, makeWrapper
|
|
|
|
, recommendedPackages
|
|
|
|
, packages
|
|
|
|
, wrapR ? false
|
|
|
|
}:
|
|
|
|
|
|
|
|
runCommand (radian.name + "-wrapper") {
|
|
|
|
preferLocalBuild = true;
|
|
|
|
allowSubstitutes = false;
|
|
|
|
|
2023-04-16 12:35:06 +02:00
|
|
|
buildInputs = [ R radian ] ++ recommendedPackages ++ packages;
|
2023-03-05 14:42:32 +01:00
|
|
|
|
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
|
|
|
|
passthru = { inherit recommendedPackages; };
|
|
|
|
|
|
|
|
meta = radian.meta // {
|
|
|
|
# To prevent builds on hydra
|
|
|
|
hydraPlatforms = [ ];
|
|
|
|
# prefer wrapper over the package
|
|
|
|
priority = (radian.meta.priority or 0) - 1;
|
|
|
|
};
|
|
|
|
} (''
|
|
|
|
makeWrapper "${radian}/bin/radian" "$out/bin/radian" \
|
2023-08-21 18:00:54 +02:00
|
|
|
--prefix "R_LIBS_SITE" ":" "$R_LIBS_SITE"
|
2023-03-05 14:42:32 +01:00
|
|
|
'' + lib.optionalString wrapR ''
|
|
|
|
cd ${R}/bin
|
|
|
|
for exe in *; do
|
|
|
|
makeWrapper "${R}/bin/$exe" "$out/bin/$exe" \
|
|
|
|
--prefix "R_LIBS_SITE" ":" "$R_LIBS_SITE"
|
|
|
|
done
|
|
|
|
'')
|