1 { lib, stdenv, fetchFromGitHub, makeWrapper
2 , libaio, python3, zlib
3 , withGnuplot ? false, gnuplot ? null }:
5 stdenv.mkDerivation rec {
9 src = fetchFromGitHub {
12 rev = "fio-${version}";
13 sha256 = "sha256-hjU6be1+x4YsY9hztqSD5zIxojs6qRZH7GwEkxPwdus=";
16 buildInputs = [ python3 zlib ]
17 ++ lib.optional (!stdenv.hostPlatform.isDarwin) libaio;
19 # ./configure does not support autoconf-style --build=/--host=.
21 configurePlatforms = [ ];
23 nativeBuildInputs = [ makeWrapper python3.pkgs.wrapPython ];
27 enableParallelBuilding = true;
30 substituteInPlace Makefile \
31 --replace "mandir = /usr/share/man" "mandir = \$(prefix)/man" \
32 --replace "sharedir = /usr/share/fio" "sharedir = \$(prefix)/share/fio"
33 substituteInPlace tools/plot/fio2gnuplot --replace /usr/share/fio $out/share/fio
36 pythonPath = [ python3.pkgs.six ];
38 makeWrapperArgs = lib.optionals withGnuplot [
39 "--prefix PATH : ${lib.makeBinPath [ gnuplot ]}"
43 wrapPythonProgramsIn "$out/bin" "$out $pythonPath"
47 description = "Flexible IO Tester - an IO benchmark tool";
48 homepage = "https://git.kernel.dk/cgit/fio/";
49 license = licenses.gpl2Plus;
50 platforms = platforms.unix;