2015-04-23 23:45:34 +02:00
|
|
|
{ stdenv, fetchurl, nasm }:
|
|
|
|
|
|
|
|
let
|
|
|
|
arch =
|
2018-08-20 21:11:29 +02: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 02:37:14 +01:00
|
|
|
else throw "Unknown architecture";
|
2015-04-23 23:45:34 +02:00
|
|
|
in
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 14:41:18 +02:00
|
|
|
pname = "bandwidth";
|
2019-11-25 20:20:03 +01:00
|
|
|
version = "1.9.3";
|
2015-04-23 23:45:34 +02:00
|
|
|
|
|
|
|
src = fetchurl {
|
2019-08-15 14:41:18 +02:00
|
|
|
url = "https://zsmith.co/archives/${pname}-${version}.tar.gz";
|
2019-11-25 20:20:03 +01:00
|
|
|
sha256 = "0zpv2qgkbak0llw47qcakhyh2z3zv4d69kasldmpdlpqryd9za84";
|
2015-04-23 23:45:34 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [ nasm ];
|
|
|
|
|
2015-05-15 00:08:43 +02:00
|
|
|
buildFlags = [ arch ]
|
|
|
|
++ stdenv.lib.optionals stdenv.cc.isClang [ "CC=clang" "LD=clang" ];
|
2015-04-23 23:45:34 +02:00
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/bin
|
|
|
|
cp ${arch} $out/bin
|
|
|
|
ln -s ${arch} $out/bin/bandwidth
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "https://zsmith.co/bandwidth.html";
|
2016-04-02 02:16:31 +02:00
|
|
|
description = "Artificial benchmark for identifying weaknesses in the memory subsystem";
|
2015-04-23 23:45:34 +02:00
|
|
|
license = licenses.mit;
|
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
|
|
|
}
|