1 { lib, stdenv, fetchFromGitHub, ocaml, findlib, opaline }:
3 stdenv.mkDerivation rec {
4 pname = "afl-persistent";
6 name = "ocaml${ocaml.version}-${pname}-${version}";
8 src = fetchFromGitHub {
10 repo = "ocaml-${pname}";
12 sha256 = "06yyds2vcwlfr2nd3gvyrazlijjcrd1abnvkfpkaadgwdw3qam1i";
15 nativeBuildInputs = [ ocaml findlib ];
17 # don't run tests in buildPhase
18 # don't overwrite test binary
20 sed -i 's/ && \.\/test$//' build.sh
21 sed -i '/^ocamlopt.*test.ml -o test$/ s/$/2/' build.sh
22 patchShebangs build.sh
25 buildPhase = "./build.sh";
27 ${opaline}/bin/opaline -prefix $out -libdir $out/lib/ocaml/${ocaml.version}/site-lib/ ${pname}.install
31 checkPhase = "./_build/test && ./_build/test2";
34 homepage = "https://github.com/stedolan/ocaml-afl-persistent";
35 description = "persistent-mode afl-fuzz for ocaml";
36 license = licenses.mit;
37 maintainers = [ maintainers.sternenseemann ];