depot/third_party/nixpkgs/pkgs/development/r-modules/wrapper.nix
Default email 8ac5e011d6 Project import generated by Copybara.
GitOrigin-RevId: 2c3273caa153ee8eb5786bc8141b85b859e7efd7
2020-04-24 19:36:52 -04:00

21 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
''