1{ lib, stdenv, aflplusplus}:
2
3stdenv.mkDerivation {
4 version = lib.getVersion aflplusplus;
5 pname = "libtokencap";
6
7 src = aflplusplus.src;
8 postUnpack = "chmod -R +w ${aflplusplus.src.name}";
9 sourceRoot = "${aflplusplus.src.name}/libtokencap";
10
11 makeFlags = [ "PREFIX=$(out)" ];
12
13 preInstall = ''
14 mkdir -p $out/lib/afl
15 mkdir -p $out/share/doc/afl
16 '';
17 postInstall = ''
18 mkdir $out/bin
19 cat > $out/bin/get-libtokencap-so <<END
20 #!${stdenv.shell}
21 echo $out/lib/afl/libtokencap.so
22 END
23 chmod +x $out/bin/get-libtokencap-so
24 '';
25
26 meta = with lib; {
27 homepage = "https://github.com/vanhauser-thc/AFLplusplus";
28 description = "strcmp & memcmp token capture library";
29 license = lib.licenses.asl20;
30 maintainers = with maintainers; [ ris ];
31 };
32}