mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-15 06:14:57 +01:00
36 lines
832 B
Nix
36 lines
832 B
Nix
{ lib
|
|
, runCommand
|
|
, R
|
|
, radian
|
|
, makeWrapper
|
|
, recommendedPackages
|
|
, packages
|
|
, wrapR ? false
|
|
}:
|
|
|
|
runCommand (radian.name + "-wrapper") {
|
|
preferLocalBuild = true;
|
|
allowSubstitutes = false;
|
|
|
|
buildInputs = [ R radian ] ++ recommendedPackages ++ packages;
|
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
passthru = { inherit recommendedPackages; };
|
|
|
|
meta = radian.meta // {
|
|
# To prevent builds on hydra
|
|
hydraPlatforms = [ ];
|
|
# prefer wrapper over the package
|
|
priority = (radian.meta.priority or lib.meta.defaultPriority) - 1;
|
|
};
|
|
} (''
|
|
makeWrapper "${radian}/bin/radian" "$out/bin/radian" \
|
|
--prefix "R_LIBS_SITE" ":" "$R_LIBS_SITE"
|
|
'' + 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
|
|
'')
|