nixpkgs/pkgs/tools/networking/wrk/default.nix
Profpatsch 4a7f99d55d treewide: with stdenv.lib; in meta -> with lib;
Part of: https://github.com/NixOS/nixpkgs/issues/108938

meta = with stdenv.lib;

is a widely used pattern. We want to slowly remove
the `stdenv.lib` indirection and encourage people
to use `lib` directly. Thus let’s start with the meta
field.

This used a rewriting script to mostly automatically
replace all occurances of this pattern, and add the
`lib` argument to the package header if it doesn’t
exist yet.

The script in its current form is available at
https://cs.tvl.fyi/depot@2f807d7f141068d2d60676a89213eaa5353ca6e0/-/blob/users/Profpatsch/nixpkgs-rewriter/default.nix
2021-01-11 10:38:22 +01:00

46 lines
1.2 KiB
Nix

{ lib, stdenv, fetchFromGitHub, luajit, openssl, perl }:
stdenv.mkDerivation rec {
pname = "wrk";
version = "4.1.0";
src = fetchFromGitHub {
owner = "wg";
repo = "wrk";
rev = version;
sha256 = "0dblb3qdg8mbgb8iiks0g420pza13npbr33b2xkc5dgv7kcwmvqj";
};
buildInputs = [ luajit openssl perl ];
makeFlags = [ "WITH_LUAJIT=${luajit}" "WITH_OPENSSL=${openssl.dev}" "VER=${version}" ];
preBuild = ''
for f in src/*.h; do
substituteInPlace $f \
--replace "#include <luajit-2.0/" "#include <"
done
'';
NIX_CFLAGS_COMPILE = "-DluaL_reg=luaL_Reg"; # needed since luajit-2.1.0-beta3
installPhase = ''
mkdir -p $out/bin
cp wrk $out/bin
'';
meta = with lib; {
description = "HTTP benchmarking tool";
homepage = "https://github.com/wg/wrk";
longDescription = ''
wrk is a modern HTTP benchmarking tool capable of generating
significant load when run on a single multi-core CPU. It
combines a multithreaded design with scalable event notification
systems such as epoll and kqueue.
'';
license = licenses.asl20;
maintainers = with maintainers; [ ragge ];
platforms = platforms.unix;
};
}