Merge pull request #231536 from vbgl/ounit2

ocamlPackages.ounit2: disable for OCaml < 4.08
This commit is contained in:
Ulrik Strid 2023-05-15 11:18:34 +02:00 committed by GitHub
commit f0e4eea013
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
23 changed files with 42 additions and 116 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 {
pname = "cfstream";
version = "1.3.2";
duneVersion = "3";
minimalOCamlVersion = "4.04.1";
src = fetchFromGitHub {
@ -23,7 +21,7 @@ buildDunePackage rec {
checkInputs = [ ounit ];
propagatedBuildInputs = [ camlp-streams core_kernel ];
doCheck = true;
doCheck = lib.versionAtLeast ocaml.version "4.08";
meta = with lib; {
inherit (src.meta) homepage;

View file

@ -36,7 +36,7 @@ stdenv.mkDerivation rec {
checkInputs = [
ounit
];
doCheck = true;
doCheck = lib.versionAtLeast ocaml.version "4.08";
preInstall = "mkdir -p $OCAMLFIND_DESTDIR";
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 {
pname = "diet";
version = "0.4";
useDune2 = true;
src = fetchurl {
url =
"https://github.com/mirage/ocaml-diet/releases/download/v${version}/diet-v${version}.tbz";
sha256 = "96acac2e4fdedb5f47dd8ad2562e723d85ab59cd1bd85554df21ec907b071741";
};
minimumOCamlVersion = "4.03";
minimalOCamlVersion = "4.03";
propagatedBuildInputs = [ stdlib-shims ];
doCheck = true;
doCheck = lib.versionAtLeast ocaml.version "4.08";
checkInputs = [ ounit ];
meta = with lib; {

View file

@ -1,54 +0,0 @@
{stdenv, lib, fetchurl, ocaml, findlib, ounit, expat}:
let
pname = "ocaml-expat";
testcase = fetchurl {
url = "http://www.w3.org/TR/1998/REC-xml-19980210.xml";
sha256 = "00a3gsfvlkdhmcbziqhvpvy1zmcgbcihfqwcvl6ay03zf7gvw0k1";
};
in
stdenv.mkDerivation rec {
name = "${pname}-${version}";
version = "0.9.1";
src = fetchurl {
url = "http://www.xs4all.nl/~mmzeeman/ocaml/${pname}-${version}.tar.gz";
sha256 = "16n2j3y0jc9xgqyshw9plrwqnjiz30vnpbhahmgxlidbycw8rgjz";
};
nativeBuildInputs = [ocaml findlib ];
buildInputs = [ ounit expat];
strictDeps = true;
createFindlibDestdir = true;
patches = [ ./unittest.patch ];
postPatch = ''
substituteInPlace "unittest.ml" \
--replace "/home/maas/xml-samples/REC-xml-19980210.xml.txt" "${testcase}"
substituteInPlace Makefile --replace "EXPAT_LIBDIR=/usr/local/lib" "EXPAT_LIBDIR=${expat.out}/lib" \
--replace "EXPAT_INCDIR=/usr/local/include" "EXPAT_INCDIR=${expat.dev}/include" \
--replace "gcc" "\$(CC)"
'';
dontConfigure = true; # Skip configure
buildPhase = ''
make all allopt
'';
doCheck = true;
checkTarget = "testall";
meta = {
homepage = "http://www.xs4all.nl/~mmzeeman/ocaml/";
description = "An ocaml wrapper for the Expat XML parsing library";
license = lib.licenses.mit;
maintainers = [ lib.maintainers.roconnor ];
};
}

View file

@ -1,5 +1,8 @@
{ stdenv, lib, fetchFromGitHub, expat, ocaml, findlib, ounit }:
lib.throwIfNot (lib.versionAtLeast ocaml.version "4.02")
"ocaml_expat is not available for OCaml ${ocaml.version}"
stdenv.mkDerivation rec {
pname = "ocaml${ocaml.version}-expat";
version = "1.1.0";
@ -16,12 +19,13 @@ stdenv.mkDerivation rec {
'';
nativeBuildInputs = [ ocaml findlib ];
buildInputs = [ expat ounit ];
buildInputs = [ expat ];
strictDeps = true;
doCheck = lib.versionOlder ocaml.version "4.06";
doCheck = lib.versionAtLeast ocaml.version "4.08";
checkTarget = "testall";
checkInputs = [ ounit ];
createFindlibDestdir = true;

View file

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

View file

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

View file

@ -1,4 +1,4 @@
{ lib, fetchurl, buildDunePackage
{ lib, fetchurl, buildDunePackage, ocaml
, ppx_sexp_conv, ounit2
}:
@ -7,7 +7,6 @@ buildDunePackage rec {
version = "5.4.0";
minimalOCamlVersion = "4.04";
duneVersion = "3";
src = fetchurl {
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 ];
doCheck = true;
doCheck = lib.versionAtLeast ocaml.version "4.08";
meta = with lib; {
homepage = "https://github.com/mirage/ocaml-ipaddr";

View file

@ -16,7 +16,7 @@ buildDunePackage rec {
propagatedBuildInputs = [ uchar uutf ];
checkInputs = [ ounit2 ];
doCheck = lib.versionAtLeast ocaml.version "4.04";
doCheck = lib.versionAtLeast ocaml.version "4.08";
meta = with lib; {
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 {
pname = "gettext-camomile";
@ -6,7 +6,7 @@ buildDunePackage {
propagatedBuildInputs = [ camomile ocaml_gettext ];
doCheck = true;
doCheck = lib.versionAtLeast ocaml.version "4.08";
checkInputs = [ ounit fileutils ];
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 {
@ -12,7 +12,7 @@ buildDunePackage rec {
propagatedBuildInputs = [ ocaml_gettext ];
doCheck = true;
doCheck = lib.versionAtLeast ocaml.version "4.08";
checkInputs = [ ounit ];

View file

@ -1,7 +1,7 @@
{ lib, ocaml, buildDunePackage, fetchurl, seq, stdlib-shims, ncurses }:
buildDunePackage (rec {
minimalOCamlVersion = "4.04";
buildDunePackage rec {
minimalOCamlVersion = "4.08";
pname = "ounit2";
version = "2.2.6";
@ -14,7 +14,6 @@ buildDunePackage (rec {
propagatedBuildInputs = [ seq stdlib-shims ];
doCheck = true;
checkInputs = lib.optional (lib.versionOlder ocaml.version "4.07") ncurses;
meta = with lib; {
homepage = "https://github.com/gildor478/ounit";
@ -22,6 +21,4 @@ buildDunePackage (rec {
license = licenses.mit;
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";
version = "0.2.0";
useDune2 = true;
minimumOCamlVersion = "4.03";
minimalOCamlVersion = "4.03";
src = fetchurl {
url = "https://github.com/mirage/parse-argv/releases/download/v${version}/parse-argv-v${version}.tbz";
@ -18,7 +16,7 @@ buildDunePackage rec {
propagatedBuildInputs = [ astring ];
doCheck = lib.versionAtLeast ocaml.version "4.04";
doCheck = lib.versionAtLeast ocaml.version "4.08";
checkInputs = [ ounit ];
meta = {

View file

@ -52,7 +52,8 @@ buildDunePackage rec {
result
];
doCheck = lib.versionOlder ocaml.version "5.0";
doCheck = lib.versionAtLeast ocaml.version "4.08"
&& lib.versionOlder ocaml.version "5.0";
checkInputs = [
(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
}:
@ -17,7 +17,6 @@ buildDunePackage rec {
inherit (param) version;
minimalOCamlVersion = "4.07";
duneVersion = "3";
src = fetchFromGitHub {
owner = "ocaml-ppx";
@ -28,7 +27,7 @@ buildDunePackage rec {
propagatedBuildInputs = [ ppxlib ppx_deriving yojson ];
doCheck = true;
doCheck = lib.versionAtLeast ocaml.version "4.08";
checkInputs = [ ounit ];
meta = {

View file

@ -4,9 +4,7 @@ buildDunePackage rec {
pname = "rdbg";
version = "1.199.0";
duneVersion = "3";
minimalOCamlVersion = "4.07";
minimalOCamlVersion = "4.08";
src = fetchurl {
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;
propagatedBuildInputs = [ seq ];
doCheck = lib.versionAtLeast ocaml.version "4.04";
doCheck = lib.versionAtLeast ocaml.version "4.08";
meta = {
homepage = "https://github.com/ocaml/ocaml-re";

View file

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

View file

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

View file

@ -1,4 +1,4 @@
{ lib, fetchFromGitHub, ocamlPackages, buildOasisPackage, ounit, extlib, num }:
{ lib, fetchFromGitHub, ocamlPackages, buildOasisPackage, extlib, num }:
buildOasisPackage rec {
pname = "tcslib";
@ -13,7 +13,6 @@ buildOasisPackage rec {
sha256 = "05g6m82blsccq8wx8knxv6a5fzww7hi624jx91f9h87nk2fsplhi";
};
buildInputs = [ ounit ];
propagatedBuildInputs = [ extlib num ];
meta = {

View file

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

View file

@ -1107,10 +1107,7 @@ let
ocaml_cryptgps = callPackage ../development/ocaml-modules/cryptgps { };
ocaml_expat =
if lib.versionAtLeast ocaml.version "4.02"
then callPackage ../development/ocaml-modules/expat { }
else callPackage ../development/ocaml-modules/expat/0.9.nix { };
ocaml_expat = callPackage ../development/ocaml-modules/expat { };
ocaml-freestanding = callPackage ../development/ocaml-modules/ocaml-freestanding { };