about summary refs log tree commit diff
path: root/pkgs/development/libraries/science/chemistry/libvdwxc/default.nix
blob: c0da65e7c788468a6175b0b7815e1cc9a6718bf9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
{ stdenv
, lib
, fetchFromGitLab
, gfortran
, autoreconfHook
, fftwMpi
, mpi
}:

stdenv.mkDerivation rec {
  pname = "libvdwxc";
  # Stable version has non-working MPI detection.
  version = "unstable-24.02.2020";

  src = fetchFromGitLab {
    owner = "libvdwxc";
    repo = pname;
    rev = "92f4910c6ac88e111db2fb3a518089d0510c53b0";
    sha256 = "1c7pjrvifncbdyngs2bv185imxbcbq64nka8gshhp8n2ns6fids6";
  };

  nativeBuildInputs = [ autoreconfHook gfortran ];

  propagatedBuildInputs = [ mpi fftwMpi ];

  preConfigure = ''
    mkdir build && cd build

    export PATH=$PATH:${mpi}/bin
    configureFlagsArray+=(
      --with-mpi=${lib.getDev mpi}
      CC=mpicc
      FC=mpif90
      MPICC=mpicc
      MPIFC=mpif90
    )
  '';

  configureScript = "../configure";

  hardeningDisable = [ "format" ];

  doCheck = true;

  meta = with lib; {
    description = "Portable C library of density functionals with van der Waals interactions for density functional theory";
    license = with licenses; [ lgpl3Plus bsd3 ];
    homepage = "https://libvdwxc.org/";
    platforms = platforms.unix;
    maintainers = [ maintainers.sheepforce ];
  };
}