4a7f99d55d
Part of: https://github.com/NixOS/nixpkgs/issues/108938 meta = with stdenv.lib; is a widely used pattern. We want to slowly remove the `stdenv.lib` indirection and encourage people to use `lib` directly. Thus let’s start with the meta field. This used a rewriting script to mostly automatically replace all occurances of this pattern, and add the `lib` argument to the package header if it doesn’t exist yet. The script in its current form is available at https://cs.tvl.fyi/depot@2f807d7f141068d2d60676a89213eaa5353ca6e0/-/blob/users/Profpatsch/nixpkgs-rewriter/default.nix
39 lines
1 KiB
Nix
39 lines
1 KiB
Nix
{ lib, stdenv, fetchFromGitHub, glibc, python3, cudatoolkit,
|
|
withCuda ? true
|
|
}:
|
|
|
|
with stdenv.lib;
|
|
stdenv.mkDerivation rec {
|
|
pname = "firestarter";
|
|
version = "1.7.4";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "tud-zih-energy";
|
|
repo = "FIRESTARTER";
|
|
rev = "v${version}";
|
|
sha256 = "0zqfqb7hf48z39g1qhbl1iraf8rz4d629h1q6ikizckpzfq23kd0";
|
|
};
|
|
|
|
nativeBuildInputs = [ python3 ];
|
|
buildInputs = [ glibc.static ] ++ optionals withCuda [ cudatoolkit ];
|
|
preBuild = ''
|
|
mkdir -p build
|
|
cd build
|
|
python ../code-generator.py ${optionalString withCuda "--enable-cuda"}
|
|
'';
|
|
makeFlags = optionals withCuda [ "LINUX_CUDA_PATH=${cudatoolkit}" ];
|
|
enableParallelBuilding = true;
|
|
|
|
installPhase = ''
|
|
mkdir -p $out/bin
|
|
cp FIRESTARTER $out/bin/firestarter
|
|
'';
|
|
|
|
meta = with lib; {
|
|
homepage = "https://tu-dresden.de/zih/forschung/projekte/firestarter";
|
|
description = "Processor Stress Test Utility";
|
|
platforms = platforms.linux;
|
|
maintainers = with maintainers; [ astro marenz ];
|
|
license = licenses.gpl3;
|
|
};
|
|
}
|