blob: 5ac352e0762c137fdea181cfe5c39a4074663a1c (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
{ stdenv, fetchFromGitHub, ocaml, findlib, opaline }:
stdenv.mkDerivation rec {
pname = "afl-persistent";
version = "1.3";
name = "ocaml${ocaml.version}-${pname}-${version}";
src = fetchFromGitHub {
owner = "stedolan";
repo = "ocaml-${pname}";
rev = "v${version}";
sha256 = "06yyds2vcwlfr2nd3gvyrazlijjcrd1abnvkfpkaadgwdw3qam1i";
};
buildInputs = [ ocaml findlib ];
# don't run tests in buildPhase
# don't overwrite test binary
postPatch = ''
sed -i 's/ && \.\/test$//' build.sh
sed -i '/^ocamlopt.*test.ml -o test$/ s/$/2/' build.sh
patchShebangs build.sh
'';
buildPhase = "./build.sh";
installPhase = ''
${opaline}/bin/opaline -prefix $out -libdir $out/lib/ocaml/${ocaml.version}/site-lib/ ${pname}.install
'';
doCheck = true;
checkPhase = "./_build/test && ./_build/test2";
meta = with stdenv.lib; {
homepage = "https://github.com/stedolan/ocaml-afl-persistent";
description = "persistent-mode afl-fuzz for ocaml";
license = licenses.mit;
maintainers = [ maintainers.sternenseemann ];
};
}
|