From 470a49066c264cd50f197b9817b7101817905205 Mon Sep 17 00:00:00 2001 From: Philipp Baumann Date: Sat, 6 Apr 2024 11:20:03 +0200 Subject: rPackages.arrow: match arrow-cpp source state and fix build for darwin --- pkgs/development/r-modules/default.nix | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/pkgs/development/r-modules/default.nix b/pkgs/development/r-modules/default.nix index 994b6349a616..082e6641cd4d 100644 --- a/pkgs/development/r-modules/default.nix +++ b/pkgs/development/r-modules/default.nix @@ -312,9 +312,9 @@ let packagesWithNativeBuildInputs = { adbcpostgresql = [ pkgs.postgresql ]; - arrow = [ pkgs.pkg-config pkgs.arrow-cpp ]; adimpro = [ pkgs.imagemagick ]; animation = [ pkgs.which ]; + arrow = with pkgs; [ pkg-config cmake ] ++ lib.optionals stdenv.isDarwin [ intltool ]; audio = [ pkgs.portaudio ]; BayesSAE = [ pkgs.gsl ]; BayesVarSel = [ pkgs.gsl ]; @@ -990,6 +990,27 @@ let ]; otherOverrides = old: new: { + # it can happen that the major version of arrow-cpp is ahead of the + # rPackages.arrow that would be built from CRAN sources; therefore, to avoid + # build failures and manual updates of the hash, we use the R source at + # the GitHub release state of libarrow (arrow-cpp) in Nixpkgs. This may + # not exactly represent the CRAN sources, but because patching of the + # CRAN R package is mostly done to meet special CRAN build requirements, + # this is a straightforward approach. Example where patching was necessary + # -> arrow 14.0.0.2 on CRAN; was lagging behind libarrow release: + # https://github.com/apache/arrow/issues/39698 ) + arrow = old.arrow.overrideAttrs (attrs: { + src = pkgs.arrow-cpp.src; + name = "r-arrow-${pkgs.arrow-cpp.version}"; + prePatch = "cd r"; + postPatch = '' + patchShebangs configure + ''; + buildInputs = attrs.buildInputs ++ [ + pkgs.arrow-cpp + ]; + }); + gifski = old.gifski.overrideAttrs (attrs: { cargoDeps = pkgs.rustPlatform.fetchCargoTarball { src = attrs.src; @@ -1399,12 +1420,6 @@ let ''; }); - arrow = old.arrow.overrideAttrs (attrs: { - preConfigure = '' - patchShebangs configure - ''; - }); - ROracle = old.ROracle.overrideAttrs (attrs: { configureFlags = [ "--with-oci-lib=${pkgs.oracle-instantclient.lib}/lib" -- cgit v1.2.3