2021-01-15 09:19:50 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, luajit, openssl, zlib }:
|
2018-03-23 08:15:30 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "wrk2";
|
2018-03-23 08:15:30 +00:00
|
|
|
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 '
|
|
|
|
'';
|
|
|
|
|
2019-06-19 16:36:06 +01:00
|
|
|
dontConfigure = true;
|
2018-03-23 08:15:30 +00:00
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/bin
|
|
|
|
mv ./wrk $out/bin/wrk2
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "Constant throughput, correct latency recording variant of wrk";
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://github.com/giltene/wrk2";
|
2021-01-15 09:19:50 +00:00
|
|
|
license = lib.licenses.bsd3;
|
|
|
|
platforms = lib.platforms.linux;
|
|
|
|
maintainers = with lib.maintainers; [ thoughtpolice ];
|
2018-03-23 08:15:30 +00:00
|
|
|
};
|
|
|
|
}
|