lol
1{ lib, stdenv, fetchFromGitHub, luajit, openssl, perl }:
2
3stdenv.mkDerivation rec {
4 pname = "wrk";
5 version = "4.2.0";
6
7 src = fetchFromGitHub {
8 owner = "wg";
9 repo = "wrk";
10 rev = version;
11 sha256 = "sha256-nCfA444p7krXOB3qRtDKWxWj9tsrDZsGf03ThtE1dXM=";
12 };
13
14 buildInputs = [ luajit openssl perl ];
15
16 makeFlags = [ "WITH_LUAJIT=${luajit}" "WITH_OPENSSL=${openssl.dev}" "VER=${version}" ];
17
18 preBuild = ''
19 for f in src/*.h; do
20 substituteInPlace $f \
21 --replace "#include <luajit-2.0/" "#include <"
22 done
23 '';
24
25 env.NIX_CFLAGS_COMPILE = "-DluaL_reg=luaL_Reg"; # needed since luajit-2.1.0-beta3
26
27 installPhase = ''
28 mkdir -p $out/bin
29 cp wrk $out/bin
30 '';
31
32 meta = with lib; {
33 description = "HTTP benchmarking tool";
34 homepage = "https://github.com/wg/wrk";
35 longDescription = ''
36 wrk is a modern HTTP benchmarking tool capable of generating
37 significant load when run on a single multi-core CPU. It
38 combines a multithreaded design with scalable event notification
39 systems such as epoll and kqueue.
40 '';
41 license = licenses.asl20;
42 maintainers = with maintainers; [ ragge ];
43 platforms = platforms.unix;
44 };
45}