From 9543eeea3a582bc46e6eb59c98fba3ca75564eb6 Mon Sep 17 00:00:00 2001 From: Bruno Rodrigues Date: Thu, 14 Nov 2024 18:50:52 +0000 Subject: [PATCH] rPackages.rJava: fixed build on Darwin --- pkgs/development/r-modules/default.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkgs/development/r-modules/default.nix b/pkgs/development/r-modules/default.nix index 18c949e765d5..f59482f42b2a 100644 --- a/pkgs/development/r-modules/default.nix +++ b/pkgs/development/r-modules/default.nix @@ -1286,6 +1286,10 @@ let preConfigure = '' export JAVA_CPPFLAGS=-I${pkgs.jdk}/include/ export JAVA_HOME=${pkgs.jdk} + substituteInPlace R/zzz.R.in \ + --replace-fail ".onLoad <- function(libname, pkgname) {" \ + ".onLoad <- function(libname, pkgname) { + Sys.setenv(\"JAVA_HOME\" = Sys.getenv(\"JAVA_HOME\", unset = \"${pkgs.jdk}\"))" ''; });