2015-04-23 21:45:34 +00:00
|
|
|
{ stdenv, fetchurl, nasm }:
|
|
|
|
|
|
|
|
let
|
|
|
|
arch =
|
2018-08-20 19:11:29 +00:00
|
|
|
if stdenv.hostPlatform.system == "x86_64-linux" then "bandwidth64"
|
|
|
|
else if stdenv.hostPlatform.system == "i686-linux" then "bandwidth32"
|
|
|
|
else if stdenv.hostPlatform.system == "x86_64-darwin" then "bandwidth-mac64"
|
|
|
|
else if stdenv.hostPlatform.system == "i686-darwin" then "bandwidth-mac32"
|
|
|
|
else if stdenv.hostPlatform.system == "i686-cygwin" then "bandwidth-win32"
|
2017-03-09 01:37:14 +00:00
|
|
|
else throw "Unknown architecture";
|
2015-04-23 21:45:34 +00:00
|
|
|
in
|
|
|
|
stdenv.mkDerivation rec {
|
2016-04-02 00:16:31 +00:00
|
|
|
name = "bandwidth-${version}";
|
2018-02-25 15:22:15 +00:00
|
|
|
version = "1.5.1";
|
2015-04-23 21:45:34 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2018-06-28 18:43:35 +00:00
|
|
|
url = "https://zsmith.co/archives/${name}.tar.gz";
|
2018-02-25 15:22:15 +00:00
|
|
|
sha256 = "1v9k1a2ilkbhc3viyacgq88c9if60kwsd1fy6rn84317qap4i7ib";
|
2015-04-23 21:45:34 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [ nasm ];
|
|
|
|
|
2015-05-14 22:08:43 +00:00
|
|
|
buildFlags = [ arch ]
|
|
|
|
++ stdenv.lib.optionals stdenv.cc.isClang [ "CC=clang" "LD=clang" ];
|
2015-04-23 21:45:34 +00:00
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/bin
|
|
|
|
cp ${arch} $out/bin
|
|
|
|
ln -s ${arch} $out/bin/bandwidth
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
homepage = https://zsmith.co/bandwidth.html;
|
2016-04-02 00:16:31 +00:00
|
|
|
description = "Artificial benchmark for identifying weaknesses in the memory subsystem";
|
2015-04-23 21:45:34 +00:00
|
|
|
license = licenses.mit;
|
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
|
|
|
}
|