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";
17 nativeBuildInputs = [ ocaml findlib ];
19 # don't run tests in buildPhase
20 # don't overwrite test binary
22 sed -i 's/ && \.\/test$//' build.sh
23 sed -i '/^ocamlopt.*test.ml -o test$/ s/$/2/' build.sh
24 patchShebangs build.sh
27 buildPhase = "./build.sh";
29 ${opaline}/bin/opaline -prefix $out -libdir $out/lib/ocaml/${ocaml.version}/site-lib/ ${pname}.install
33 checkPhase = "./_build/test && ./_build/test2";
36 homepage = "https://github.com/stedolan/ocaml-afl-persistent";
37 description = "persistent-mode afl-fuzz for ocaml";
38 license = licenses.mit;
39 maintainers = [ maintainers.sternenseemann ];