2015-04-23 23:45:34 +02: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"
|
|
|
|
else null;
|
|
|
|
in
|
|
|
|
stdenv.mkDerivation rec {
|
2016-04-02 02:16:31 +02:00
|
|
|
name = "bandwidth-${version}";
|
2016-07-06 18:49:49 +02:00
|
|
|
version = "1.3.1";
|
2015-04-23 23:45:34 +02:00
|
|
|
|
|
|
|
src = fetchurl {
|
2016-07-06 18:49:49 +02:00
|
|
|
url = "https://mutineer.org/file.php?id=284ebee21bde256fd0daeae91242c2b73d9cf1df&p=bandwidth";
|
2016-04-02 02:16:31 +02:00
|
|
|
name = "${name}.tar.gz";
|
2016-07-06 18:49:49 +02:00
|
|
|
sha256 = "13a0mxrkybpwiynv4cj8wsy8zl5xir5xi1a03fzam5gw815dj4am";
|
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; {
|
|
|
|
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;
|
2016-04-02 02:16:31 +02:00
|
|
|
maintainers = with maintainers; [ nckx wkennington ];
|
2015-04-23 23:45:34 +02:00
|
|
|
};
|
|
|
|
}
|