diff --git a/flake.nix b/flake.nix index 435209927d..19ecb10ed4 100644 --- a/flake.nix +++ b/flake.nix @@ -49,14 +49,17 @@ basePkg = { name, - nativeBuildInputs, - buildInputs, - cmakeFlags, + nativeBuildInputs ? [], + buildInputs ? [], + cmakeFlags ? [], doCheck, - checkOptions, + checkOptions ? ''-L "quick|fast" -E "(ForceToStress_parallel)|(Hydro_Coupled)|(Hydro_SedOnly)|(Proj_South)|(.*_np[3-9])"'', ... - } @ inputs: let + }: let storepath = placeholder "out"; + extraNativeBuildInputs = nativeBuildInputs; + extraBuildInputs = buildInputs; + extraCmakeFlags = cmakeFlags; in pkgs.stdenv.mkDerivation { inherit name doCheck storepath; @@ -86,7 +89,7 @@ pkg-config autoPatchelfHook ] - ++ inputs.nativeBuildInputs; + ++ extraNativeBuildInputs; buildInputs = with pkgs; [ @@ -95,7 +98,7 @@ liblapack tbb ] - ++ inputs.buildInputs; + ++ extraBuildInputs; cmakeFlags = [ @@ -110,7 +113,7 @@ "-Wno-dev" ] - ++ inputs.cmakeFlags; + ++ extraCmakeFlags; checkPhase = '' runHook preCheckPhase @@ -130,24 +133,15 @@ ]; }; - default = { - doCheck ? false, - checkOptions ? ''-L "quick|fast" -E "(ForceToStress_parallel)|(Hydro_Coupled)|(Hydro_SedOnly)|(Proj_South)|(PoissonDG_np8)|(poisson_transient_conforming_anti_np8)"'', - }: + default = {doCheck ? false}: basePkg { - inherit doCheck checkOptions; + inherit doCheck; name = "elmer"; - nativeBuildInputs = []; - buildInputs = []; - cmakeFlags = []; }; - gui = { - doCheck ? false, - checkOptions ? ''-L "quick|fast" -E "(ForceToStress_parallel)|(Hydro_Coupled)|(Hydro_SedOnly)|(Proj_South)|(PoissonDG_np8)|(poisson_transient_conforming_anti_np8)"'', - }: + gui = {doCheck ? false}: basePkg { - inherit doCheck checkOptions; + inherit doCheck; name = "elmer-gui"; nativeBuildInputs = [pkgs.libsForQt5.wrapQtAppsHook]; @@ -171,16 +165,11 @@ ]; }; - full = { - doCheck ? false, - checkOptions ? ''-L "quick|fast" -E "(ForceToStress_parallel)|(Hydro_Coupled)|(Hydro_SedOnly)|(Proj_South)|(PoissonDG_np8)|(poisson_transient_conforming_anti_np8)"'', - }: + full = {doCheck ? false}: basePkg { - inherit doCheck checkOptions; + inherit doCheck; name = "elmer-full"; - nativeBuildInputs = []; - buildInputs = with pkgs; [ hdf5-mpi @@ -196,8 +185,8 @@ cmakeFlags = [ "-DWITH_NETCDF:BOOL=TRUE" "-DNETCDF_LIBRARY=${pkgs.netcdf-mpi}/lib/libnetcdf.so" - "-DNETCDFF_LIBRARY=${pkgs.netcdffortran}/lib/libnetcdff.so" "-DNETCDF_INCLUDE_DIR=${pkgs.netcdf-mpi}/include" + "-DNETCDFF_LIBRARY=${pkgs.netcdffortran}/lib/libnetcdff.so" "-DCMAKE_Fortran_FLAGS=-I${pkgs.netcdffortran}/include" "-DWITH_Hypre:BOOL=TRUE" @@ -205,8 +194,10 @@ "-DWITH_Mumps:BOOL=TRUE" "-DWITH_ScatteredDataInterpolator:BOOL=TRUE" + "-DCSA_LIBRARY=${csa}/lib/libcsa.a" "-DCSA_INCLUDE_DIR=${csa}/include" + "-DNN_INCLUDE_DIR=${pkgs.nn}/include" "-DNN_LIBRARY=${pkgs.nn}/lib/libnn.a"