1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-12-22 06:05:13 +00:00
nixpkgs/pkgs/development/r-modules/wrapper.nix
Joachim Fasting d2b467a2de
rWrapper: use runCommand, local build only
This seems more appropriate for a wrapper generator.
2018-12-05 20:59:35 +01:00

22 lines
533 B
Nix

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