1 { lib, stdenv, fetchFromGitHub, luajit, openssl, zlib }:
3 stdenv.mkDerivation rec {
5 version = "4.0.0-${builtins.substring 0 7 src.rev}";
7 src = fetchFromGitHub {
10 rev = "e0109df5b9de09251adb5f5848f223fbee2aa9f5";
11 sha256 = "1aqdwmgdd74wq73f1zp28yqj91gd6p6nf9nbdfibl7mlklbzvak8";
14 buildInputs = [ luajit openssl zlib ];
17 rm -rf deps/luajit && mkdir deps/luajit
19 substituteInPlace ./Makefile \
20 --replace '-lluajit' '-lluajit-5.1' \
21 --replace '_BSD_SOURCE' '_DEFAULT_SOURCE' \
22 --replace 'cd $(LDIR) && ./luajit' '${luajit}/bin/luajit' \
23 --replace 'config.h Makefile $(LDIR)/libluajit.a' 'config.h Makefile'
25 substituteInPlace ./src/script.c \
26 --replace 'struct luaL_reg ' 'struct luaL_Reg '
32 mv ./wrk $out/bin/wrk2
36 description = "Constant throughput, correct latency recording variant of wrk";
37 homepage = "https://github.com/giltene/wrk2";
38 license = lib.licenses.bsd3;
39 platforms = lib.platforms.linux;
40 maintainers = with lib.maintainers; [ thoughtpolice ];
41 # never built on aarch64-linux since first introduction in nixpkgs
42 broken = stdenv.isLinux && stdenv.isAarch64;