diff options
author | sternenseemann <0rpkxez4ksa01gb3typccl0i@systemli.org> | 2021-02-20 13:09:34 +0100 |
---|---|---|
committer | Vincent Laporte <vbgl@users.noreply.github.com> | 2021-02-21 10:12:22 +0100 |
commit | cdb97ba52397fc059f47758d4dc8311fe044f44f (patch) | |
tree | 827d09eb6eb7c26f4329ab3231ac19fc4bfe6e75 /pkgs/development/tools/ocaml/ocamlmod | |
parent | b50889fc078325180965d0caf36e7b57bc759bbe (diff) | |
download | nixpkgs-cdb97ba52397fc059f47758d4dc8311fe044f44f.tar nixpkgs-cdb97ba52397fc059f47758d4dc8311fe044f44f.tar.gz nixpkgs-cdb97ba52397fc059f47758d4dc8311fe044f44f.tar.bz2 nixpkgs-cdb97ba52397fc059f47758d4dc8311fe044f44f.tar.lz nixpkgs-cdb97ba52397fc059f47758d4dc8311fe044f44f.tar.xz nixpkgs-cdb97ba52397fc059f47758d4dc8311fe044f44f.tar.zst nixpkgs-cdb97ba52397fc059f47758d4dc8311fe044f44f.zip |
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.
Diffstat (limited to 'pkgs/development/tools/ocaml/ocamlmod')
-rw-r--r-- | pkgs/development/tools/ocaml/ocamlmod/default.nix | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/pkgs/development/tools/ocaml/ocamlmod/default.nix b/pkgs/development/tools/ocaml/ocamlmod/default.nix index 77d39029551..cf24a132210 100644 --- a/pkgs/development/tools/ocaml/ocamlmod/default.nix +++ b/pkgs/development/tools/ocaml/ocamlmod/default.nix @@ -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"; |