2021-11-01 15:04:52 +00:00
|
|
|
{ stdenv, lib, fetchFromGitHub, cmake, zlib, libxml2, eigen, python, cairo, pcre, pkg-config, swig, rapidjson }:
|
2009-03-10 14:41:50 +00:00
|
|
|
|
2011-08-15 18:05:31 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "openbabel";
|
2020-12-28 20:01:20 +00:00
|
|
|
version = "3.1.1";
|
2012-01-14 18:02:54 +00:00
|
|
|
|
2021-11-01 15:04:52 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "openbabel";
|
|
|
|
repo = "openbabel";
|
|
|
|
rev = "openbabel-${lib.replaceStrings ["."] ["-"] version}";
|
|
|
|
sha256 = "sha256-wQpgdfCyBAoh4pmj9j7wPTlMtraJ62w/EShxi/olVMY=";
|
2009-03-10 14:41:50 +00:00
|
|
|
};
|
2012-01-14 18:02:54 +00:00
|
|
|
|
2020-12-28 20:01:20 +00:00
|
|
|
buildInputs = [ zlib libxml2 eigen python cairo pcre swig rapidjson ];
|
|
|
|
|
|
|
|
nativeBuildInputs = [ cmake pkg-config ];
|
|
|
|
|
|
|
|
pythonMajorMinor = "${python.sourceVersion.major}.${python.sourceVersion.minor}";
|
|
|
|
|
|
|
|
cmakeFlags = [
|
|
|
|
"-DRUN_SWIG=ON"
|
|
|
|
"-DPYTHON_BINDINGS=ON"
|
2018-12-09 23:25:16 +00:00
|
|
|
];
|
|
|
|
|
2020-12-28 20:01:20 +00:00
|
|
|
postFixup = ''
|
|
|
|
cat <<EOF > $out/lib/python$pythonMajorMinor/site-packages/setup.py
|
|
|
|
from distutils.core import setup
|
|
|
|
|
|
|
|
setup(
|
|
|
|
name = 'pyopenbabel',
|
|
|
|
version = '${version}',
|
|
|
|
packages = ['openbabel'],
|
|
|
|
package_data = {'openbabel' : ['_openbabel.so']}
|
|
|
|
)
|
|
|
|
EOF
|
2021-11-01 15:04:52 +00:00
|
|
|
'';
|
2011-08-15 18:05:31 +00:00
|
|
|
|
2020-12-28 20:01:20 +00:00
|
|
|
meta = with lib; {
|
2019-11-17 08:43:55 +00:00
|
|
|
description = "A toolbox designed to speak the many languages of chemical data";
|
|
|
|
homepage = "http://openbabel.org";
|
2020-12-28 20:01:20 +00:00
|
|
|
platforms = platforms.all;
|
|
|
|
license = licenses.gpl2Plus;
|
|
|
|
maintainers = with maintainers; [ danielbarter ];
|
2011-08-15 18:05:31 +00:00
|
|
|
};
|
2007-11-11 16:15:29 +00:00
|
|
|
}
|