diff --git a/pkgs/development/r-modules/default.nix b/pkgs/development/r-modules/default.nix index f6223fecd56d..6038260a25f3 100644 --- a/pkgs/development/r-modules/default.nix +++ b/pkgs/development/r-modules/default.nix @@ -332,7 +332,7 @@ let Cairo = with pkgs; [ libtiff libjpeg cairo.dev xorg.libXt.dev fontconfig.lib ]; Cardinal = [ pkgs.which ]; chebpol = [ pkgs.fftw.dev ]; - ChemmineOB = with pkgs; [ openbabel pkg-config ]; + ChemmineOB = [ pkgs.pkg-config ]; curl = [ pkgs.curl.dev ]; CytoML = [ pkgs.libxml2.dev ]; data_table = with pkgs; [ pkg-config zlib.dev ] ++ lib.optional stdenv.isDarwin pkgs.llvmPackages.openmp; @@ -706,6 +706,7 @@ let ragg = with pkgs; [ freetype.dev libpng.dev libtiff.dev zlib.dev libjpeg.dev bzip2.dev ] ++ lib.optional stdenv.isDarwin lerc.dev; qqconf = [ pkgs.fftw.dev ]; vapour = with pkgs; [ proj.dev gdal ]; + ChemmineOB = [ pkgs.eigen ]; }; packagesRequiringX = [ @@ -1370,6 +1371,31 @@ let PKGCONFIG_LIBS = "-Wl,-rpath,${lib.getLib pkgs.openssl}/lib -L${lib.getLib pkgs.openssl}/lib -L${pkgs.cyrus_sasl.out}/lib -L${pkgs.zlib.out}/lib -lssl -lcrypto -lsasl2 -lz"; }); + ChemmineOB = let + # R package doesn't compile with the latest (unstable) version. + # Override from nixpkgs-23.11 + openbabel3 = pkgs.openbabel.overrideAttrs (attrs: { + version = "3.1.1"; + src = pkgs.fetchFromGitHub { + owner = "openbabel"; + repo = "openbabel"; + rev = "openbabel-${lib.replaceStrings ["."] ["-"] attrs.version}"; + sha256 = "sha256-wQpgdfCyBAoh4pmj9j7wPTlMtraJ62w/EShxi/olVMY="; + }; + }); + in + old.ChemmineOB.overrideAttrs (attrs: { + # pkg-config knows openbabel-3 without the .0 + # Eigen3 is also looked for in the wrong location + postPatch = '' + substituteInPlace configure \ + --replace-fail openbabel-3.0 openbabel-3 + substituteInPlace src/Makevars.in \ + --replace-fail "-I/usr/include/eigen3" "-I${pkgs.eigen}/include/eigen3" + ''; + buildInputs = attrs.buildInputs ++ [openbabel3]; + }); + ps = old.ps.overrideAttrs (attrs: { preConfigure = "patchShebangs configure"; });