nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 fetchurl,
5}:
6
7stdenv.mkDerivation rec {
8 pname = "nbench-byte";
9 version = "2.2.3";
10
11 src = fetchurl {
12 url = "http://www.math.utah.edu/~mayer/linux/nbench-byte-${version}.tar.gz";
13 sha256 = "1b01j7nmm3wd92ngvsmn2sbw43sl9fpx4xxmkrink68fz1rx0gbj";
14 };
15
16 prePatch = ''
17 substituteInPlace nbench1.h --replace '"NNET.DAT"' "\"$out/NNET.DAT\""
18 substituteInPlace sysspec.h --replace "malloc.h" "stdlib.h"
19 ''
20 + lib.optionalString stdenv.hostPlatform.isDarwin ''
21 substituteInPlace Makefile --replace "-static" ""
22 '';
23
24 buildInputs = lib.optionals stdenv.hostPlatform.isGnu [
25 stdenv.cc.libc.static
26 ];
27
28 makeFlags = [ "CC=${stdenv.cc.targetPrefix}cc" ];
29
30 installPhase = ''
31 mkdir -p $out/bin
32 cp nbench $out/bin
33 cp NNET.DAT $out
34 '';
35
36 meta = with lib; {
37 homepage = "https://www.math.utah.edu/~mayer/linux/bmark.html";
38 description = "Synthetic computing benchmark program";
39 platforms = platforms.unix;
40 maintainers = with lib.maintainers; [ bennofs ];
41 mainProgram = "nbench";
42 };
43}