Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: ccf5ceea05fc
Choose a base ref
...
head repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 6bc3e866628b
Choose a head ref
  • 1 commit
  • 1 file changed
  • 1 contributor

Commits on Nov 10, 2020

  1. bandwidth: fix build on darwin, fix license, adopt (#101522)

    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.
    r-burns authored Nov 10, 2020
    Copy the full SHA
    6bc3e86 View commit details
Showing with 13 additions and 14 deletions.
  1. +13 −14 pkgs/tools/misc/bandwidth/default.nix
27 changes: 13 additions & 14 deletions pkgs/tools/misc/bandwidth/default.nix
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
{ stdenv, fetchurl, nasm }:

let
arch =
if stdenv.hostPlatform.system == "x86_64-linux" then "bandwidth64"
else if stdenv.hostPlatform.system == "i686-linux" then "bandwidth32"
else if stdenv.hostPlatform.system == "x86_64-darwin" then "bandwidth-mac64"
else if stdenv.hostPlatform.system == "i686-darwin" then "bandwidth-mac32"
else if stdenv.hostPlatform.system == "i686-cygwin" then "bandwidth-win32"
else throw "Unknown architecture";
inherit (stdenv.hostPlatform.parsed.cpu) bits;
arch = "bandwidth${toString bits}";
in
stdenv.mkDerivation rec {
pname = "bandwidth";
@@ -18,21 +13,25 @@ stdenv.mkDerivation rec {
sha256 = "0x798xj3vhiwq2hal0vmf92sq4h7yalp3i6ylqwhnnpv99m2zws4";
};

buildInputs = [ nasm ];
postPatch = ''
sed -i 's,^CC=gcc .*,,' OOC/Makefile Makefile*
sed -i 's,ar ,$(AR) ,g' OOC/Makefile
'';

nativeBuildInputs = [ nasm ];

buildFlags = [ arch ]
++ stdenv.lib.optionals stdenv.cc.isClang [ "CC=clang" "LD=clang" ];
buildFlags = [ arch ];

installPhase = ''
mkdir -p $out/bin
cp ${arch} $out/bin
ln -s ${arch} $out/bin/bandwidth
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.mit;
platforms = platforms.unix;
license = licenses.gpl2Plus;
platforms = platforms.x86;
maintainers = with maintainers; [ r-burns ];
};
}