1{stdenv, lib, fetchFromGitHub, fetchpatch, cmake, zlib, libxml2, eigen, python3, cairo, pcre, pkg-config }:
2
3stdenv.mkDerivation rec {
4 pname = "openbabel";
5 version = "2.4.1";
6
7 src = fetchFromGitHub {
8 owner = "openbabel";
9 repo = "openbabel";
10 rev = "openbabel-${lib.replaceStrings ["."] ["-"] version}";
11 sha256 = "sha256-+pXsWMzex7rB1mm6dnTHzAcyw9jImgx1OZuLeCvbeJ0=";
12 };
13
14 patches = [
15 # ARM / AArch64 fixes.
16 (fetchpatch {
17 url = "https://github.com/openbabel/openbabel/commit/ee11c98a655296550710db1207b294f00e168216.patch";
18 sha256 = "0wjqjrkr4pfirzzicdvlyr591vppydk572ix28jd2sagnfnf566g";
19 })
20 ];
21
22 postPatch = ''
23 sed '1i#include <ctime>' -i include/openbabel/obutil.h # gcc12
24 '';
25
26 buildInputs = [ zlib libxml2 eigen python3 cairo pcre ];
27
28 nativeBuildInputs = [ cmake pkg-config ];
29
30 meta = with lib; {
31 description = "A toolbox designed to speak the many languages of chemical data";
32 homepage = "http://openbabel.org";
33 platforms = platforms.all;
34 maintainers = with maintainers; [ danielbarter ];
35 license = licenses.gpl2Plus;
36 };
37}