From e26f35b8cedbf072ef5003c8b3a9d9e2cda487ec Mon Sep 17 00:00:00 2001 From: Justin Bedo Date: Tue, 7 Sep 2021 14:34:15 +1000 Subject: [PATCH] rPackages.h2o: disable JAR fetching while in nix build --- pkgs/development/r-modules/default.nix | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/pkgs/development/r-modules/default.nix b/pkgs/development/r-modules/default.nix index d1309024613e..6bd4ada845fd 100644 --- a/pkgs/development/r-modules/default.nix +++ b/pkgs/development/r-modules/default.nix @@ -1065,6 +1065,18 @@ let }) ]; }); + h2o = old.h2o.overrideDerivation (attrs: { + preConfigure = '' + # prevent download of jar file during install and postpone to first use + sed -i '/downloadJar()/d' R/zzz.R + + # during runtime the package directory is not writable as it's in the + # nix store, so store the jar in the user's cache directory instead + substituteInPlace R/connection.R --replace \ + 'dest_file <- file.path(dest_folder, "h2o.jar")' \ + 'dest_file <- file.path("~/.cache/", "h2o.jar")' + ''; + }); }; in self