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.
This commit is contained in:
parent
b50889fc07
commit
cdb97ba523
1 changed files with 10 additions and 3 deletions
|
@ -1,5 +1,10 @@
|
|||
{ lib, stdenv, fetchurl, ocaml, findlib, ocamlbuild, ounit }:
|
||||
|
||||
let
|
||||
# ounit is only available for OCaml >= 4.04
|
||||
doCheck = lib.versionAtLeast ocaml.version "4.04";
|
||||
in
|
||||
|
||||
stdenv.mkDerivation {
|
||||
pname = "ocamlmod";
|
||||
version = "0.0.9";
|
||||
|
@ -9,13 +14,15 @@ stdenv.mkDerivation {
|
|||
sha256 = "0cgp9qqrq7ayyhddrmqmq1affvfqcn722qiakjq4dkywvp67h4aa";
|
||||
};
|
||||
|
||||
buildInputs = [ ocaml findlib ocamlbuild ounit ];
|
||||
buildInputs = [ ocaml findlib ocamlbuild ];
|
||||
|
||||
configurePhase = "ocaml setup.ml -configure --prefix $out --enable-tests";
|
||||
configurePhase = "ocaml setup.ml -configure --prefix $out"
|
||||
+ lib.optionalString doCheck " --enable-tests";
|
||||
buildPhase = "ocaml setup.ml -build";
|
||||
installPhase = "ocaml setup.ml -install";
|
||||
|
||||
doCheck = true;
|
||||
inherit doCheck;
|
||||
checkInputs = [ ounit ];
|
||||
|
||||
checkPhase = "ocaml setup.ml -test";
|
||||
|
||||
|
|
Loading…
Reference in a new issue