nixpkgs/pkgs/tools/networking/wrk2/default.nix
Rick van Schijndel 9833d56c24 treewide: mark packages broken that never built on PLATFORM
Done with the help of https://github.com/Mindavi/nixpkgs-mark-broken
Tool is still WIP but this is one of the first results.

I manually audited the results and removed some results that were not valid.

Note that some of these packages maybe should have more constrained platforms set
instead of broken set, but I think not being perfectly correct is better than
just keep trying to build all these things and never succeeding.

Some observations:

- Some darwin builds require XCode tools
- aarch64-linux builds sometimes suffer from using gcc9
  - gcc9 is getting older and misses some new libraries/features
- Sometimes tools try to do system detection or expect some explicit settings for
  platforms that are not x86_64-linux
2022-12-13 21:40:12 +01:00

45 lines
1.3 KiB
Nix

{ lib, stdenv, fetchFromGitHub, luajit, openssl, zlib }:
stdenv.mkDerivation rec {
pname = "wrk2";
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 '
'';
dontConfigure = true;
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 = lib.licenses.bsd3;
platforms = lib.platforms.linux;
maintainers = with lib.maintainers; [ thoughtpolice ];
# never built on aarch64-linux since first introduction in nixpkgs
broken = stdenv.isLinux && stdenv.isAarch64;
};
}