nixpkgs/pkgs/development/libraries/openbabel/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

46 lines
1.2 KiB
Nix
Raw Normal View History

2021-11-01 15:04:52 +00:00
{ stdenv, lib, fetchFromGitHub, cmake, zlib, libxml2, eigen, python, cairo, pcre, pkg-config, swig, rapidjson }:
stdenv.mkDerivation rec {
pname = "openbabel";
2020-12-28 20:01:20 +00:00
version = "3.1.1";
2021-11-01 15:04:52 +00:00
src = fetchFromGitHub {
owner = "openbabel";
repo = "openbabel";
rev = "openbabel-${lib.replaceStrings ["."] ["-"] version}";
sha256 = "sha256-wQpgdfCyBAoh4pmj9j7wPTlMtraJ62w/EShxi/olVMY=";
};
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"
];
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
'';
2020-12-28 20:01:20 +00:00
meta = with lib; {
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 ];
};
}