nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix

bandwidth: refactor

emaryn af6ffa60 714e525d

+16 -14
+16 -14
pkgs/by-name/ba/bandwidth/package.nix
··· 1 1 { 2 2 lib, 3 3 stdenv, 4 - fetchurl, 4 + requireFile, 5 5 nasm, 6 6 }: 7 7 8 8 let 9 - inherit (stdenv.hostPlatform.parsed.cpu) bits; 10 - arch = "bandwidth${toString bits}"; 9 + arch = "bandwidth${toString stdenv.hostPlatform.parsed.cpu.bits}"; 11 10 in 12 - stdenv.mkDerivation rec { 11 + stdenv.mkDerivation (finalAttrs: { 13 12 pname = "bandwidth"; 14 13 version = "1.11.2d"; 15 14 16 - src = fetchurl { 17 - url = "https://zsmith.co/archives/bandwidth-${version}.tar.gz"; 15 + src = requireFile { 16 + message = "This file does not have a valid url."; 17 + name = "bandwidth-${finalAttrs.version}.tar.gz"; 18 18 hash = "sha256-7IrNiCXKf1vyRGl73Ccu3aYMqPVc4PpEr6lnSqIa4Q8="; 19 19 }; 20 20 ··· 48 48 ]; 49 49 50 50 installPhase = '' 51 - mkdir -p $out/bin 52 - cp ${arch} $out/bin/bandwidth 51 + runHook preInstall 52 + 53 + install -Dm755 ${arch} $out/bin/bandwidth 54 + 55 + runHook postInstall 53 56 ''; 54 57 55 - meta = with lib; { 56 - homepage = "https://zsmith.co/bandwidth.html"; 58 + meta = { 57 59 description = "Artificial benchmark for identifying weaknesses in the memory subsystem"; 58 - license = licenses.gpl2Plus; 59 - platforms = platforms.x86 ++ platforms.arm ++ platforms.aarch64; 60 - maintainers = with maintainers; [ r-burns ]; 60 + license = lib.licenses.gpl2Plus; 61 + platforms = lib.platforms.x86 ++ lib.platforms.arm ++ lib.platforms.aarch64; 62 + maintainers = with lib.maintainers; [ r-burns ]; 61 63 mainProgram = "bandwidth"; 62 64 }; 63 - } 65 + })