dune_3: move out of ocamlPackages

This commit is contained in:
Vincent Laporte 2025-12-08 15:53:38 +01:00
parent 25527a884b
commit 72b918494c
No known key found for this signature in database
25 changed files with 109 additions and 149 deletions

View file

@ -21,7 +21,7 @@ pkgs.mkShell {
nativeBuildInputs = with ocamlPackages; [
ocaml
findlib
dune_2
pkgs.dune
ocaml-lsp
];
# dependencies

View file

@ -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
]);

View file

@ -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

View file

@ -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

View file

@ -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 {

View file

@ -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

View file

@ -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

View file

@ -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; [

View file

@ -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
];

View file

@ -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;
};
}

View file

@ -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
]);

View file

@ -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

View file

@ -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

View file

@ -4,6 +4,7 @@
mkCoqDerivation,
coq,
stdlib,
dune,
version ? null,
}:
@ -60,7 +61,7 @@
nativeBuildInputs = with coq.ocamlPackages; [
ocaml
findlib
dune_3
dune
];
}
)

View file

@ -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 = {

View file

@ -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";
};
}

View file

@ -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";
};
}

View file

@ -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;
};
}

View file

@ -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
];

View file

@ -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;
};
}

View file

@ -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;
};
}

View file

@ -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";
})
];

View file

@ -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
];

View file

@ -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;

View file

@ -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