Commit e7c6fb0f authored by Savyasachee Jha's avatar Savyasachee Jha
Browse files

radianWrapper: Explicitly set R_HOME and always have R in buildInputs

Before this commit, `wrapR = false` (the default) would lead to
situations where the `RHOME` variable would not be found. Adding `--set
R_HOME ${R}/lib/R` so that the wrapper explicitly exports `R_HOME` fixes
this issue. In addition, R is also made part of `buildInputs` by default
so that package loading works correctly.
parent 580693af
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -12,8 +12,7 @@ runCommand (radian.name + "-wrapper") {
  preferLocalBuild = true;
  allowSubstitutes = false;

  buildInputs = [ radian ] ++ recommendedPackages ++ packages
    ++ lib.optional wrapR R;
  buildInputs = [ R radian ] ++ recommendedPackages ++ packages;

  nativeBuildInputs = [ makeWrapper ];

@@ -27,7 +26,8 @@ runCommand (radian.name + "-wrapper") {
  };
} (''
  makeWrapper "${radian}/bin/radian" "$out/bin/radian" \
    --prefix "R_LIBS_SITE" ":" "$R_LIBS_SITE"
    --prefix "R_LIBS_SITE" ":" "$R_LIBS_SITE" \
    --set "R_HOME" "${R}/lib/R"
'' + lib.optionalString wrapR ''
  cd ${R}/bin
  for exe in *; do