1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 fetchpatch,
6 cmake,
7 boost,
8 eigen,
9 libxml2,
10 mpi,
11 python3,
12 petsc,
13 pkg-config,
14}:
15
16stdenv.mkDerivation rec {
17 pname = "precice";
18 version = "3.1.2";
19
20 src = fetchFromGitHub {
21 owner = "precice";
22 repo = "precice";
23 rev = "v${version}";
24 hash = "sha256-KpmcQj8cv5V5OXCMhe2KLTsqUzKWtTeQyP+zg+Y+yd0=";
25 };
26
27 patches = lib.optionals (!lib.versionOlder "3.1.2" version) [
28 (fetchpatch {
29 name = "boost-187-fixes.patch";
30 url = "https://github.com/precice/precice/commit/23788e9eeac49a2069e129a0cb1ac846e8cbeb9f.patch";
31 hash = "sha256-Z8qOGOkXoCui8Wy0H/OeE+NaTDvyRuPm2A+VJKtjH4s=";
32 })
33 ];
34
35 cmakeFlags = [
36 (lib.cmakeBool "PRECICE_PETScMapping" false)
37 (lib.cmakeBool "BUILD_SHARED_LIBS" true)
38 (lib.cmakeFeature "PYTHON_LIBRARIES" python3.libPrefix)
39 (lib.cmakeFeature "PYTHON_INCLUDE_DIR" "${python3}/include/${python3.libPrefix}")
40 ];
41
42 nativeBuildInputs = [
43 cmake
44 pkg-config
45 python3
46 python3.pkgs.numpy
47 ];
48
49 buildInputs = [
50 boost
51 eigen
52 libxml2
53 mpi
54 petsc
55 ];
56
57 meta = {
58 description = "PreCICE stands for Precise Code Interaction Coupling Environment";
59 homepage = "https://precice.org/";
60 license = with lib.licenses; [ gpl3 ];
61 maintainers = with lib.maintainers; [ Scriptkiddi ];
62 mainProgram = "binprecice";
63 platforms = lib.platforms.unix;
64 };
65}