1{ stdenv, pkgconfig, fetchFromGitHub, libbsd }:
2
3stdenv.mkDerivation rec {
4 pname = "kcgi";
5 version = "0.10.8";
6 underscoreVersion = stdenv.lib.replaceChars ["."] ["_"] version;
7 name = "${pname}-${version}";
8
9 src = fetchFromGitHub {
10 owner = "kristapsdz";
11 repo = pname;
12 rev = "VERSION_${underscoreVersion}";
13 sha256 = "0ha6r7bcgf6pcn5gbd2sl7835givhda1jql49c232f1iair1yqyp";
14 };
15 patchPhase = ''substituteInPlace configure \
16 --replace /usr/local /
17 '';
18
19 nativeBuildInputs = [ pkgconfig ];
20 buildInputs = [ ] ++ stdenv.lib.optionals stdenv.isLinux [ libbsd ] ;
21
22 dontAddPrefix = true;
23
24 installFlags = [ "DESTDIR=$(out)" ];
25
26 meta = with stdenv.lib; {
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 };
33}