about summary refs log tree commit diff
path: root/pkgs/development/libraries/openbabel/2.nix
blob: 0cc752d993fb2629310988f19dea811605cab447 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
{stdenv, lib, fetchFromGitHub, fetchpatch, cmake, zlib, libxml2, eigen, python3, cairo, pcre, pkg-config }:

stdenv.mkDerivation rec {
  pname = "openbabel";
  version = "2.4.1";

  src = fetchFromGitHub {
    owner = "openbabel";
    repo = "openbabel";
    rev = "openbabel-${lib.replaceStrings ["."] ["-"] version}";
    sha256 = "sha256-+pXsWMzex7rB1mm6dnTHzAcyw9jImgx1OZuLeCvbeJ0=";
  };

  patches = [
    # ARM / AArch64 fixes.
    (fetchpatch {
      url = "https://github.com/openbabel/openbabel/commit/ee11c98a655296550710db1207b294f00e168216.patch";
      sha256 = "0wjqjrkr4pfirzzicdvlyr591vppydk572ix28jd2sagnfnf566g";
    })
  ];

  postPatch = ''
    sed '1i#include <ctime>' -i include/openbabel/obutil.h # gcc12
  '';

  buildInputs = [ zlib libxml2 eigen python3 cairo pcre ];

  nativeBuildInputs = [ cmake pkg-config ];

  meta = with lib; {
    description = "A toolbox designed to speak the many languages of chemical data";
    homepage = "http://openbabel.org";
    platforms = platforms.all;
    maintainers = with maintainers; [ danielbarter ];
    license = licenses.gpl2Plus;
  };
}