2015-04-23 22:45:34 +01:00
|
|
|
{ stdenv, fetchurl, nasm }:
|
|
|
|
|
|
|
|
let
|
|
|
|
arch =
|
|
|
|
if stdenv.system == "x86_64-linux" then "bandwidth64"
|
|
|
|
else if stdenv.system == "i686-linux" then "bandwidth32"
|
|
|
|
else if stdenv.system == "x86_64-darwin" then "bandwidth-mac64"
|
|
|
|
else if stdenv.system == "i686-darwin" then "bandwidth-mac32"
|
|
|
|
else if stdenv.system == "i686-cygwin" then "bandwidth-win32"
|
2017-03-09 01:37:14 +00:00
|
|
|
else throw "Unknown architecture";
|
2015-04-23 22:45:34 +01:00
|
|
|
in
|
|
|
|
stdenv.mkDerivation rec {
|
2016-04-02 01:16:31 +01:00
|
|
|
name = "bandwidth-${version}";
|
2017-06-20 01:31:25 +01:00
|
|
|
version = "1.4.2";
|
2015-04-23 22:45:34 +01:00
|
|
|
|
|
|
|
src = fetchurl {
|
2017-01-26 01:37:01 +00:00
|
|
|
url = "http://zsmith.co/archives/${name}.tar.gz";
|
2017-06-20 01:31:25 +01:00
|
|
|
sha256 = "1p1kp5s3fdgy667q7mc9ywnps0sbj4lpr42561yhi59m69n8c3kd";
|
2015-04-23 22:45:34 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [ nasm ];
|
|
|
|
|
2015-05-14 23:08:43 +01:00
|
|
|
buildFlags = [ arch ]
|
|
|
|
++ stdenv.lib.optionals stdenv.cc.isClang [ "CC=clang" "LD=clang" ];
|
2015-04-23 22:45:34 +01: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 01:16:31 +01:00
|
|
|
description = "Artificial benchmark for identifying weaknesses in the memory subsystem";
|
2015-04-23 22:45:34 +01:00
|
|
|
license = licenses.mit;
|
|
|
|
platforms = platforms.unix;
|
2016-04-02 01:16:31 +01:00
|
|
|
maintainers = with maintainers; [ nckx wkennington ];
|
2015-04-23 22:45:34 +01:00
|
|
|
};
|
|
|
|
}
|