nix-icon-charm/derivation.nix

49 lines
954 B
Nix
Raw Normal View History

2023-02-08 11:02:44 +01:00
{ pkgs
2023-04-19 16:29:11 +02:00
, lib
2023-02-08 11:02:44 +01:00
, stdenvNoCC
, cxx ? pkgs.gfortran12
, cc ? pkgs.gfortran12
, f77 ? pkgs.gfortran12
, cmake
, python39
, python39Packages
2023-02-15 15:54:37 +01:00
, gtest
2023-02-16 12:58:17 +01:00
, src ? { outPath = ./../icon-charm; }
2023-04-19 16:29:11 +02:00
, cIfaceSupport ? false
, fortranIfaceSupport ? false
2023-02-08 11:02:44 +01:00
}:
stdenvNoCC.mkDerivation {
2023-02-16 12:58:17 +01:00
pname = "icon-charm";
version = "develop";
2023-02-15 17:55:55 +01:00
inherit src;
2023-02-08 11:02:44 +01:00
nativeBuildInputs = [
2023-02-16 12:58:17 +01:00
cmake
2023-02-08 11:02:44 +01:00
cxx
cc
2023-02-16 12:58:17 +01:00
f77
2023-02-08 11:02:44 +01:00
python39
python39Packages.jinja2
2023-02-15 15:54:37 +01:00
gtest
2023-02-08 11:02:44 +01:00
];
cmakeFlags = [
"-DCMAKE_CXX_COMPILER=${cxx}/bin/c++"
"-DCMAKE_C_COMPILER=${cc}/bin/cc"
"-DCMAKE_FORTRAN_COMPILER=${f77}/bin/f77"
2023-04-19 16:29:11 +02:00
] ++ lib.optional (cIfaceSupport && !fortranIfaceSupport) [
"-DMM_ENABLE_C=ON"
] ++ lib.optional fortranIfaceSupport [
"-DMM_ENABLE_C=ON"
"-DMM_ENABLE_FORTRAN=ON"
] ++ lib.optional (!fortranIfaceSupport) [
"-DMM_ENABLE_FORTRAN=OFF"
] ++ lib.optional (!cIfaceSupport && !fortranIfaceSupport) [
"-DMM_ENABLE_C=OFF"
2023-02-08 11:02:44 +01:00
];
2023-02-09 21:21:39 +01:00
doCheck = true;
2023-02-08 11:02:44 +01:00
}