1{ stdenv
2, lib
3, fetchFromGitHub
4, cmake
5, blas
6 # Check Inputs
7, python3
8}:
9
10stdenv.mkDerivation rec {
11 pname = "libcint";
12 version = "6.1.2";
13
14 src = fetchFromGitHub {
15 owner = "sunqm";
16 repo = "libcint";
17 rev = "v${version}";
18 hash = "sha256-URJcC0ib87ejrTCglCjhC2tQHNc5TRvo4CQ52N58n+4=";
19 };
20
21 postPatch = ''
22 sed -i 's/libcint.so/libcint${stdenv.hostPlatform.extensions.sharedLibrary}/g' testsuite/*.py
23 '';
24
25 nativeBuildInputs = [ cmake ];
26 buildInputs = [ blas ];
27 cmakeFlags = [
28 "-DENABLE_TEST=1"
29 "-DQUICK_TEST=1"
30 "-DCMAKE_INSTALL_PREFIX=" # ends up double-adding /nix/store/... prefix, this avoids issue
31 "-DWITH_RANGE_COULOMB:STRING=1"
32 "-DWITH_FORTRAN:STRING=1"
33 "-DMIN_EXPCUTOFF:STRING=20"
34 ];
35
36 strictDeps = true;
37
38 doCheck = true;
39 nativeCheckInputs = [ python3.pkgs.numpy ];
40
41 meta = with lib; {
42 description = "General GTO integrals for quantum chemistry";
43 longDescription = ''
44 libcint is an open source library for analytical Gaussian integrals.
45 It provides C/Fortran API to evaluate one-electron / two-electron
46 integrals for Cartesian / real-spheric / spinor Gaussian type functions.
47 '';
48 homepage = "http://wiki.sunqm.net/libcint";
49 downloadPage = "https://github.com/sunqm/libcint";
50 changelog = "https://github.com/sunqm/libcint/blob/master/ChangeLog";
51 license = licenses.bsd2;
52 maintainers = with maintainers; [ drewrisinger ];
53 platforms = platforms.unix;
54 };
55}