ocamlPackages.ounit2: disable for OCaml < 4.08

This commit is contained in:
Vincent Laporte 2023-05-12 23:09:22 +02:00
parent bc9afd1686
commit c81792a457
No known key found for this signature in database
GPG key ID: EBD582ADDDB1F81F
20 changed files with 37 additions and 56 deletions

View file

@ -1,11 +1,9 @@
{ lib, buildDunePackage, fetchFromGitHub, m4, camlp-streams, core_kernel, ounit }: { lib, buildDunePackage, fetchFromGitHub, ocaml, m4, camlp-streams, core_kernel, ounit }:
buildDunePackage rec { buildDunePackage rec {
pname = "cfstream"; pname = "cfstream";
version = "1.3.2"; version = "1.3.2";
duneVersion = "3";
minimalOCamlVersion = "4.04.1"; minimalOCamlVersion = "4.04.1";
src = fetchFromGitHub { src = fetchFromGitHub {
@ -23,7 +21,7 @@ buildDunePackage rec {
checkInputs = [ ounit ]; checkInputs = [ ounit ];
propagatedBuildInputs = [ camlp-streams core_kernel ]; propagatedBuildInputs = [ camlp-streams core_kernel ];
doCheck = true; doCheck = lib.versionAtLeast ocaml.version "4.08";
meta = with lib; { meta = with lib; {
inherit (src.meta) homepage; inherit (src.meta) homepage;

View file

@ -36,7 +36,7 @@ stdenv.mkDerivation rec {
checkInputs = [ checkInputs = [
ounit ounit
]; ];
doCheck = true; doCheck = lib.versionAtLeast ocaml.version "4.08";
preInstall = "mkdir -p $OCAMLFIND_DESTDIR"; preInstall = "mkdir -p $OCAMLFIND_DESTDIR";
installFlags = [ "BINDIR=$(out)/bin" ]; installFlags = [ "BINDIR=$(out)/bin" ];

View file

@ -1,22 +1,20 @@
{ lib, buildDunePackage, fetchurl, stdlib-shims, ounit }: { lib, buildDunePackage, fetchurl, ocaml, stdlib-shims, ounit }:
buildDunePackage rec { buildDunePackage rec {
pname = "diet"; pname = "diet";
version = "0.4"; version = "0.4";
useDune2 = true;
src = fetchurl { src = fetchurl {
url = url =
"https://github.com/mirage/ocaml-diet/releases/download/v${version}/diet-v${version}.tbz"; "https://github.com/mirage/ocaml-diet/releases/download/v${version}/diet-v${version}.tbz";
sha256 = "96acac2e4fdedb5f47dd8ad2562e723d85ab59cd1bd85554df21ec907b071741"; sha256 = "96acac2e4fdedb5f47dd8ad2562e723d85ab59cd1bd85554df21ec907b071741";
}; };
minimumOCamlVersion = "4.03"; minimalOCamlVersion = "4.03";
propagatedBuildInputs = [ stdlib-shims ]; propagatedBuildInputs = [ stdlib-shims ];
doCheck = true; doCheck = lib.versionAtLeast ocaml.version "4.08";
checkInputs = [ ounit ]; checkInputs = [ ounit ];
meta = with lib; { meta = with lib; {

View file

@ -19,12 +19,13 @@ stdenv.mkDerivation rec {
''; '';
nativeBuildInputs = [ ocaml findlib ]; nativeBuildInputs = [ ocaml findlib ];
buildInputs = [ expat ounit ]; buildInputs = [ expat ];
strictDeps = true; strictDeps = true;
doCheck = lib.versionOlder ocaml.version "4.06"; doCheck = lib.versionAtLeast ocaml.version "4.08";
checkTarget = "testall"; checkTarget = "testall";
checkInputs = [ ounit ];
createFindlibDestdir = true; createFindlibDestdir = true;

View file

@ -19,7 +19,7 @@ buildDunePackage rec {
checkInputs = [ checkInputs = [
ounit2 ounit2
]; ];
doCheck = lib.versionAtLeast ocaml.version "4.04"; doCheck = lib.versionAtLeast ocaml.version "4.08";
meta = with lib; { meta = with lib; {
description = "OCaml API to manipulate real files (POSIX like) and filenames"; description = "OCaml API to manipulate real files (POSIX like) and filenames";

View file

@ -1,4 +1,4 @@
{ lib, buildDunePackage, fetchFromGitHub { lib, buildDunePackage, fetchFromGitHub, ocaml
, menhir, ppxlib, ppx_deriving, re, uutf, uucp, ounit2 , menhir, ppxlib, ppx_deriving, re, uutf, uucp, ounit2
}: }:
@ -6,8 +6,6 @@ buildDunePackage rec {
pname = "jingoo"; pname = "jingoo";
version = "1.4.4"; version = "1.4.4";
duneVersion = "3";
minimalOCamlVersion = "4.05"; minimalOCamlVersion = "4.05";
src = fetchFromGitHub { src = fetchFromGitHub {
@ -20,7 +18,7 @@ buildDunePackage rec {
nativeBuildInputs = [ menhir ]; nativeBuildInputs = [ menhir ];
propagatedBuildInputs = [ ppxlib ppx_deriving re uutf uucp ]; propagatedBuildInputs = [ ppxlib ppx_deriving re uutf uucp ];
checkInputs = [ ounit2 ]; checkInputs = [ ounit2 ];
doCheck = true; doCheck = lib.versionAtLeast ocaml.version "4.08";
meta = with lib; { meta = with lib; {

View file

@ -6,8 +6,6 @@ buildDunePackage rec {
minimalOCamlVersion = "4.03"; minimalOCamlVersion = "4.03";
duneVersion = "3";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "aantron"; owner = "aantron";
repo = pname; repo = pname;
@ -17,7 +15,7 @@ buildDunePackage rec {
propagatedBuildInputs = [ camlp-streams markup ]; propagatedBuildInputs = [ camlp-streams markup ];
doCheck = lib.versionAtLeast ocaml.version "4.04"; doCheck = lib.versionAtLeast ocaml.version "4.08";
checkInputs = [ ounit2 ]; checkInputs = [ ounit2 ];
meta = { meta = {

View file

@ -1,4 +1,4 @@
{ lib, fetchurl, buildDunePackage { lib, fetchurl, buildDunePackage, ocaml
, ppx_sexp_conv, ounit2 , ppx_sexp_conv, ounit2
}: }:
@ -7,7 +7,6 @@ buildDunePackage rec {
version = "5.4.0"; version = "5.4.0";
minimalOCamlVersion = "4.04"; minimalOCamlVersion = "4.04";
duneVersion = "3";
src = fetchurl { src = fetchurl {
url = "https://github.com/mirage/ocaml-ipaddr/releases/download/v${version}/ipaddr-${version}.tbz"; url = "https://github.com/mirage/ocaml-ipaddr/releases/download/v${version}/ipaddr-${version}.tbz";
@ -15,7 +14,7 @@ buildDunePackage rec {
}; };
checkInputs = [ ppx_sexp_conv ounit2 ]; checkInputs = [ ppx_sexp_conv ounit2 ];
doCheck = true; doCheck = lib.versionAtLeast ocaml.version "4.08";
meta = with lib; { meta = with lib; {
homepage = "https://github.com/mirage/ocaml-ipaddr"; homepage = "https://github.com/mirage/ocaml-ipaddr";

View file

@ -16,7 +16,7 @@ buildDunePackage rec {
propagatedBuildInputs = [ uchar uutf ]; propagatedBuildInputs = [ uchar uutf ];
checkInputs = [ ounit2 ]; checkInputs = [ ounit2 ];
doCheck = lib.versionAtLeast ocaml.version "4.04"; doCheck = lib.versionAtLeast ocaml.version "4.08";
meta = with lib; { meta = with lib; {
homepage = "https://github.com/aantron/markup.ml/"; homepage = "https://github.com/aantron/markup.ml/";

View file

@ -1,4 +1,4 @@
{ buildDunePackage, ocaml_gettext, camomile, ounit, fileutils }: { lib, buildDunePackage, ocaml, ocaml_gettext, camomile, ounit, fileutils }:
buildDunePackage { buildDunePackage {
pname = "gettext-camomile"; pname = "gettext-camomile";
@ -6,7 +6,7 @@ buildDunePackage {
propagatedBuildInputs = [ camomile ocaml_gettext ]; propagatedBuildInputs = [ camomile ocaml_gettext ];
doCheck = true; doCheck = lib.versionAtLeast ocaml.version "4.08";
checkInputs = [ ounit fileutils ]; checkInputs = [ ounit fileutils ];
meta = (builtins.removeAttrs ocaml_gettext.meta [ "mainProgram" ]) // { meta = (builtins.removeAttrs ocaml_gettext.meta [ "mainProgram" ]) // {

View file

@ -1,4 +1,4 @@
{ buildDunePackage, ocaml_gettext, dune-configurator, ounit }: { lib, buildDunePackage, ocaml, ocaml_gettext, dune-configurator, ounit }:
buildDunePackage rec { buildDunePackage rec {
@ -12,7 +12,7 @@ buildDunePackage rec {
propagatedBuildInputs = [ ocaml_gettext ]; propagatedBuildInputs = [ ocaml_gettext ];
doCheck = true; doCheck = lib.versionAtLeast ocaml.version "4.08";
checkInputs = [ ounit ]; checkInputs = [ ounit ];

View file

@ -1,7 +1,7 @@
{ lib, ocaml, buildDunePackage, fetchurl, seq, stdlib-shims, ncurses }: { lib, ocaml, buildDunePackage, fetchurl, seq, stdlib-shims, ncurses }:
buildDunePackage (rec { buildDunePackage rec {
minimalOCamlVersion = "4.04"; minimalOCamlVersion = "4.08";
pname = "ounit2"; pname = "ounit2";
version = "2.2.6"; version = "2.2.6";
@ -14,7 +14,6 @@ buildDunePackage (rec {
propagatedBuildInputs = [ seq stdlib-shims ]; propagatedBuildInputs = [ seq stdlib-shims ];
doCheck = true; doCheck = true;
checkInputs = lib.optional (lib.versionOlder ocaml.version "4.07") ncurses;
meta = with lib; { meta = with lib; {
homepage = "https://github.com/gildor478/ounit"; homepage = "https://github.com/gildor478/ounit";
@ -22,6 +21,4 @@ buildDunePackage (rec {
license = licenses.mit; license = licenses.mit;
maintainers = with maintainers; [ sternenseemann ]; maintainers = with maintainers; [ sternenseemann ];
}; };
} // lib.optionalAttrs (!lib.versionAtLeast ocaml.version "4.08") { }
duneVersion = "1";
})

View file

@ -7,9 +7,7 @@ buildDunePackage rec {
pname = "parse-argv"; pname = "parse-argv";
version = "0.2.0"; version = "0.2.0";
useDune2 = true; minimalOCamlVersion = "4.03";
minimumOCamlVersion = "4.03";
src = fetchurl { src = fetchurl {
url = "https://github.com/mirage/parse-argv/releases/download/v${version}/parse-argv-v${version}.tbz"; url = "https://github.com/mirage/parse-argv/releases/download/v${version}/parse-argv-v${version}.tbz";
@ -18,7 +16,7 @@ buildDunePackage rec {
propagatedBuildInputs = [ astring ]; propagatedBuildInputs = [ astring ];
doCheck = lib.versionAtLeast ocaml.version "4.04"; doCheck = lib.versionAtLeast ocaml.version "4.08";
checkInputs = [ ounit ]; checkInputs = [ ounit ];
meta = { meta = {

View file

@ -52,7 +52,8 @@ buildDunePackage rec {
result result
]; ];
doCheck = lib.versionOlder ocaml.version "5.0"; doCheck = lib.versionAtLeast ocaml.version "4.08"
&& lib.versionOlder ocaml.version "5.0";
checkInputs = [ checkInputs = [
(if lib.versionAtLeast version "5.2" then ounit2 else ounit) (if lib.versionAtLeast version "5.2" then ounit2 else ounit)
]; ];

View file

@ -1,4 +1,4 @@
{ lib, buildDunePackage, fetchFromGitHub, ppxlib, ounit { lib, buildDunePackage, fetchFromGitHub, ocaml, ppxlib, ounit
, ppx_deriving, yojson , ppx_deriving, yojson
}: }:
@ -17,7 +17,6 @@ buildDunePackage rec {
inherit (param) version; inherit (param) version;
minimalOCamlVersion = "4.07"; minimalOCamlVersion = "4.07";
duneVersion = "3";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "ocaml-ppx"; owner = "ocaml-ppx";
@ -28,7 +27,7 @@ buildDunePackage rec {
propagatedBuildInputs = [ ppxlib ppx_deriving yojson ]; propagatedBuildInputs = [ ppxlib ppx_deriving yojson ];
doCheck = true; doCheck = lib.versionAtLeast ocaml.version "4.08";
checkInputs = [ ounit ]; checkInputs = [ ounit ];
meta = { meta = {

View file

@ -4,9 +4,7 @@ buildDunePackage rec {
pname = "rdbg"; pname = "rdbg";
version = "1.199.0"; version = "1.199.0";
duneVersion = "3"; minimalOCamlVersion = "4.08";
minimalOCamlVersion = "4.07";
src = fetchurl { src = fetchurl {
url = "http://www-verimag.imag.fr/DIST-TOOLS/SYNCHRONE/pool/rdbg.v${version}.tgz"; url = "http://www-verimag.imag.fr/DIST-TOOLS/SYNCHRONE/pool/rdbg.v${version}.tgz";

View file

@ -26,7 +26,7 @@ buildDunePackage (rec {
buildInputs = lib.optional doCheck ounit; buildInputs = lib.optional doCheck ounit;
propagatedBuildInputs = [ seq ]; propagatedBuildInputs = [ seq ];
doCheck = lib.versionAtLeast ocaml.version "4.04"; doCheck = lib.versionAtLeast ocaml.version "4.08";
meta = { meta = {
homepage = "https://github.com/ocaml/ocaml-re"; homepage = "https://github.com/ocaml/ocaml-re";

View file

@ -18,14 +18,11 @@ buildDunePackage rec {
sha256 = "sha256-mgZooyfxrKBVQFn01B8PULmFUW9Zq5HJfgHCSJSkJo4="; sha256 = "sha256-mgZooyfxrKBVQFn01B8PULmFUW9Zq5HJfgHCSJSkJo4=";
}; };
useDune2 = true; minimalOCamlVersion = "4.05";
minimumOCamlVersion = "4.05";
propagatedBuildInputs = [ zarith ]; propagatedBuildInputs = [ zarith ];
# the tests fail for 4.05 doCheck = lib.versionAtLeast ocaml.version "4.08";
doCheck = lib.versionAtLeast ocaml.version "4.06";
checkInputs = [ ounit ]; checkInputs = [ ounit ];
meta = { meta = {

View file

@ -1,9 +1,8 @@
{ lib, fetchurl, buildDunePackage, stdlib-shims, ounit2 }: { lib, fetchurl, buildDunePackage, ocaml, stdlib-shims, ounit2 }:
buildDunePackage rec { buildDunePackage rec {
pname = "sha"; pname = "sha";
version = "1.15.4"; version = "1.15.4";
duneVersion = "3";
src = fetchurl { src = fetchurl {
url = "https://github.com/djs55/ocaml-${pname}/releases/download/v${version}/${pname}-${version}.tbz"; url = "https://github.com/djs55/ocaml-${pname}/releases/download/v${version}/${pname}-${version}.tbz";
@ -14,7 +13,7 @@ buildDunePackage rec {
stdlib-shims stdlib-shims
]; ];
doCheck = true; doCheck = lib.versionAtLeast ocaml.version "4.08";
checkInputs = [ checkInputs = [
ounit2 ounit2
]; ];

View file

@ -1,8 +1,8 @@
{ lib, stdenv, fetchurl, ocaml, findlib, ocamlbuild, ounit }: { lib, stdenv, fetchurl, ocaml, findlib, ocamlbuild, ounit }:
let let
# ounit is only available for OCaml >= 4.04 # ounit is only available for OCaml >= 4.08
doCheck = lib.versionAtLeast ocaml.version "4.04"; doCheck = lib.versionAtLeast ocaml.version "4.08";
in in
lib.throwIf (lib.versionAtLeast ocaml.version "5.0") lib.throwIf (lib.versionAtLeast ocaml.version "5.0")