Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at netboot-syslinux-multiplatform 109 lines 2.2 kB view raw
1{ lib 2, stdenv 3, fetchFromGitHub 4, makeWrapper 5, pandoc 6, installShellFiles 7, perl 8, xorg 9, libGL 10, coreutils 11, unixtools 12, targetPackages 13, gnugrep 14, gawk 15, withGL? true 16, withX11perf? true 17}: 18 19stdenv.mkDerivation rec { 20 pname = "unixbench"; 21 version = "unstable-2023-02-27"; 22 23 src = fetchFromGitHub { 24 owner = "kdlucas"; 25 repo = "byte-unixbench"; 26 rev = "a07fcc03264915c624f0e4818993c5b4df3fa703"; 27 hash = "sha256-gmRWAqE9/HBb0S9rK0DXoaCoiGbtat0gmdeozhbv0NI="; 28 }; 29 30 patches = [ 31 ./common.patch 32 ]; 33 34 patchFlags = [ "-p2" ]; 35 36 sourceRoot = "source/UnixBench"; 37 38 postPatch = '' 39 substituteInPlace Makefile \ 40 --replace "-Wa,-q" "" 41 ''; 42 43 nativeBuildInputs = [ 44 makeWrapper 45 pandoc 46 installShellFiles 47 ]; 48 49 buildInputs = [ perl ] ++ lib.optionals withGL [ 50 xorg.libX11 51 xorg.libXext 52 libGL 53 ]; 54 55 runtimeDependencies = [ 56 coreutils 57 unixtools.nettools 58 unixtools.locale 59 targetPackages.stdenv.cc 60 gnugrep 61 gawk 62 ] ++ lib.optionals withX11perf [ 63 xorg.x11perf 64 ]; 65 66 makeFlags = [ 67 "CC=${stdenv.cc.targetPrefix}cc" 68 ] ++ lib.optionals withGL [ 69 "GRAPHIC_TESTS=defined" 70 ]; 71 72 installPhase = '' 73 runHook preInstall 74 mkdir -p $out/{bin,libexec,share} 75 install -D Run $out/bin/ubench 76 cp -r pgms $out/libexec/ 77 cp -r testdir $out/share/ 78 runHook postInstall 79 ''; 80 81 postInstall = '' 82 substituteInPlace USAGE \ 83 --replace 'Run"' 'ubench"' \ 84 --replace './Run' 'ubench' \ 85 --replace 'Run ' 'ubench ' 86 pandoc -f rst -t man USAGE -o ubench.1 87 installManPage ubench.1 88 ''; 89 90 preFixup = '' 91 substituteInPlace $out/libexec/pgms/multi.sh \ 92 --replace '/bin/sh "$' '${targetPackages.runtimeShell} "$' 93 94 substituteInPlace $out/bin/ubench \ 95 --subst-var out 96 97 wrapProgram $out/bin/ubench \ 98 --prefix PATH : ${lib.makeBinPath runtimeDependencies} 99 ''; 100 101 meta = with lib; { 102 description = "A basic indicator of the performance of a Unix-like system"; 103 homepage = "https://github.com/kdlucas/byte-unixbench"; 104 license = licenses.gpl2Plus; 105 mainProgram = "ubench"; 106 maintainers = with maintainers; [ aleksana ]; 107 platforms = platforms.unix; 108 }; 109}