ocamlPackages.ocamlmod: disable tests if ounit is not available

When we redid ounit and ounit2, the minimumOCamlVersion was also pushed
to OCaml 4.04. ocamlmod builds on earlier versions as well, but doesn't
evaluate if we pull in ounit.

Therefore we conditionally disable tests for OCaml < 4.04 which means
for example oasis is available for those versions again as well.

authored by sternenseemann and committed by Vincent Laporte cdb97ba5 b50889fc

+10 -3
+10 -3
pkgs/development/tools/ocaml/ocamlmod/default.nix
··· 1 1 { lib, stdenv, fetchurl, ocaml, findlib, ocamlbuild, ounit }: 2 2 3 + let 4 + # ounit is only available for OCaml >= 4.04 5 + doCheck = lib.versionAtLeast ocaml.version "4.04"; 6 + in 7 + 3 8 stdenv.mkDerivation { 4 9 pname = "ocamlmod"; 5 10 version = "0.0.9"; ··· 9 14 sha256 = "0cgp9qqrq7ayyhddrmqmq1affvfqcn722qiakjq4dkywvp67h4aa"; 10 15 }; 11 16 12 - buildInputs = [ ocaml findlib ocamlbuild ounit ]; 17 + buildInputs = [ ocaml findlib ocamlbuild ]; 13 18 14 - configurePhase = "ocaml setup.ml -configure --prefix $out --enable-tests"; 19 + configurePhase = "ocaml setup.ml -configure --prefix $out" 20 + + lib.optionalString doCheck " --enable-tests"; 15 21 buildPhase = "ocaml setup.ml -build"; 16 22 installPhase = "ocaml setup.ml -install"; 17 23 18 - doCheck = true; 24 + inherit doCheck; 25 + checkInputs = [ ounit ]; 19 26 20 27 checkPhase = "ocaml setup.ml -test"; 21 28