nbench: fix darwin build

This commit is contained in:
Ben Siraphob 2022-03-29 00:11:42 -05:00 committed by Benno Fünfstück
parent 291eb6f682
commit 54066822a5

View file

@ -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 ];
};
}