evcc: 0.131.4 -> 0.131.5
[NixPkgs.git] / pkgs / by-name / fi / firestarter / package.nix
blob55e1700c5c858e2787d90d2a9471b0212737538b
1 { stdenv
2 , lib
3 , fetchFromGitHub
4 , fetchzip
5 , addDriverRunpath
6 , cmake
7 , glibc_multi
8 , glibc
9 , git
10 , pkg-config
11 , cudaPackages ? {}
12 , withCuda ? false
15 let
16   inherit (cudaPackages) cudatoolkit;
18   hwloc = stdenv.mkDerivation rec {
19     pname = "hwloc";
20     version = "2.2.0";
22     src = fetchzip {
23       url = "https://download.open-mpi.org/release/hwloc/v${lib.versions.majorMinor version}/hwloc-${version}.tar.gz";
24       sha256 = "1ibw14h9ppg8z3mmkwys8vp699n85kymdz20smjd2iq9b67y80b6";
25     };
27     configureFlags = [
28       "--enable-static"
29       "--disable-libudev"
30       "--disable-shared"
31       "--disable-doxygen"
32       "--disable-libxml2"
33       "--disable-cairo"
34       "--disable-io"
35       "--disable-pci"
36       "--disable-opencl"
37       "--disable-cuda"
38       "--disable-nvml"
39       "--disable-gl"
40       "--disable-libudev"
41       "--disable-plugin-dlopen"
42       "--disable-plugin-ltdl"
43     ];
45     nativeBuildInputs = [ pkg-config ];
47     enableParallelBuilding = true;
49     outputs = [ "out" "lib" "dev" "doc" "man" ];
50   };
53 stdenv.mkDerivation rec {
54   pname = "firestarter";
55   version = "2.0";
57   src = fetchFromGitHub {
58     owner = "tud-zih-energy";
59     repo = "FIRESTARTER";
60     rev = "v${version}";
61     sha256 = "1ik6j1lw5nldj4i3lllrywqg54m9i2vxkxsb2zr4q0d2rfywhn23";
62     fetchSubmodules = true;
63   };
65   nativeBuildInputs = [
66     cmake
67     git
68     pkg-config
69   ] ++ lib.optionals withCuda [
70     addDriverRunpath
71   ];
73   buildInputs = [ hwloc ] ++ (if withCuda then
74     [ glibc_multi cudatoolkit ]
75   else
76     [ glibc.static ]);
78   NIX_LDFLAGS = lib.optionals withCuda [
79     "-L${cudatoolkit}/lib/stubs"
80   ];
82   cmakeFlags = [
83     "-DFIRESTARTER_BUILD_HWLOC=OFF"
84     "-DCMAKE_C_COMPILER_WORKS=1"
85     "-DCMAKE_CXX_COMPILER_WORKS=1"
86   ] ++ lib.optionals withCuda [
87     "-DFIRESTARTER_BUILD_TYPE=FIRESTARTER_CUDA"
88   ];
90   installPhase = ''
91     runHook preInstall
92     mkdir -p $out/bin
93     cp src/FIRESTARTER${lib.optionalString withCuda "_CUDA"} $out/bin/
94     runHook postInstall
95   '';
97   postFixup = lib.optionalString withCuda ''
98     addDriverRunpath $out/bin/FIRESTARTER_CUDA
99   '';
101   meta = with lib; {
102     broken = (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64);
103     homepage = "https://tu-dresden.de/zih/forschung/projekte/firestarter";
104     description = "Processor Stress Test Utility";
105     platforms = platforms.linux;
106     maintainers = with maintainers; [ astro marenz ];
107     license = licenses.gpl3;
108     mainProgram = "FIRESTARTER";
109   };