mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-29 17:10:48 +00:00
6bc3e86662
Cleaned up rules a bit for platform-independent building. License was incorrectly listed as MIT, it is actually GPL2+. Taking on maintainership as it appears to be orphaned.
38 lines
905 B
Nix
38 lines
905 B
Nix
{ stdenv, fetchurl, nasm }:
|
|
|
|
let
|
|
inherit (stdenv.hostPlatform.parsed.cpu) bits;
|
|
arch = "bandwidth${toString bits}";
|
|
in
|
|
stdenv.mkDerivation rec {
|
|
pname = "bandwidth";
|
|
version = "1.9.4";
|
|
|
|
src = fetchurl {
|
|
url = "https://zsmith.co/archives/${pname}-${version}.tar.gz";
|
|
sha256 = "0x798xj3vhiwq2hal0vmf92sq4h7yalp3i6ylqwhnnpv99m2zws4";
|
|
};
|
|
|
|
postPatch = ''
|
|
sed -i 's,^CC=gcc .*,,' OOC/Makefile Makefile*
|
|
sed -i 's,ar ,$(AR) ,g' OOC/Makefile
|
|
'';
|
|
|
|
nativeBuildInputs = [ nasm ];
|
|
|
|
buildFlags = [ arch ];
|
|
|
|
installPhase = ''
|
|
mkdir -p $out/bin
|
|
cp ${arch} $out/bin/bandwidth
|
|
'';
|
|
|
|
meta = with stdenv.lib; {
|
|
homepage = "https://zsmith.co/bandwidth.html";
|
|
description = "Artificial benchmark for identifying weaknesses in the memory subsystem";
|
|
license = licenses.gpl2Plus;
|
|
platforms = platforms.x86;
|
|
maintainers = with maintainers; [ r-burns ];
|
|
};
|
|
}
|