nixpkgs/pkgs/tools/misc/bandwidth/default.nix

38 lines
903 B
Nix
Raw Normal View History

{ lib, stdenv, fetchurl, nasm }:
2015-04-23 23:45:34 +02:00
let
inherit (stdenv.hostPlatform.parsed.cpu) bits;
arch = "bandwidth${toString bits}";
2015-04-23 23:45:34 +02:00
in
stdenv.mkDerivation rec {
pname = "bandwidth";
2020-10-21 22:26:29 +02:00
version = "1.9.4";
2015-04-23 23:45:34 +02:00
src = fetchurl {
url = "https://zsmith.co/archives/${pname}-${version}.tar.gz";
2020-10-21 22:26:29 +02:00
sha256 = "0x798xj3vhiwq2hal0vmf92sq4h7yalp3i6ylqwhnnpv99m2zws4";
2015-04-23 23:45:34 +02:00
};
postPatch = ''
sed -i 's,^CC=gcc .*,,' OOC/Makefile Makefile*
sed -i 's,ar ,$(AR) ,g' OOC/Makefile
'';
nativeBuildInputs = [ nasm ];
2015-04-23 23:45:34 +02:00
buildFlags = [ arch ];
2015-04-23 23:45:34 +02:00
installPhase = ''
mkdir -p $out/bin
cp ${arch} $out/bin/bandwidth
2015-04-23 23:45:34 +02:00
'';
meta = with 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";
license = licenses.gpl2Plus;
platforms = platforms.x86;
maintainers = with maintainers; [ r-burns ];
2015-04-23 23:45:34 +02:00
};
}