diff --git a/pkgs/development/r-modules/default.nix b/pkgs/development/r-modules/default.nix index 78483cd61b7e..cfe8af1583b3 100644 --- a/pkgs/development/r-modules/default.nix +++ b/pkgs/development/r-modules/default.nix @@ -2523,7 +2523,7 @@ let Rhtslib = old.Rhtslib.overrideAttrs (attrs: { preConfigure = '' - substituteInPlace R/zzz.R --replace "-lcurl" "-L${pkgs.curl.out}/lib -lcurl" + substituteInPlace R/zzz.R --replace-fail "-lcurl" "-L${pkgs.curl.out}/lib -lcurl" ''; }); @@ -2534,7 +2534,7 @@ let # 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 \ + substituteInPlace R/connection.R --replace-fail \ 'dest_file <- file.path(dest_folder, "h2o.jar")' \ 'dest_file <- file.path("~/.cache/", "h2o.jar")' ''; @@ -2572,18 +2572,17 @@ let sparklyr = old.sparklyr.overrideAttrs (attrs: { # Pyspark's spark is full featured and better maintained than pkgs.spark preConfigure = '' - substituteInPlace R/zzz.R \ - --replace ".onLoad <- function(...) {" \ - ".onLoad <- function(...) { - Sys.setenv(\"SPARK_HOME\" = Sys.getenv(\"SPARK_HOME\", unset = \"${pkgs.python3Packages.pyspark}/${pkgs.python3Packages.python.sitePackages}/pyspark\")) - Sys.setenv(\"JAVA_HOME\" = Sys.getenv(\"JAVA_HOME\", unset = \"${pkgs.jdk}\"))" - ''; - }); + if grep "onLoad" R/zzz.R; then + echo "onLoad is already present, patch needs to be updated!" + exit 1 + fi - proj4 = old.proj4.overrideAttrs (attrs: { - preConfigure = '' - substituteInPlace configure \ - --replace "-lsqlite3" "-L${lib.makeLibraryPath [ pkgs.sqlite ]} -lsqlite3" + cat >> R/zzz.R <