From 54066822a56a217514f9cfce6e66588546be7e48 Mon Sep 17 00:00:00 2001 From: Ben Siraphob Date: Tue, 29 Mar 2022 00:11:42 -0500 Subject: [PATCH] nbench: fix darwin build --- pkgs/tools/misc/nbench/default.nix | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/pkgs/tools/misc/nbench/default.nix b/pkgs/tools/misc/nbench/default.nix index dc9dcb1e5bec..16e67b848d65 100644 --- a/pkgs/tools/misc/nbench/default.nix +++ b/pkgs/tools/misc/nbench/default.nix @@ -9,13 +9,15 @@ stdenv.mkDerivation rec { sha256 = "1b01j7nmm3wd92ngvsmn2sbw43sl9fpx4xxmkrink68fz1rx0gbj"; }; - buildInputs = [ stdenv.cc.libc.static ]; prePatch = '' substituteInPlace nbench1.h --replace '"NNET.DAT"' "\"$out/NNET.DAT\"" + substituteInPlace sysspec.h --replace "malloc.h" "stdlib.h" + '' + lib.optionalString stdenv.isDarwin '' + substituteInPlace Makefile --replace "-static" "" ''; - preBuild = '' - makeFlagsArray=(CC=$CC) - ''; + + makeFlags = [ "CC=${stdenv.cc.targetPrefix}cc" ]; + installPhase = '' mkdir -p $out/bin cp nbench $out/bin @@ -25,7 +27,7 @@ stdenv.mkDerivation rec { meta = with lib; { homepage = "https://www.math.utah.edu/~mayer/linux/bmark.html"; description = "A synthetic computing benchmark program"; - platforms = platforms.linux; + platforms = platforms.unix; maintainers = with lib.maintainers; [ bennofs ]; }; }