about summary refs log tree commit diff
path: root/nixpkgs/pkgs/tools/misc/bandwidth/default.nix
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2021-09-13 11:53:06 +0000
committerAlyssa Ross <hi@alyssa.is>2021-09-13 17:18:49 +0000
commitc3e005913d59b8ad64004e60888a71816688af1f (patch)
treef65b32f0d16acaa40f2ee82ac736d150de4b6cf5 /nixpkgs/pkgs/tools/misc/bandwidth/default.nix
parent1c8034da05499ca3d999f57ba1f6b235e7711ee1 (diff)
parentdb88608d8c811a93b74c99cfa1224952afc78200 (diff)
downloadnixlib-c3e005913d59b8ad64004e60888a71816688af1f.tar
nixlib-c3e005913d59b8ad64004e60888a71816688af1f.tar.gz
nixlib-c3e005913d59b8ad64004e60888a71816688af1f.tar.bz2
nixlib-c3e005913d59b8ad64004e60888a71816688af1f.tar.lz
nixlib-c3e005913d59b8ad64004e60888a71816688af1f.tar.xz
nixlib-c3e005913d59b8ad64004e60888a71816688af1f.tar.zst
nixlib-c3e005913d59b8ad64004e60888a71816688af1f.zip
Merge commit 'db88608d8c811a93b74c99cfa1224952afc78200'
Conflicts:
	nixpkgs/nixos/modules/config/update-users-groups.pl
Diffstat (limited to 'nixpkgs/pkgs/tools/misc/bandwidth/default.nix')
-rw-r--r--nixpkgs/pkgs/tools/misc/bandwidth/default.nix24
1 files changed, 19 insertions, 5 deletions
diff --git a/nixpkgs/pkgs/tools/misc/bandwidth/default.nix b/nixpkgs/pkgs/tools/misc/bandwidth/default.nix
index 677a9ddef514..710382fe8267 100644
--- a/nixpkgs/pkgs/tools/misc/bandwidth/default.nix
+++ b/nixpkgs/pkgs/tools/misc/bandwidth/default.nix
@@ -6,21 +6,35 @@ let
 in
 stdenv.mkDerivation rec {
   pname = "bandwidth";
-  version = "1.9.4";
+  version = "1.10.1";
 
   src = fetchurl {
     url = "https://zsmith.co/archives/${pname}-${version}.tar.gz";
-    sha256 = "0x798xj3vhiwq2hal0vmf92sq4h7yalp3i6ylqwhnnpv99m2zws4";
+    sha256 = "sha256-trya+/cBNIittQAc5tcykZbImeISqIolO/Y8uOI0jGk=";
   };
 
   postPatch = ''
-    sed -i 's,^CC=gcc .*,,' OOC/Makefile Makefile*
     sed -i 's,ar ,$(AR) ,g' OOC/Makefile
+    # Remove unnecessary -m32 for 32-bit targets
+    sed -i 's,-m32,,g' OOC/Makefile
+    # Fix wrong comment character
+    sed -i 's,# 32,; 32,g' routines-x86-32bit.asm
+    # Fix missing symbol exports for macOS clang
+    echo global _VectorToVector128 >> routines-x86-64bit.asm
+    echo global _VectorToVector256 >> routines-x86-64bit.asm
   '';
 
   nativeBuildInputs = [ nasm ];
 
-  buildFlags = [ arch ];
+  buildFlags = [
+    "AR=${stdenv.cc.targetPrefix}ar"
+    "CC=${stdenv.cc.targetPrefix}cc"
+    "ARM_AS=${stdenv.cc.targetPrefix}as"
+    "ARM_CC=$(CC)"
+    "UNAMEPROC=${stdenv.hostPlatform.parsed.cpu.name}"
+    "UNAMEMACHINE=${stdenv.hostPlatform.parsed.cpu.name}"
+    arch
+  ];
 
   installPhase = ''
     mkdir -p $out/bin
@@ -31,7 +45,7 @@ stdenv.mkDerivation rec {
     homepage = "https://zsmith.co/bandwidth.html";
     description = "Artificial benchmark for identifying weaknesses in the memory subsystem";
     license = licenses.gpl2Plus;
-    platforms = platforms.x86;
+    platforms = platforms.x86 ++ platforms.arm ++ platforms.aarch64;
     maintainers = with maintainers; [ r-burns ];
   };
 }