1{ lib, stdenv, pkg-config, fetchFromGitHub, libbsd }:
2
3stdenv.mkDerivation rec {
4 pname = "kcgi";
5 version = "0.10.8";
6 underscoreVersion = lib.replaceStrings ["."] ["_"] version;
7
8 src = fetchFromGitHub {
9 owner = "kristapsdz";
10 repo = pname;
11 rev = "VERSION_${underscoreVersion}";
12 sha256 = "0ha6r7bcgf6pcn5gbd2sl7835givhda1jql49c232f1iair1yqyp";
13 };
14 patchPhase = ''substituteInPlace configure \
15 --replace /usr/local /
16 '';
17
18 nativeBuildInputs = [ pkg-config ];
19 buildInputs = [ ] ++ lib.optionals stdenv.isLinux [ libbsd ] ;
20
21 dontAddPrefix = true;
22
23 installFlags = [ "DESTDIR=$(out)" ];
24
25 meta = with lib; {
26 broken = (stdenv.isLinux && stdenv.isAarch64);
27 homepage = "https://kristaps.bsd.lv/kcgi";
28 description = "Minimal CGI and FastCGI library for C/C++";
29 license = licenses.isc;
30 platforms = platforms.all;
31 maintainers = [ maintainers.leenaars ];
32 mainProgram = "kfcgi";
33 };
34}