lol
1{ stdenv, fetchurl, nasm }:
2
3let
4 arch =
5 if stdenv.system == "x86_64-linux" then "bandwidth64"
6 else if stdenv.system == "i686-linux" then "bandwidth32"
7 else if stdenv.system == "x86_64-darwin" then "bandwidth-mac64"
8 else if stdenv.system == "i686-darwin" then "bandwidth-mac32"
9 else if stdenv.system == "i686-cygwin" then "bandwidth-win32"
10 else null;
11in
12stdenv.mkDerivation rec {
13 name = "bandwidth-1.1b";
14
15 src = fetchurl {
16 url = "http://zsmith.co/archives/${name}.tar.gz";
17 sha256 = "01c3ca0x3rh65j1s2g6cg5xr9fvm0lp2wpmv71vhz55xwqqqmiz8";
18 };
19
20 buildInputs = [ nasm ];
21
22 buildFlags = [ arch ]
23 ++ stdenv.lib.optionals stdenv.cc.isClang [ "CC=clang" "LD=clang" ];
24
25 installPhase = ''
26 mkdir -p $out/bin
27 cp ${arch} $out/bin
28 ln -s ${arch} $out/bin/bandwidth
29 '';
30
31 meta = with stdenv.lib; {
32 homepage = https://zsmith.co/bandwidth.html;
33 description = "and artificial benchmark for identifying weaknesses in the memory subsystem";
34 license = licenses.mit;
35 platforms = platforms.unix;
36 maintainers = with maintainers; [ wkennington ];
37 };
38}