diff options
author | Austin Seipp <aseipp@pobox.com> | 2018-03-23 03:15:30 -0500 |
---|---|---|
committer | Austin Seipp <aseipp@pobox.com> | 2018-03-23 13:42:10 -0500 |
commit | 1800e4ec0be11c3b9b55028703ecd04d69e5e7e2 (patch) | |
tree | b46bd6592a7aed5c9588edc120ccaac9d810b934 /pkgs/tools | |
parent | f330b48b64680fed4666911ad6f899534d19704b (diff) |
wrk2: init at 4.0.0-e0109df5
Signed-off-by: Austin Seipp <aseipp@pobox.com>
Diffstat (limited to 'pkgs/tools')
-rw-r--r-- | pkgs/tools/networking/wrk2/default.nix | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/pkgs/tools/networking/wrk2/default.nix b/pkgs/tools/networking/wrk2/default.nix new file mode 100644 index 0000000000000..5caad0874f7c2 --- /dev/null +++ b/pkgs/tools/networking/wrk2/default.nix @@ -0,0 +1,42 @@ +{ stdenv, fetchFromGitHub, luajit, openssl, zlib }: + +stdenv.mkDerivation rec { + name = "wrk2-${version}"; + version = "4.0.0-${builtins.substring 0 7 src.rev}"; + + src = fetchFromGitHub { + owner = "giltene"; + repo = "wrk2"; + rev = "e0109df5b9de09251adb5f5848f223fbee2aa9f5"; + sha256 = "1aqdwmgdd74wq73f1zp28yqj91gd6p6nf9nbdfibl7mlklbzvak8"; + }; + + buildInputs = [ luajit openssl zlib ]; + + patchPhase = '' + rm -rf deps/luajit && mkdir deps/luajit + + substituteInPlace ./Makefile \ + --replace '-lluajit' '-lluajit-5.1' \ + --replace '_BSD_SOURCE' '_DEFAULT_SOURCE' \ + --replace 'cd $(LDIR) && ./luajit' '${luajit}/bin/luajit' \ + --replace 'config.h Makefile $(LDIR)/libluajit.a' 'config.h Makefile' + + substituteInPlace ./src/script.c \ + --replace 'struct luaL_reg ' 'struct luaL_Reg ' + ''; + + configurePhase = ":"; + installPhase = '' + mkdir -p $out/bin + mv ./wrk $out/bin/wrk2 + ''; + + meta = { + description = "Constant throughput, correct latency recording variant of wrk"; + homepage = https://github.com/giltene/wrk2; + license = stdenv.lib.licenses.bsd3; + platforms = stdenv.lib.platforms.linux; + maintainers = with stdenv.lib.maintainers; [ thoughtpolice ]; + }; +} |