nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 stdenv,
3 lib,
4 fetchurl,
5 gnuplot,
6}:
7
8let
9 target =
10 if stdenv.hostPlatform.system == "i686-linux" then
11 "linux"
12 else if stdenv.hostPlatform.system == "x86_64-linux" then
13 "linux-AMD64"
14 else if stdenv.hostPlatform.system == "x86_64-darwin" then
15 "macosx"
16 else if stdenv.hostPlatform.system == "aarch64-linux" then
17 "linux-arm"
18 else
19 throw "Platform ${stdenv.hostPlatform.system} not yet supported.";
20in
21
22stdenv.mkDerivation rec {
23 pname = "iozone";
24 version = "3.507";
25
26 src = fetchurl {
27 url = "http://www.iozone.org/src/current/iozone${lib.replaceStrings [ "." ] [ "_" ] version}.tar";
28 hash = "sha256-HoCHraBW9dgBjuC8dmhtQW/CJR7QMDgFXb0K940eXOM=";
29 };
30
31 license = fetchurl {
32 url = "http://www.iozone.org/docs/Iozone_License.txt";
33 hash = "sha256-O/8yztxKBI/UKs6vwv9mq16Rn3cf/UHpSxdVnAPVCYw=";
34 };
35
36 preBuild = "pushd src/current";
37 postBuild = "popd";
38
39 buildFlags = target;
40
41 # The makefile doesn't define a rule for e.g. libbif.o
42 # Make will try to evaluate implicit built-in rules for these outputs if building in parallel
43 # Build in serial so that the main rule builds everything before the implicit ones are attempted
44 enableParallelBuilding = false;
45
46 installPhase = ''
47 mkdir -p $out/{bin,share/doc,libexec,share/man/man1}
48 install docs/iozone.1 $out/share/man/man1/
49 install docs/Iozone_ps.gz $out/share/doc/
50 install -s src/current/{iozone,fileop,pit_server} $out/bin/
51 install src/current/{gnu3d.dem,Generate_Graphs,gengnuplot.sh} $out/libexec/
52 ln -s $out/libexec/Generate_Graphs $out/bin/iozone_generate_graphs
53 # License copy is mandated by the license, but it's not in the tarball.
54 install ${license} $out/share/doc/Iozone_License.txt
55 '';
56
57 preFixup = ''
58 sed -i "1i#! $shell" $out/libexec/Generate_Graphs
59 substituteInPlace $out/libexec/Generate_Graphs \
60 --replace ./gengnuplot.sh $out/libexec/gengnuplot.sh \
61 --replace 'gnuplot ' "${gnuplot}/bin/gnuplot " \
62 --replace gnu3d.dem $out/libexec/gnu3d.dem
63 '';
64
65 meta = {
66 description = "Filesystem benchmark tool";
67 homepage = "http://www.iozone.org/";
68 license = lib.licenses.unfreeRedistributable;
69 platforms = [
70 "i686-linux"
71 "x86_64-linux"
72 "x86_64-darwin"
73 "aarch64-linux"
74 ];
75 maintainers = with lib.maintainers; [
76 Baughn
77 makefu
78 ];
79 };
80}