summary refs log tree commit diff
path: root/pkgs/development/r-modules/wrapper.nix
blob: 76e819501a57c7b6b5a606ba5d0c65c4c58d58b1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
{ 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
''