From acab8c7bedaa1773d2f7bf7b5705dfae9ff5a602 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A1szl=C3=B3=20Kupcsik?= Date: Thu, 24 Oct 2024 20:59:37 +0200 Subject: [PATCH] rPackages.ChemmineOB: fix compile error - Don't override openbabel - fix pointer name in ChemmineOB src instead --- pkgs/development/r-modules/default.nix | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/pkgs/development/r-modules/default.nix b/pkgs/development/r-modules/default.nix index d17cf9941491a..cec9098ae3662 100644 --- a/pkgs/development/r-modules/default.nix +++ b/pkgs/development/r-modules/default.nix @@ -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 ]; }; @@ -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: {