1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 cmake,
6 perl,
7 gfortran,
8 python3,
9 boost,
10 eigen,
11 zlib,
12}:
13
14stdenv.mkDerivation rec {
15 pname = "pcmsolver";
16 version = "1.3.0";
17
18 src = fetchFromGitHub {
19 owner = "PCMSolver";
20 repo = "pcmsolver";
21 rev = "v${version}";
22 sha256 = "0jrxr8z21hjy7ik999hna9rdqy221kbkl3qkb06xw7g80rc9x9yr";
23 };
24
25 # Glibc 2.34 changed SIGSTKSZ to a dynamic value, which breaks
26 # PCMsolver. Replace SIGSTKZ by the backward-compatible _SC_SIGSTKSZ.
27 postPatch = ''
28 substituteInPlace external/Catch/catch.hpp \
29 --replace SIGSTKSZ _SC_SIGSTKSZ
30 '';
31
32 nativeBuildInputs = [
33 cmake
34 gfortran
35 perl
36 python3
37 ];
38
39 buildInputs = [
40 boost
41 eigen
42 zlib
43 ];
44
45 # Required for build with gcc-14
46 env.NIX_CFLAGS_COMPILE = "-std=c++14";
47
48 cmakeFlags = [ "-DENABLE_OPENMP=ON" ];
49
50 hardeningDisable = [ "format" ];
51
52 # Requires files, that are not installed.
53 doCheck = false;
54
55 meta = with lib; {
56 description = "API for the Polarizable Continuum Model";
57 mainProgram = "run_pcm";
58 homepage = "https://pcmsolver.readthedocs.io/en/stable/";
59 license = licenses.lgpl3Only;
60 platforms = platforms.linux;
61 maintainers = [ maintainers.sheepforce ];
62 };
63}