2021-01-15 22:18:51 +00:00
|
|
|
{ lib, stdenv, fetchurl, nasm }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
let
|
2020-11-12 09:05:59 +00:00
|
|
|
inherit (stdenv.hostPlatform.parsed.cpu) bits;
|
|
|
|
arch = "bandwidth${toString bits}";
|
2020-04-24 23:36:52 +00:00
|
|
|
in
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "bandwidth";
|
2020-10-27 00:29:36 +00:00
|
|
|
version = "1.9.4";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://zsmith.co/archives/${pname}-${version}.tar.gz";
|
2020-10-27 00:29:36 +00:00
|
|
|
sha256 = "0x798xj3vhiwq2hal0vmf92sq4h7yalp3i6ylqwhnnpv99m2zws4";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2020-11-12 09:05:59 +00:00
|
|
|
postPatch = ''
|
|
|
|
sed -i 's,^CC=gcc .*,,' OOC/Makefile Makefile*
|
|
|
|
sed -i 's,ar ,$(AR) ,g' OOC/Makefile
|
|
|
|
'';
|
|
|
|
|
|
|
|
nativeBuildInputs = [ nasm ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-11-12 09:05:59 +00:00
|
|
|
buildFlags = [ arch ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/bin
|
2020-11-12 09:05:59 +00:00
|
|
|
cp ${arch} $out/bin/bandwidth
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://zsmith.co/bandwidth.html";
|
|
|
|
description = "Artificial benchmark for identifying weaknesses in the memory subsystem";
|
2020-11-12 09:05:59 +00:00
|
|
|
license = licenses.gpl2Plus;
|
|
|
|
platforms = platforms.x86;
|
|
|
|
maintainers = with maintainers; [ r-burns ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|