1{
2 stdenv,
3 lib,
4 fetchFromGitHub,
5 gfortran,
6 meson,
7 ninja,
8 pkg-config,
9 python3,
10 blas,
11 lapack,
12 mctc-lib,
13 mstore,
14 multicharge,
15}:
16
17assert !blas.isILP64 && !lapack.isILP64;
18
19stdenv.mkDerivation rec {
20 pname = "dftd4";
21 version = "3.7.0";
22
23 src = fetchFromGitHub {
24 owner = "dftd4";
25 repo = "dftd4";
26 rev = "v${version}";
27 hash = "sha256-dixPCLH5dWkE2/7ghGEXJmX2/g1DN30dB4jX2d7fmio=";
28 };
29
30 patches = [
31 # Make sure fortran headers are installed directly in /include
32 ./fortran-module-dir.patch
33 ];
34
35 nativeBuildInputs = [
36 gfortran
37 meson
38 ninja
39 pkg-config
40 python3
41 ];
42
43 buildInputs = [
44 blas
45 lapack
46 mctc-lib
47 mstore
48 multicharge
49 ];
50
51 outputs = [
52 "out"
53 "dev"
54 ];
55
56 doCheck = true;
57
58 postPatch = ''
59 patchShebangs --build \
60 config/install-mod.py \
61 app/tester.py
62 '';
63
64 preCheck = ''
65 export OMP_NUM_THREADS=2
66 '';
67
68 meta = with lib; {
69 description = "Generally Applicable Atomic-Charge Dependent London Dispersion Correction";
70 mainProgram = "dftd4";
71 license = with licenses; [
72 lgpl3Plus
73 gpl3Plus
74 ];
75 homepage = "https://github.com/grimme-lab/dftd4";
76 platforms = platforms.linux;
77 maintainers = [ maintainers.sheepforce ];
78 };
79}