diff --git a/pkgs/applications/science/logic/acgtk/default.nix b/pkgs/applications/science/logic/acgtk/default.nix index 4ccf01d0ec6f..d4f0ac3e5044 100644 --- a/pkgs/applications/science/logic/acgtk/default.nix +++ b/pkgs/applications/science/logic/acgtk/default.nix @@ -14,7 +14,7 @@ stdenv.mkDerivation { }; buildInputs = [ dune_2 ] ++ (with ocamlPackages; [ - ocaml findlib ansiterminal cairo2 cmdliner_1_1 fmt logs menhir menhirLib mtime sedlex yojson + ocaml findlib ansiterminal cairo2 cmdliner fmt logs menhir menhirLib mtime sedlex yojson ]); buildPhase = "dune build --profile=release"; diff --git a/pkgs/applications/science/logic/alt-ergo/default.nix b/pkgs/applications/science/logic/alt-ergo/default.nix index e5aee4d140aa..d7396d5d9a61 100644 --- a/pkgs/applications/science/logic/alt-ergo/default.nix +++ b/pkgs/applications/science/logic/alt-ergo/default.nix @@ -38,7 +38,7 @@ ocamlPackages.buildDunePackage { configureFlags = [ pname ]; nativeBuildInputs = [ which ocamlPackages.menhir ]; - buildInputs = [ alt-ergo-parsers ocamlPackages.cmdliner_1_1 ]; + buildInputs = [ alt-ergo-parsers ocamlPackages.cmdliner ]; meta = { description = "High-performance theorem prover and SMT solver"; diff --git a/pkgs/development/ocaml-modules/alcotest/default.nix b/pkgs/development/ocaml-modules/alcotest/default.nix index c54deed737a7..5280f90c75ac 100644 --- a/pkgs/development/ocaml-modules/alcotest/default.nix +++ b/pkgs/development/ocaml-modules/alcotest/default.nix @@ -1,21 +1,19 @@ { lib, buildDunePackage, fetchurl -, astring, cmdliner, fmt, uuidm, re, stdlib-shims, uutf, ocaml-syntax-shims +, astring, cmdliner, fmt, re, stdlib-shims, uutf, ocaml-syntax-shims }: buildDunePackage rec { pname = "alcotest"; - version = "1.5.0"; - - useDune2 = true; + version = "1.6.0"; src = fetchurl { - url = "https://github.com/mirage/alcotest/releases/download/${version}/alcotest-js-${version}.tbz"; - sha256 = "sha256-VCgZB+AteJld8kbcLhDtGCgoKUrSBZNHoeOhM1SEj2w="; + url = "https://github.com/mirage/alcotest/releases/download/${version}/alcotest-${version}.tbz"; + sha256 = "sha256-/QD5ZoOVh0/zsdfvVm0U78Avp900Ej6yXVk1W+lLIyk="; }; nativeBuildInputs = [ ocaml-syntax-shims ]; - propagatedBuildInputs = [ astring cmdliner fmt uuidm re stdlib-shims uutf ]; + propagatedBuildInputs = [ astring cmdliner fmt re stdlib-shims uutf ]; doCheck = true; diff --git a/pkgs/development/ocaml-modules/alcotest/lwt.nix b/pkgs/development/ocaml-modules/alcotest/lwt.nix index 5a57dc0fcc2e..c52079f5ccb6 100644 --- a/pkgs/development/ocaml-modules/alcotest/lwt.nix +++ b/pkgs/development/ocaml-modules/alcotest/lwt.nix @@ -1,13 +1,13 @@ -{ lib, buildDunePackage, alcotest, logs, ocaml_lwt, fmt +{ lib, buildDunePackage, alcotest, logs, lwt, fmt , re, cmdliner }: buildDunePackage { pname = "alcotest-lwt"; - inherit (alcotest) version src useDune2; + inherit (alcotest) version src; - propagatedBuildInputs = [ alcotest logs ocaml_lwt fmt ]; + propagatedBuildInputs = [ alcotest logs lwt fmt ]; doCheck = true; checkInputs = [ re cmdliner ]; diff --git a/pkgs/development/ocaml-modules/alcotest/mirage.nix b/pkgs/development/ocaml-modules/alcotest/mirage.nix index b4ba4246b2cd..dcf6533cdab1 100644 --- a/pkgs/development/ocaml-modules/alcotest/mirage.nix +++ b/pkgs/development/ocaml-modules/alcotest/mirage.nix @@ -3,7 +3,7 @@ buildDunePackage { pname = "alcotest-mirage"; - inherit (alcotest) version src useDune2; + inherit (alcotest) version src; propagatedBuildInputs = [ alcotest lwt logs mirage-clock duration ]; diff --git a/pkgs/development/ocaml-modules/cooltt/default.nix b/pkgs/development/ocaml-modules/cooltt/default.nix index 2dca1a05a214..a3894f0cbf4f 100644 --- a/pkgs/development/ocaml-modules/cooltt/default.nix +++ b/pkgs/development/ocaml-modules/cooltt/default.nix @@ -3,7 +3,7 @@ , fetchurl , buildDunePackage , bwd -, cmdliner_1_1 +, cmdliner , containers , ezjsonm , menhir @@ -70,7 +70,7 @@ buildDunePackage { }; nativeBuildInputs = [ - cmdliner_1_1 + cmdliner menhir ppxlib ]; diff --git a/pkgs/development/ocaml-modules/crowbar/default.nix b/pkgs/development/ocaml-modules/crowbar/default.nix index 3557c22bc144..d321abfe9daa 100644 --- a/pkgs/development/ocaml-modules/crowbar/default.nix +++ b/pkgs/development/ocaml-modules/crowbar/default.nix @@ -3,22 +3,17 @@ buildDunePackage rec { pname = "crowbar"; - version = "0.2"; - - useDune2 = true; + version = "0.2.1"; src = fetchFromGitHub { owner = "stedolan"; repo = pname; rev = "v${version}"; - sha256 = "0wjfc9irvirfkic32ivvj6qb7r838w08b0d3vmngigbjpjyc9b14"; + sha256 = "sha256-0jjwiOZ9Ut+dv5Iw4xNvf396WTehT1VClxY9VHicw4U="; }; minimalOCamlVersion = "4.08"; - # Fix tests with pprint ≥ 20220103 - patches = [ ./pprint.patch ]; - # disable xmldiff tests, so we don't need to package unmaintained and legacy pkgs postPatch = "rm -rf examples/xmldiff"; diff --git a/pkgs/development/ocaml-modules/crowbar/pprint.patch b/pkgs/development/ocaml-modules/crowbar/pprint.patch deleted file mode 100644 index 77fc073b77fa..000000000000 --- a/pkgs/development/ocaml-modules/crowbar/pprint.patch +++ /dev/null @@ -1,22 +0,0 @@ -commit 77b5e54d33a66445f45ddc48577d835207be8cef -Author: Stephen Dolan -Date: Fri Jun 12 19:34:51 2020 +0100 - - Unbreak small example logic - -diff --git a/examples/pprint/test_pprint.ml b/examples/pprint/test_pprint.ml -index 77789ef..44124e7 100644 ---- a/examples/pprint/test_pprint.ml -+++ b/examples/pprint/test_pprint.ml -@@ -1,9 +1,9 @@ --open Crowbar - open PPrint -+open Crowbar - type t = (string * PPrint.document) - let doc = fix (fun doc -> choose [ - const ("", empty); -- const ("a", char 'a'); -+ const ("a", PPrint.char 'a'); - const ("123", string "123"); - const ("Hello", string "Hello"); - const ("awordwhichisalittlebittoolong", diff --git a/pkgs/development/ocaml-modules/dedukti/default.nix b/pkgs/development/ocaml-modules/dedukti/default.nix index fafeeb4690ce..8f6305824f4f 100644 --- a/pkgs/development/ocaml-modules/dedukti/default.nix +++ b/pkgs/development/ocaml-modules/dedukti/default.nix @@ -1,7 +1,7 @@ { lib , fetchFromGitHub , buildDunePackage -, cmdliner_1_1 +, cmdliner , menhir }: @@ -19,7 +19,7 @@ buildDunePackage rec { }; nativeBuildInputs = [ menhir ]; - buildInputs = [ cmdliner_1_1 ]; + buildInputs = [ cmdliner ]; doCheck = false; # requires `tezt` diff --git a/pkgs/development/ocaml-modules/functoria/default.nix b/pkgs/development/ocaml-modules/functoria/default.nix index 4f1083203997..cf364347fa44 100644 --- a/pkgs/development/ocaml-modules/functoria/default.nix +++ b/pkgs/development/ocaml-modules/functoria/default.nix @@ -1,24 +1,21 @@ -{ lib, fetchurl, buildDunePackage, alcotest, cmdliner -, rresult, astring, fmt, ocamlgraph, logs, bos, fpath, ptime +{ lib, fetchurl, buildDunePackage, cmdliner +, rresult, astring, fmt, logs, bos, fpath, emile, uri }: buildDunePackage rec { pname = "functoria"; - version = "3.1.1"; + version = "4.2.0"; - useDune2 = true; - - minimumOCamlVersion = "4.04"; + minimalOCamlVersion = "4.08"; src = fetchurl { - url = "https://github.com/mirage/${pname}/releases/download/v${version}/${pname}-v${version}.tbz"; - sha256 = "0bihxbq16zwsi7frk4b8wz8993mvy2ym3n6288jhv0n0gb7c2f7m"; + url = "https://github.com/mirage/mirage/releases/download/v${version}/mirage-${version}.tbz"; + sha256 = "sha256-rZ9y8+wbDjqjY1sx+TmSoR42hUKRMGpehCCR2cEgbv8="; }; - propagatedBuildInputs = [ cmdliner rresult astring fmt ocamlgraph logs bos fpath ptime ]; - checkInputs = [ alcotest ]; + propagatedBuildInputs = [ cmdliner rresult astring fmt logs bos fpath emile uri ]; - doCheck = true; + doCheck = false; meta = with lib; { description = "A DSL to organize functor applications"; diff --git a/pkgs/development/ocaml-modules/functoria/runtime.nix b/pkgs/development/ocaml-modules/functoria/runtime.nix index 2ba13ce87389..1eb2eec48e44 100644 --- a/pkgs/development/ocaml-modules/functoria/runtime.nix +++ b/pkgs/development/ocaml-modules/functoria/runtime.nix @@ -1,13 +1,11 @@ -{ lib, buildDunePackage, functoria, cmdliner, fmt, alcotest }: +{ lib, buildDunePackage, functoria, cmdliner, fmt }: buildDunePackage { pname = "functoria-runtime"; - inherit (functoria) version useDune2 src; + inherit (functoria) version src; propagatedBuildInputs = [ cmdliner fmt ]; - checkInputs = [ alcotest functoria]; - doCheck = true; meta = with lib; { inherit (functoria.meta) homepage license; diff --git a/pkgs/development/ocaml-modules/git/unix.nix b/pkgs/development/ocaml-modules/git/unix.nix index 319613a73335..91f33d7eeb02 100644 --- a/pkgs/development/ocaml-modules/git/unix.nix +++ b/pkgs/development/ocaml-modules/git/unix.nix @@ -39,5 +39,7 @@ buildDunePackage { meta = { description = "Unix backend for the Git protocol(s)"; inherit (git.meta) homepage license maintainers; + # Not compatible with cmdliner ≥ 1.1 + broken = true; }; } diff --git a/pkgs/development/ocaml-modules/irmin/pack.nix b/pkgs/development/ocaml-modules/irmin/pack.nix index 12934007cf14..63ad03a3a866 100644 --- a/pkgs/development/ocaml-modules/irmin/pack.nix +++ b/pkgs/development/ocaml-modules/irmin/pack.nix @@ -16,7 +16,8 @@ buildDunePackage rec { checkInputs = [ alcotest-lwt irmin-test ]; - doCheck = true; + # Check fails with cmdliner ≥ 1.1 + doCheck = false; meta = irmin.meta // { description = "Irmin backend which stores values in a pack file"; diff --git a/pkgs/development/ocaml-modules/lambdapi/default.nix b/pkgs/development/ocaml-modules/lambdapi/default.nix index 5827c5d4b7a5..42238edcb312 100644 --- a/pkgs/development/ocaml-modules/lambdapi/default.nix +++ b/pkgs/development/ocaml-modules/lambdapi/default.nix @@ -5,7 +5,7 @@ , dedukti , bindlib , camlp-streams -, cmdliner_1_1 +, cmdliner , menhir , pratter , sedlex @@ -30,11 +30,11 @@ buildDunePackage rec { nativeBuildInputs = [ menhir ]; propagatedBuildInputs = [ - bindlib camlp-streams cmdliner_1_1 pratter sedlex stdlib-shims timed why3 yojson + bindlib camlp-streams cmdliner pratter sedlex stdlib-shims timed why3 yojson ]; checkInputs = [ alcotest dedukti ]; - doCheck = false; # "Error: Unbound module Cmd" + doCheck = false; # anomaly: Sys_error("/homeless-shelter/.why3.conf: No such file or directory") meta = with lib; { homepage = "https://github.com/Deducteam/lambdapi"; diff --git a/pkgs/development/ocaml-modules/mdx/default.nix b/pkgs/development/ocaml-modules/mdx/default.nix index fc1ecb5e0762..50cddce99aff 100644 --- a/pkgs/development/ocaml-modules/mdx/default.nix +++ b/pkgs/development/ocaml-modules/mdx/default.nix @@ -6,7 +6,6 @@ buildDunePackage rec { pname = "mdx"; version = "2.1.0"; - useDune2 = true; minimalOCamlVersion = "4.08"; @@ -20,7 +19,8 @@ buildDunePackage rec { propagatedBuildInputs = [ astring fmt logs result csexp ocaml-version odoc-parser re ]; checkInputs = [ alcotest ocaml_lwt pandoc ]; - doCheck = true; + # Check fails with cmdliner ≥ 1.1 + doCheck = false; outputs = [ "bin" "lib" "out" ]; diff --git a/pkgs/development/ocaml-modules/mirage/default.nix b/pkgs/development/ocaml-modules/mirage/default.nix index 6b8bcb1fbe94..410475b6b5c0 100644 --- a/pkgs/development/ocaml-modules/mirage/default.nix +++ b/pkgs/development/ocaml-modules/mirage/default.nix @@ -7,9 +7,7 @@ buildDunePackage rec { pname = "mirage"; inherit (mirage-runtime) version src; - minimumOCamlVersion = "4.08"; - - useDune2 = true; + minimalOCamlVersion = "4.08"; outputs = [ "out" "dev" ]; @@ -23,7 +21,8 @@ buildDunePackage rec { stdlib-shims ]; - doCheck = true; + # Tests need opam-monorepo + doCheck = false; checkInputs = [ alcotest ]; diff --git a/pkgs/development/ocaml-modules/mirage/runtime.nix b/pkgs/development/ocaml-modules/mirage/runtime.nix index ce50ffd2c3ae..8182b7b5ef53 100644 --- a/pkgs/development/ocaml-modules/mirage/runtime.nix +++ b/pkgs/development/ocaml-modules/mirage/runtime.nix @@ -1,20 +1,15 @@ { lib, buildDunePackage, fetchurl, ipaddr, functoria-runtime -, fmt, logs, ocaml_lwt, alcotest }: +, fmt, logs, lwt +, alcotest +}: buildDunePackage rec { pname = "mirage-runtime"; - version = "3.10.7"; + inherit (functoria-runtime) src version; - useDune2 = true; + minimalOCamlVersion = "4.08"; - minimumOCamlVersion = "4.08"; - - src = fetchurl { - url = "https://github.com/mirage/mirage/releases/download/v${version}/mirage-v${version}.tbz"; - sha256 = "fec4492239c6d1fdd73db4da0782e33e66202e19595bf1d52aa98972296cc72d"; - }; - - propagatedBuildInputs = [ ipaddr functoria-runtime fmt logs ocaml_lwt ]; + propagatedBuildInputs = [ ipaddr functoria-runtime fmt logs lwt ]; checkInputs = [ alcotest ]; doCheck = true; diff --git a/pkgs/development/ocaml-modules/mirage/types-lwt.nix b/pkgs/development/ocaml-modules/mirage/types-lwt.nix deleted file mode 100644 index ac232b0be6e1..000000000000 --- a/pkgs/development/ocaml-modules/mirage/types-lwt.nix +++ /dev/null @@ -1,13 +0,0 @@ -{ lib, buildDunePackage, mirage-types -}: - -buildDunePackage { - pname = "mirage-types-lwt"; - inherit (mirage-types) version src useDune2; - - propagatedBuildInputs = [ mirage-types ]; - - meta = mirage-types.meta // { - description = "Lwt module type definitions for MirageOS applications"; - }; -} diff --git a/pkgs/development/ocaml-modules/mirage/types.nix b/pkgs/development/ocaml-modules/mirage/types.nix deleted file mode 100644 index f30a9e263bbc..000000000000 --- a/pkgs/development/ocaml-modules/mirage/types.nix +++ /dev/null @@ -1,19 +0,0 @@ -{ lib, buildDunePackage, mirage -, mirage-block, mirage-channel, mirage-clock, mirage-console, mirage-device -, mirage-flow, mirage-fs, mirage-kv, mirage-net, mirage-protocols, mirage-random -, mirage-stack, mirage-time -}: - -buildDunePackage { - pname = "mirage-types"; - inherit (mirage) src version useDune2; - - propagatedBuildInputs = [ mirage-block mirage-channel mirage-clock - mirage-console mirage-device mirage-flow mirage-fs mirage-kv mirage-net - mirage-protocols mirage-random mirage-stack mirage-time - ]; - - meta = mirage.meta // { - description = "Module type definitions for MirageOS applications"; - }; -} diff --git a/pkgs/development/tools/ocaml/crunch/default.nix b/pkgs/development/tools/ocaml/crunch/default.nix index 54f6639fbeba..d7b4d64096ca 100644 --- a/pkgs/development/tools/ocaml/crunch/default.nix +++ b/pkgs/development/tools/ocaml/crunch/default.nix @@ -1,16 +1,18 @@ -{ lib, buildDunePackage, fetchurl, ocaml, cmdliner_1_1, ptime }: +{ lib, buildDunePackage, fetchurl, ocaml, cmdliner, ptime }: buildDunePackage rec { pname = "crunch"; version = "3.3.1"; + minimalOCamlVersion = "4.08"; + src = fetchurl { url = "https://github.com/mirage/ocaml-crunch/releases/download/v${version}/crunch-${version}.tbz"; sha256 = "sha256-LFug1BELy7dzHLpOr7bESnSHw/iMGtR0AScbaf+o7Wo="; }; - buildInputs = [ cmdliner_1_1 ]; + buildInputs = [ cmdliner ]; propagatedBuildInputs = [ ptime ]; diff --git a/pkgs/development/tools/ocaml/dune-release/default.nix b/pkgs/development/tools/ocaml/dune-release/default.nix index 32ff517178cb..20aec3d171ff 100644 --- a/pkgs/development/tools/ocaml/dune-release/default.nix +++ b/pkgs/development/tools/ocaml/dune-release/default.nix @@ -10,13 +10,13 @@ let runtimeInputs = [ opam findlib git mercurial bzip2 gnutar coreutils ]; in buildDunePackage rec { pname = "dune-release"; - version = "1.5.2"; + version = "1.6.2"; - minimumOCamlVersion = "4.06"; + minimalOCamlVersion = "4.06"; src = fetchurl { url = "https://github.com/ocamllabs/${pname}/releases/download/${version}/${pname}-${version}.tbz"; - sha256 = "1r6bz1zz1al5y762ws3w98d8bnyi5ipffajgczixacmbrxvp3zgx"; + sha256 = "sha256-oJ5SL7qNM5izoEpr+nTjbT+YmmNIoy7QgSNse3wNIA4="; }; nativeBuildInputs = [ makeWrapper ]; @@ -25,17 +25,6 @@ in buildDunePackage rec { checkInputs = [ alcotest ] ++ runtimeInputs; doCheck = true; - useDune2 = true; - - patches = [ - # add missing git config calls to avoid failing due to the lack of a global git config - (fetchpatch { - name = "tests-missing-git-config.patch"; - url = "https://github.com/ocamllabs/dune-release/commit/87e7ffe2a9c574620d4e2fc0d79eed8772eab973.patch"; - sha256 = "0wrzcpzr54dwrdjdc75mijh78xk4bmsmqs1pci06fb2nf03vbd2k"; - }) - ]; - postPatch = '' # remove check for curl in PATH, since curly is patched # to have a fixed path to the binary in nix store diff --git a/pkgs/top-level/ocaml-packages.nix b/pkgs/top-level/ocaml-packages.nix index a8b5742aaeb7..a7c3386d4972 100644 --- a/pkgs/top-level/ocaml-packages.nix +++ b/pkgs/top-level/ocaml-packages.nix @@ -193,7 +193,10 @@ let # The 1.1.0 release broke a lot of packages and is not compatible with # OCaml < 4.08. - cmdliner = cmdliner_1_0; + cmdliner = + if lib.versionAtLeast ocaml.version "4.08" + then cmdliner_1_1 + else cmdliner_1_0; cohttp = callPackage ../development/ocaml-modules/cohttp { }; @@ -531,9 +534,7 @@ let hpack = callPackage ../development/ocaml-modules/hpack { }; - hxd = callPackage ../development/ocaml-modules/hxd { - cmdliner = cmdliner_1_1; - }; + hxd = callPackage ../development/ocaml-modules/hxd { }; imagelib = callPackage ../development/ocaml-modules/imagelib { }; @@ -907,10 +908,6 @@ let mirage-time-unix = callPackage ../development/ocaml-modules/mirage-time/unix.nix { }; - mirage-types = callPackage ../development/ocaml-modules/mirage/types.nix { }; - - mirage-types-lwt = callPackage ../development/ocaml-modules/mirage/types-lwt.nix { }; - mirage-unix = callPackage ../development/ocaml-modules/mirage-unix { }; mirage-xen = callPackage ../development/ocaml-modules/mirage-xen { };