From bb7692db80c2fb76d349b188e72f56e3e911451c Mon Sep 17 00:00:00 2001 From: Vincent Laporte Date: Mon, 20 Sep 2021 18:14:14 +0200 Subject: [PATCH] ocamlPackages.gen: disable tests with OCaml < 4.08 --- pkgs/development/ocaml-modules/gen/default.nix | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/pkgs/development/ocaml-modules/gen/default.nix b/pkgs/development/ocaml-modules/gen/default.nix index 77fc0b63c55e..1c12f3ac5f87 100644 --- a/pkgs/development/ocaml-modules/gen/default.nix +++ b/pkgs/development/ocaml-modules/gen/default.nix @@ -1,9 +1,8 @@ { stdenv, lib, fetchFromGitHub, ocaml, findlib, ocamlbuild, qtest, ounit }: -let version = "0.5"; in - -stdenv.mkDerivation { - name = "ocaml${ocaml.version}-gen-${version}"; +stdenv.mkDerivation rec { + version = "0.5"; + pname = "ocaml${ocaml.version}-gen"; src = fetchFromGitHub { owner = "c-cube"; @@ -13,14 +12,12 @@ stdenv.mkDerivation { }; nativeBuildInputs = [ ocaml findlib ocamlbuild ]; - buildInputs = [ qtest ounit ]; + buildInputs = lib.optionals doCheck [ qtest ounit ]; strictDeps = true; - configureFlags = [ - "--enable-tests" - ]; + configureFlags = lib.optional doCheck "--enable-tests"; - doCheck = true; + doCheck = lib.versionAtLeast ocaml.version "4.08"; checkTarget = "test"; createFindlibDestdir = true; @@ -29,6 +26,6 @@ stdenv.mkDerivation { homepage = "https://github.com/c-cube/gen"; description = "Simple, efficient iterators for OCaml"; license = lib.licenses.bsd3; - platforms = ocaml.meta.platforms or []; + inherit (ocaml.meta) platforms; }; }