2024-02-29 20:09:43 +00:00
|
|
|
{ stdenv, lib, fetchFromGitHub, cmake, perl, zlib, libxml2, eigen, python, cairo, pcre, pkg-config, swig, rapidjson }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "openbabel";
|
2024-02-29 20:09:43 +00:00
|
|
|
version = "unstable-06-12-23";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "openbabel";
|
2024-02-29 20:09:43 +00:00
|
|
|
repo = pname;
|
|
|
|
rev = "32cf131444c1555c749b356dab44fb9fe275271f";
|
|
|
|
hash = "sha256-V0wrZVrojCZ9Knc5H6cPzPoYWVosRZ6Sn4PX+UFEfHY=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-02-16 17:41:37 +00:00
|
|
|
postPatch = ''
|
|
|
|
sed '1i#include <ctime>' -i include/openbabel/obutil.h # gcc12
|
|
|
|
'';
|
|
|
|
|
2024-02-29 20:09:43 +00:00
|
|
|
buildInputs = [ perl zlib libxml2 eigen python cairo pcre swig rapidjson ];
|
2021-02-05 17:12:51 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [ cmake pkg-config ];
|
|
|
|
|
|
|
|
pythonMajorMinor = "${python.sourceVersion.major}.${python.sourceVersion.minor}";
|
|
|
|
|
|
|
|
cmakeFlags = [
|
|
|
|
"-DRUN_SWIG=ON"
|
|
|
|
"-DPYTHON_BINDINGS=ON"
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
2024-02-29 20:09:43 +00:00
|
|
|
# Setuptools only accepts PEP 440 version strings. The "unstable" identifier
|
|
|
|
# can not be used. Instead we pretend to be the 3.2 beta release.
|
2021-02-05 17:12:51 +00:00
|
|
|
postFixup = ''
|
|
|
|
cat <<EOF > $out/lib/python$pythonMajorMinor/site-packages/setup.py
|
|
|
|
from distutils.core import setup
|
|
|
|
|
|
|
|
setup(
|
|
|
|
name = 'pyopenbabel',
|
2024-02-29 20:09:43 +00:00
|
|
|
version = '3.2b1',
|
2021-02-05 17:12:51 +00:00
|
|
|
packages = ['openbabel'],
|
|
|
|
package_data = {'openbabel' : ['_openbabel.so']}
|
|
|
|
)
|
|
|
|
EOF
|
2021-12-06 16:07:01 +00:00
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "A toolbox designed to speak the many languages of chemical data";
|
|
|
|
homepage = "http://openbabel.org";
|
2021-02-05 17:12:51 +00:00
|
|
|
platforms = platforms.all;
|
|
|
|
license = licenses.gpl2Plus;
|
|
|
|
maintainers = with maintainers; [ danielbarter ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|