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