diff --git a/doc/languages-frameworks/ocaml.section.md b/doc/languages-frameworks/ocaml.section.md index d09e35c3a84b..d84b5fd80a1c 100644 --- a/doc/languages-frameworks/ocaml.section.md +++ b/doc/languages-frameworks/ocaml.section.md @@ -21,7 +21,7 @@ pkgs.mkShell { nativeBuildInputs = with ocamlPackages; [ ocaml findlib - dune_2 + pkgs.dune ocaml-lsp ]; # dependencies diff --git a/pkgs/applications/science/logic/abella/default.nix b/pkgs/applications/science/logic/abella/default.nix index b8557f9e7bf3..9e3592b44445 100644 --- a/pkgs/applications/science/logic/abella/default.nix +++ b/pkgs/applications/science/logic/abella/default.nix @@ -4,6 +4,7 @@ fetchurl, rsync, ocamlPackages, + dune, }: stdenv.mkDerivation (finalAttrs: { @@ -19,10 +20,10 @@ stdenv.mkDerivation (finalAttrs: { nativeBuildInputs = [ rsync + dune ] ++ (with ocamlPackages; [ ocaml - dune_3 menhir findlib ]); diff --git a/pkgs/applications/science/logic/coq/default.nix b/pkgs/applications/science/logic/coq/default.nix index c0275c97eafd..e3f5f7619fd6 100644 --- a/pkgs/applications/science/logic/coq/default.nix +++ b/pkgs/applications/science/logic/coq/default.nix @@ -13,6 +13,7 @@ writeText, pkg-config, gnumake42, + dune, customOCamlPackages ? null, ocamlPackages_4_09, ocamlPackages_4_10, @@ -130,7 +131,7 @@ let ocamlPackages.ocaml ocamlPackages.findlib ] - ++ lib.optional (coqAtLeast "8.14") ocamlPackages.dune_3; + ++ lib.optional (coqAtLeast "8.14") dune; ocamlPropagatedBuildInputs = [ ] ++ lib.optional (!coqAtLeast "8.10") ocamlPackages.camlp5 diff --git a/pkgs/applications/science/logic/easycrypt/default.nix b/pkgs/applications/science/logic/easycrypt/default.nix index 27b39fd790c5..bbc37bb7dcd5 100644 --- a/pkgs/applications/science/logic/easycrypt/default.nix +++ b/pkgs/applications/science/logic/easycrypt/default.nix @@ -4,6 +4,7 @@ darwin, fetchFromGitHub, ocamlPackages, + dune, why3, python3, }: @@ -22,7 +23,7 @@ stdenv.mkDerivation rec { nativeBuildInputs = with ocamlPackages; [ - dune_3 + dune findlib menhir ocaml diff --git a/pkgs/applications/science/logic/rocq-core/default.nix b/pkgs/applications/science/logic/rocq-core/default.nix index 2a8a3d7be023..3d76ff2d0fda 100644 --- a/pkgs/applications/science/logic/rocq-core/default.nix +++ b/pkgs/applications/science/logic/rocq-core/default.nix @@ -11,6 +11,7 @@ fetchurl, writeText, pkg-config, + dune, customOCamlPackages ? null, ocamlPackages_4_14, ncurses, @@ -56,7 +57,7 @@ let ocamlNativeBuildInputs = [ ocamlPackages.ocaml ocamlPackages.findlib - ocamlPackages.dune_3 + dune ]; ocamlPropagatedBuildInputs = [ ocamlPackages.zarith ]; self = stdenv.mkDerivation { diff --git a/pkgs/build-support/coq/default.nix b/pkgs/build-support/coq/default.nix index 01719ce243a1..6bbd01da9d2d 100644 --- a/pkgs/build-support/coq/default.nix +++ b/pkgs/build-support/coq/default.nix @@ -6,6 +6,7 @@ which, fetchzip, fetchurl, + dune, }@args: let @@ -190,7 +191,7 @@ stdenv.mkDerivation ( nativeBuildInputs = args.overrideNativeBuildInputs or ( [ which ] - ++ optional useDune coq.ocamlPackages.dune_3 + ++ optional useDune dune ++ optionals (useDune || mlPlugin) [ coq.ocamlPackages.ocaml coq.ocamlPackages.findlib diff --git a/pkgs/build-support/rocq/default.nix b/pkgs/build-support/rocq/default.nix index d9429f0b23b5..8b86867d67d4 100644 --- a/pkgs/build-support/rocq/default.nix +++ b/pkgs/build-support/rocq/default.nix @@ -6,6 +6,7 @@ which, fetchzip, fetchurl, + dune, }@args: let @@ -174,7 +175,7 @@ stdenv.mkDerivation ( nativeBuildInputs = args.overrideNativeBuildInputs or ( [ which ] - ++ optional useDune rocq-core.ocamlPackages.dune_3 + ++ optional useDune dune ++ optionals (useDune || mlPlugin) [ rocq-core.ocamlPackages.ocaml rocq-core.ocamlPackages.findlib diff --git a/pkgs/by-name/ac/acgtk/package.nix b/pkgs/by-name/ac/acgtk/package.nix index 38c494ae8301..ba2b29b42281 100644 --- a/pkgs/by-name/ac/acgtk/package.nix +++ b/pkgs/by-name/ac/acgtk/package.nix @@ -4,6 +4,7 @@ fetchFromGitLab, fetchpatch, ocamlPackages, + dune, }: stdenv.mkDerivation { @@ -39,7 +40,7 @@ stdenv.mkDerivation { menhir ocaml findlib - dune_3 + dune ]; buildInputs = with ocamlPackages; [ diff --git a/pkgs/by-name/do/docfd/package.nix b/pkgs/by-name/do/docfd/package.nix index ed37a05fdd39..98d49517c486 100644 --- a/pkgs/by-name/do/docfd/package.nix +++ b/pkgs/by-name/do/docfd/package.nix @@ -4,7 +4,7 @@ stdenv, fetchFromGitHub, python3, - dune_3, + dune, makeWrapper, pandoc, poppler-utils, @@ -30,7 +30,7 @@ ocamlPackages.buildDunePackage rec { nativeBuildInputs = [ python3 - dune_3 + dune makeWrapper ]; diff --git a/pkgs/by-name/du/dune/package.nix b/pkgs/by-name/du/dune/package.nix new file mode 100644 index 000000000000..9dfc90173f12 --- /dev/null +++ b/pkgs/by-name/du/dune/package.nix @@ -0,0 +1,58 @@ +{ + lib, + stdenv, + fetchurl, + ocamlPackages, + version ? "3.20.2", +}: + +stdenv.mkDerivation { + pname = "dune"; + inherit version; + + src = fetchurl { + url = + let + sfx = lib.optionalString (lib.versions.major version == "2") "site-"; + in + "https://github.com/ocaml/dune/releases/download/${version}/dune-${sfx}${version}.tbz"; + hash = + { + "3.20.2" = "sha256-sahrLWC9tKi5u2hhvfL58opufLXYM86Br+zOue+cpUk="; + "2.9.3" = "sha256:1ml8bxym8sdfz25bx947al7cvsi2zg5lcv7x9w6xb01cmdryqr9y"; + } + ."${version}"; + }; + + nativeBuildInputs = with ocamlPackages; [ + ocaml + findlib + ]; + + strictDeps = true; + + buildFlags = [ "release" ]; + + dontAddPrefix = true; + dontAddStaticConfigureFlags = true; + configurePlatforms = [ ]; + + installFlags = [ + "PREFIX=${placeholder "out"}" + "LIBDIR=$(OCAMLFIND_DESTDIR)" + ]; + + passthru.tests = { + inherit (ocamlPackages) ocaml-lsp dune-release; + }; + + meta = { + homepage = "https://dune.build/"; + description = "Composable build system"; + mainProgram = "dune"; + changelog = "https://github.com/ocaml/dune/raw/${version}/CHANGES.md"; + maintainers = [ lib.maintainers.vbgl ]; + license = lib.licenses.mit; + inherit (ocamlPackages.ocaml.meta) platforms; + }; +} diff --git a/pkgs/by-name/fr/framac/package.nix b/pkgs/by-name/fr/framac/package.nix index b3ef7520555c..2aa780e9df47 100644 --- a/pkgs/by-name/fr/framac/package.nix +++ b/pkgs/by-name/fr/framac/package.nix @@ -8,6 +8,7 @@ ocamlPackages, ltl2ba, coq, + dune, why3, gdk-pixbuf, wrapGAppsHook3, @@ -64,11 +65,11 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ wrapGAppsHook3 + dune ] ++ (with ocamlPackages; [ ocaml findlib - dune_3 menhir ]); diff --git a/pkgs/by-name/ja/jasmin-compiler/package.nix b/pkgs/by-name/ja/jasmin-compiler/package.nix index ea4c89f30ad7..81c386202ce9 100644 --- a/pkgs/by-name/ja/jasmin-compiler/package.nix +++ b/pkgs/by-name/ja/jasmin-compiler/package.nix @@ -2,8 +2,8 @@ stdenv, lib, fetchurl, - dune_3, ocamlPackages, + dune, mpfr, ppl, }: @@ -20,7 +20,7 @@ stdenv.mkDerivation (finalAttrs: { nativeBuildInputs = with ocamlPackages; [ ocaml findlib - dune_3 + dune menhir camlidl cmdliner diff --git a/pkgs/development/compilers/haxe/default.nix b/pkgs/development/compilers/haxe/default.nix index 6b921250bae9..b2d636fd488b 100644 --- a/pkgs/development/compilers/haxe/default.nix +++ b/pkgs/development/compilers/haxe/default.nix @@ -4,6 +4,7 @@ fetchFromGitHub, coreutils, ocaml-ng, + dune, zlib, pcre, pcre2, @@ -23,7 +24,6 @@ let ptmap camlp5 sha - dune_3 luv extlib ] @@ -37,7 +37,6 @@ let ptmap camlp5 sha - dune_3 luv extlib-1-7-7 ]; @@ -61,6 +60,7 @@ let buildInputs = [ zlib neko + dune ] ++ (if lib.versionAtLeast version "4.3" then [ pcre2 ] else [ pcre ]) ++ lib.optional (lib.versionAtLeast version "4.1") mbedtls_2 diff --git a/pkgs/development/coq-modules/itauto/default.nix b/pkgs/development/coq-modules/itauto/default.nix index b7d9e74c9805..da5b40c2923a 100644 --- a/pkgs/development/coq-modules/itauto/default.nix +++ b/pkgs/development/coq-modules/itauto/default.nix @@ -4,6 +4,7 @@ mkCoqDerivation, coq, stdlib, + dune, version ? null, }: @@ -60,7 +61,7 @@ nativeBuildInputs = with coq.ocamlPackages; [ ocaml findlib - dune_3 + dune ]; } ) diff --git a/pkgs/development/ocaml-modules/ocamlc-loc/default.nix b/pkgs/development/ocaml-modules/ocamlc-loc/default.nix index d5ac0d14796d..623291093305 100644 --- a/pkgs/development/ocaml-modules/ocamlc-loc/default.nix +++ b/pkgs/development/ocaml-modules/ocamlc-loc/default.nix @@ -1,14 +1,13 @@ { lib, buildDunePackage, - dune_3, + dune, dyn, }: buildDunePackage { pname = "ocamlc-loc"; - inherit (dune_3) src version; - duneVersion = "3"; + inherit (dune) src version; dontAddPrefix = true; @@ -17,8 +16,6 @@ buildDunePackage { rm -rf vendor/pp ''; - minimalOCamlVersion = "4.08"; - propagatedBuildInputs = [ dyn ]; meta = { diff --git a/pkgs/development/ocaml-modules/ordering/default.nix b/pkgs/development/ocaml-modules/ordering/default.nix index 7776c0462d05..e34d0b6ce948 100644 --- a/pkgs/development/ocaml-modules/ordering/default.nix +++ b/pkgs/development/ocaml-modules/ordering/default.nix @@ -1,14 +1,12 @@ -{ buildDunePackage, dune_3 }: +{ buildDunePackage, dune }: buildDunePackage { pname = "ordering"; - inherit (dune_3) version src; - duneVersion = "3"; - minimalOCamlVersion = "4.08"; + inherit (dune) version src; dontAddPrefix = true; - meta = dune_3.meta // { + meta = dune.meta // { description = "Element ordering"; }; } diff --git a/pkgs/development/ocaml-modules/stdune/default.nix b/pkgs/development/ocaml-modules/stdune/default.nix index bc880cf2125f..985462643b91 100644 --- a/pkgs/development/ocaml-modules/stdune/default.nix +++ b/pkgs/development/ocaml-modules/stdune/default.nix @@ -1,6 +1,6 @@ { buildDunePackage, - dune_3, + dune, dyn, ordering, csexp, @@ -8,8 +8,7 @@ buildDunePackage { pname = "stdune"; - inherit (dune_3) version src; - duneVersion = "3"; + inherit (dune) version src; dontAddPrefix = true; @@ -23,7 +22,7 @@ buildDunePackage { rm -r vendor/csexp ''; - meta = dune_3.meta // { + meta = dune.meta // { description = "Dune's unstable standard library"; }; } diff --git a/pkgs/development/ocaml-modules/xdg/default.nix b/pkgs/development/ocaml-modules/xdg/default.nix index c88f2695e7f4..97bb3a99d98d 100644 --- a/pkgs/development/ocaml-modules/xdg/default.nix +++ b/pkgs/development/ocaml-modules/xdg/default.nix @@ -1,22 +1,18 @@ { lib, buildDunePackage, - dune_3, + dune, }: buildDunePackage { pname = "xdg"; - inherit (dune_3) src version; - - duneVersion = "3"; - minimalOCamlVersion = "4.08"; + inherit (dune) src version; dontAddPrefix = true; meta = { description = "XDG Base Directory Specification"; - inherit (dune_3.meta) homepage; - maintainers = [ ]; + inherit (dune.meta) homepage maintainers; license = lib.licenses.mit; }; } diff --git a/pkgs/development/tools/analysis/flow/default.nix b/pkgs/development/tools/analysis/flow/default.nix index 0ead2df091d8..0fb442737540 100644 --- a/pkgs/development/tools/analysis/flow/default.nix +++ b/pkgs/development/tools/analysis/flow/default.nix @@ -3,6 +3,7 @@ stdenv, fetchFromGitHub, ocamlPackages, + dune, }: stdenv.mkDerivation rec { @@ -27,7 +28,7 @@ stdenv.mkDerivation rec { nativeBuildInputs = with ocamlPackages; [ ocaml - dune_3 + dune findlib ocamlbuild ]; diff --git a/pkgs/development/tools/ocaml/dune/2.nix b/pkgs/development/tools/ocaml/dune/2.nix deleted file mode 100644 index 57963e140391..000000000000 --- a/pkgs/development/tools/ocaml/dune/2.nix +++ /dev/null @@ -1,48 +0,0 @@ -{ - lib, - stdenv, - fetchurl, - ocaml, - findlib, -}: - -if lib.versionOlder ocaml.version "4.08" then - throw "dune 2 is not available for OCaml ${ocaml.version}" -else - - stdenv.mkDerivation rec { - pname = "dune"; - version = "2.9.3"; - - src = fetchurl { - url = "https://github.com/ocaml/dune/releases/download/${version}/dune-site-${version}.tbz"; - sha256 = "sha256:1ml8bxym8sdfz25bx947al7cvsi2zg5lcv7x9w6xb01cmdryqr9y"; - }; - - nativeBuildInputs = [ - ocaml - findlib - ]; - strictDeps = true; - - buildFlags = [ "release" ]; - - dontAddPrefix = true; - dontAddStaticConfigureFlags = true; - configurePlatforms = [ ]; - - installFlags = [ - "PREFIX=${placeholder "out"}" - "LIBDIR=$(OCAMLFIND_DESTDIR)" - ]; - - meta = { - homepage = "https://dune.build/"; - description = "Composable build system"; - mainProgram = "dune"; - changelog = "https://github.com/ocaml/dune/raw/${version}/CHANGES.md"; - maintainers = [ lib.maintainers.vbgl ]; - license = lib.licenses.mit; - inherit (ocaml.meta) platforms; - }; - } diff --git a/pkgs/development/tools/ocaml/dune/3.nix b/pkgs/development/tools/ocaml/dune/3.nix deleted file mode 100644 index 40c6b589ec03..000000000000 --- a/pkgs/development/tools/ocaml/dune/3.nix +++ /dev/null @@ -1,55 +0,0 @@ -{ - lib, - stdenv, - fetchurl, - ocaml, - findlib, - ocaml-lsp, - dune-release, -}: - -if lib.versionOlder ocaml.version "4.08" then - throw "dune 3 is not available for OCaml ${ocaml.version}" -else - - stdenv.mkDerivation rec { - pname = "dune"; - version = "3.20.2"; - - src = fetchurl { - url = "https://github.com/ocaml/dune/releases/download/${version}/dune-${version}.tbz"; - hash = "sha256-sahrLWC9tKi5u2hhvfL58opufLXYM86Br+zOue+cpUk="; - }; - - nativeBuildInputs = [ - ocaml - findlib - ]; - - strictDeps = true; - - buildFlags = [ "release" ]; - - dontAddPrefix = true; - dontAddStaticConfigureFlags = true; - configurePlatforms = [ ]; - - installFlags = [ - "PREFIX=${placeholder "out"}" - "LIBDIR=$(OCAMLFIND_DESTDIR)" - ]; - - passthru.tests = { - inherit ocaml-lsp dune-release; - }; - - meta = { - homepage = "https://dune.build/"; - description = "Composable build system"; - mainProgram = "dune"; - changelog = "https://github.com/ocaml/dune/raw/${version}/CHANGES.md"; - maintainers = [ lib.maintainers.vbgl ]; - license = lib.licenses.mit; - inherit (ocaml.meta) platforms; - }; - } diff --git a/pkgs/development/tools/ocaml/merlin/4.x.nix b/pkgs/development/tools/ocaml/merlin/4.x.nix index 530c9c6ac829..51d46b00b681 100644 --- a/pkgs/development/tools/ocaml/merlin/4.x.nix +++ b/pkgs/development/tools/ocaml/merlin/4.x.nix @@ -3,7 +3,7 @@ replaceVars, fetchurl, ocaml, - dune_3, + dune, buildDunePackage, yojson, csexp, @@ -69,7 +69,7 @@ buildDunePackage { [ (replaceVars (if old-patch then ./fix-paths.patch else ./fix-paths2.patch) { dot-merlin-reader = "${dot-merlin-reader}/bin/dot-merlin-reader"; - dune = "${dune_3}/bin/dune"; + dune = "${dune}/bin/dune"; }) ]; diff --git a/pkgs/tools/audio/liquidsoap/full.nix b/pkgs/tools/audio/liquidsoap/full.nix index 9e1d921b3541..54ffcc4e3540 100644 --- a/pkgs/tools/audio/liquidsoap/full.nix +++ b/pkgs/tools/audio/liquidsoap/full.nix @@ -10,6 +10,7 @@ awscli2, bubblewrap, curl, + dune, ffmpeg, yt-dlp, runtimePackages ? [ @@ -78,7 +79,7 @@ stdenv.mkDerivation { pkg-config which ocamlPackages.ocaml - ocamlPackages.dune_3 + dune ocamlPackages.findlib ocamlPackages.menhir ]; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 3a4b3203986a..c3f7945f5e2f 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -1889,7 +1889,13 @@ with pkgs; inherit (ocamlPackages) dot-merlin-reader; - inherit (ocamlPackages) dune_2 dune_3 dune-release; + inherit (ocamlPackages) dune-release; + + dune_2 = callPackage ../by-name/du/dune/package.nix { + version = "2.9.3"; + }; + + dune_3 = callPackage ../by-name/du/dune/package.nix { }; dvc = with python3.pkgs; toPythonApplication dvc; diff --git a/pkgs/top-level/ocaml-packages.nix b/pkgs/top-level/ocaml-packages.nix index 1d8c79728cfe..b801108f60b9 100644 --- a/pkgs/top-level/ocaml-packages.nix +++ b/pkgs/top-level/ocaml-packages.nix @@ -464,10 +464,6 @@ let dum = callPackage ../development/ocaml-modules/dum { }; - dune_2 = callPackage ../development/tools/ocaml/dune/2.nix { }; - - dune_3 = callPackage ../development/tools/ocaml/dune/3.nix { }; - dune-action-plugin = callPackage ../development/ocaml-modules/dune-action-plugin { }; dune-build-info = callPackage ../development/ocaml-modules/dune-build-info { }; @@ -2249,6 +2245,8 @@ let // lib.optionalAttrs config.allowAliases { biocaml = throw "biocaml has been removed"; # 2025-06-04 chacha = throw "chacha has been removed because it has been marked as broken since at least November 2024. It is now vendored inside mirage-crypto, consider using that instead."; # Added 2025-10-11 + dune_2 = pkgs.dune_2; # Added 2025-12-08 + dune_3 = pkgs.dune_3; # Added 2025-12-08 gd4o = throw "ocamlPackages.gd4o is not maintained, use ocamlPackages.gd instead"; ocaml-vdom = throw "2023-10-09: ocamlPackages.ocaml-vdom was renamed to ocamlPackages.vdom"; ocaml_lwt = throw "ocamlPackages.ocaml_lwt has been renamed to ocamlPackages.lwt"; # Added 2025-12-05