Skip to content

Commit

Permalink
rPackages.ChemmineOB: fix compile error
Browse files Browse the repository at this point in the history
- Don't override openbabel
- fix pointer name in ChemmineOB src instead
  • Loading branch information
Kupac committed Oct 24, 2024
1 parent 0fdb289 commit acab8c7
Showing 1 changed file with 6 additions and 16 deletions.
22 changes: 6 additions & 16 deletions pkgs/development/r-modules/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -801,7 +801,7 @@ let
sphereTessellation = with pkgs; [ gmp.dev mpfr.dev ];
vapour = with pkgs; [ proj.dev gdal ];
MedianaDesigner = [ pkgs.zlib.dev ];
ChemmineOB = [ pkgs.eigen ];
ChemmineOB = with pkgs; [ eigen openbabel ];
DGP4LCF = [ pkgs.lapack pkgs.blas ];
};

Expand Down Expand Up @@ -1582,29 +1582,19 @@ 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: {
ChemmineOB = old.ChemmineOB.overrideAttrs (attrs: {
# pkg-config knows openbabel-3 without the .0
# Eigen3 is also looked for in the wrong location
# pointer was changed in newer version of openbabel:
# https://github.com/openbabel/openbabel/commit/305a6fd3183540e4a8ae1d79d10bf1860e6aa373
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"
substituteInPlace src/ChemmineOB.cpp \
--replace-fail "obsharedptr<" "std::shared_ptr<"
'';
buildInputs = attrs.buildInputs ++ [openbabel3];
});

ps = old.ps.overrideAttrs (attrs: {
Expand Down

0 comments on commit acab8c7

Please sign in to comment.