about summary refs log tree commit diff
path: root/pkgs/development/r-modules
diff options
context:
space:
mode:
authorSandro <sandro.jaeckel@gmail.com>2023-03-10 23:11:26 +0100
committerGitHub <noreply@github.com>2023-03-10 23:11:26 +0100
commit46e5d1e23128c44bf5d4dabef82f496797458bc1 (patch)
tree56cb9d7a00b3479fbed1a99aabe4cccb0a1b30bd /pkgs/development/r-modules
parent2f357f268afac07d6cba6b9969f2064d9b8c1f56 (diff)
parente730867dc051f9f9f6bd0b641838a24b74cad4c8 (diff)
Merge pull request #217517 from savyajha/radian
Diffstat (limited to 'pkgs/development/r-modules')
-rw-r--r--pkgs/development/r-modules/wrapper-radian.nix37
1 files changed, 37 insertions, 0 deletions
diff --git a/pkgs/development/r-modules/wrapper-radian.nix b/pkgs/development/r-modules/wrapper-radian.nix
new file mode 100644
index 0000000000000..a0a23222b5232
--- /dev/null
+++ b/pkgs/development/r-modules/wrapper-radian.nix
@@ -0,0 +1,37 @@
+{ lib
+, runCommand
+, R
+, radian
+, makeWrapper
+, recommendedPackages
+, packages
+, wrapR ? false
+}:
+
+runCommand (radian.name + "-wrapper") {
+  preferLocalBuild = true;
+  allowSubstitutes = false;
+
+  buildInputs = [ radian ] ++ recommendedPackages ++ packages
+    ++ lib.optional wrapR R;
+
+  nativeBuildInputs = [ makeWrapper ];
+
+  passthru = { inherit recommendedPackages; };
+
+  meta = radian.meta // {
+    # To prevent builds on hydra
+    hydraPlatforms = [ ];
+    # prefer wrapper over the package
+    priority = (radian.meta.priority or 0) - 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
+'')