push sheeet
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s

This commit is contained in:
Dark Steveneq
2025-10-09 14:15:47 +02:00
commit 646b892680
49168 changed files with 5897842 additions and 0 deletions

View File

@@ -0,0 +1,106 @@
{
lib,
replaceVars,
fetchurl,
ocaml,
dune_3,
buildDunePackage,
yojson,
csexp,
merlin-lib,
dot-merlin-reader,
jq,
menhir,
menhirLib,
menhirSdk,
# Each releases of Merlin support a limited range of versions of OCaml.
version ?
{
"4.12.0" = "4.7-412";
"4.12.1" = "4.7-412";
"4.13.0" = "4.7-413";
"4.13.1" = "4.7-413";
"4.14.0" = "4.19-414";
"4.14.1" = "4.19-414";
"4.14.2" = "4.19-414";
"5.0.0" = "4.14-500";
"5.1.0" = "4.17.1-501";
"5.1.1" = "4.17.1-501";
"5.2.0" = "5.3-502";
"5.2.1" = "5.3-502";
"5.3.0" = "5.6-503";
}
."${ocaml.version}",
}:
let
hashes = {
"4.7-412" = "sha256-0U3Ia7EblKULNy8AuXFVKACZvGN0arYJv7BWiBRgT0Y=";
"4.7-413" = "sha256-aVmGWS4bJBLuwsxDKsng/n0A6qlyJ/pnDTcYab/5gyU=";
"4.14-500" = "sha256-7CPzJPh1UgzYiX8wPMbU5ZXz1wAJFNQQcp8WuGrR1w4=";
"4.16-414" = "sha256-xekZdfPfVoSeGzBvNWwxcJorE519V2NLjSHkcyZvzy0="; # Used by ocaml-lsp
"4.16-501" = "sha256-2lvzCbBAZFwpKuRXLMagpwDb0rz8mWrBPI5cODbCHiY="; # Used by ocaml-lsp
"4.18-414" = "sha256-9tb3omYUHjWMGoaWEsgTXIWRhdVH6julya17tn/jDME=";
"4.19-414" = "sha256-YKYw9ZIDqc5wR6XwTQ8jmUWWDaxvOBApIuMottJlc4Q=";
"4.17.1-501" = "sha256-N2cHqocfCeljlFbT++S4miHJrXXHdOlMu75n+EKwpQA=";
"5.3-502" = "sha256-LOpG8SOX+m4x7wwNT14Rwc/ZFu5JQgaUAFyV67OqJLw=";
"5.4.1-503" = "sha256-SbO0x3jBISX8dAXnN5CwsxLV15dJ3XPUg4tlYqJTMCI=";
"5.6-503" = "sha256-sNytCSqq96I/ZauaCJ6HYb1mXMcjV5CeCsbCGC9PwtQ=";
};
in
buildDunePackage {
pname = "merlin";
inherit version;
src = fetchurl {
url = "https://github.com/ocaml/merlin/releases/download/v${version}/merlin-${version}.tbz";
sha256 = hashes."${version}";
};
patches =
let
old-patch = lib.versionOlder version "4.17";
in
[
(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";
})
];
strictDeps = true;
nativeBuildInputs = [
menhir
jq
];
buildInputs = [
dot-merlin-reader
yojson
(if lib.versionAtLeast version "4.7-414" then merlin-lib else csexp)
menhirSdk
menhirLib
];
doCheck = false;
checkPhase = ''
runHook preCheck
patchShebangs tests/merlin-wrapper
dune runtest # filtering with -p disables tests
runHook postCheck
'';
meta = with lib; {
description = "Editor-independent tool to ease the development of programs in OCaml";
homepage = "https://github.com/ocaml/merlin";
license = licenses.mit;
mainProgram = "ocamlmerlin";
maintainers = [
maintainers.vbgl
maintainers.sternenseemann
];
};
}

View File

@@ -0,0 +1,55 @@
{
lib,
fetchurl,
fetchpatch,
buildDunePackage,
replaceVars,
dot-merlin-reader,
dune_2,
yojson,
csexp,
result,
menhirSdk,
}:
buildDunePackage rec {
pname = "merlin";
version = "3.8.0";
src = fetchurl {
url = "https://github.com/ocaml/merlin/releases/download/v${version}/merlin-${version}.tbz";
sha256 = "sha256-wmBGNwXL3BduF4o1sUXtAOUHJ4xmMvsWAxl/QdNj/28=";
};
minimalOCamlVersion = "4.02.3";
patches = [
(replaceVars ./fix-paths.patch {
dot-merlin-reader = "${dot-merlin-reader}/bin/dot-merlin-reader";
dune = "${dune_2}/bin/dune";
})
# https://github.com/ocaml/merlin/pull/1798
(fetchpatch {
name = "vim-python-12-syntax-warning-fix.patch";
url = "https://github.com/ocaml/merlin/commit/9e0c47b0d5fd0c4edc37c4c7ce927b155877557d.patch";
hash = "sha256-HmdTISE/s45C5cwLgsCHNUW6OAPSsvQ/GcJE6VDEobs=";
})
];
strictDeps = true;
buildInputs = [
dot-merlin-reader
yojson
csexp
result
menhirSdk
];
meta = with lib; {
description = "Editor-independent tool to ease the development of programs in OCaml";
homepage = "https://github.com/ocaml/merlin";
license = licenses.mit;
maintainers = [ maintainers.vbgl ];
};
}

View File

@@ -0,0 +1,40 @@
{
lib,
yojson,
csexp,
findlib,
buildDunePackage,
merlin-lib,
merlin,
result,
}:
buildDunePackage rec {
pname = "dot-merlin-reader";
inherit (merlin) version src;
minimalOCamlVersion = "4.06";
buildInputs = [
findlib
]
++ (
if lib.versionAtLeast version "4.7-414" then
[ merlin-lib ]
else
[
yojson
csexp
result
]
);
meta = with lib; {
description = "Reads config files for merlin";
mainProgram = "dot-merlin-reader";
homepage = "https://github.com/ocaml/merlin";
license = licenses.mit;
maintainers = [ maintainers.hongchangwu ];
};
}

View File

@@ -0,0 +1,15 @@
--- a/src/kernel/mconfig_dot.ml
+++ b/src/kernel/mconfig_dot.ml
@@ -126,10 +126,10 @@ module Configurator = struct
let prog, args =
match cfg with
| Dot_merlin ->
- let prog = "dot-merlin-reader" in
+ let prog = "@dot-merlin-reader@" in
prog, [| prog |]
| Dune ->
- let prog = "dune" in
+ let prog = "@dune@" in
prog, [| prog; "ocaml-merlin"; "--no-print-directory" |]
in
log ~title:"get_config" "Using %s configuration provider." (to_string cfg);

View File

@@ -0,0 +1,17 @@
diff --git a/src/kernel/mconfig_dot.ml b/src/kernel/mconfig_dot.ml
index 0a42a1d3..91997190 100644
--- a/src/kernel/mconfig_dot.ml
+++ b/src/kernel/mconfig_dot.ml
@@ -146,10 +146,10 @@ end = struct
let prog, args =
match cfg with
| Dot_merlin ->
- let prog = "dot-merlin-reader" in
+ let prog = "@dot-merlin-reader@" in
(prog, [| prog |])
| Dune ->
- let prog = "dune" in
+ let prog = "@dune@" in
(prog, [| prog; "ocaml-merlin"; "--no-print-directory" |])
in
let cwd = Sys.getcwd () in

View File

@@ -0,0 +1,18 @@
{
buildDunePackage,
merlin,
csexp,
}:
buildDunePackage {
pname = "merlin-lib";
inherit (merlin) version src;
minimalOCamlVersion = "4.14";
propagatedBuildInputs = [ csexp ];
meta = merlin.meta // {
description = "Merlins libraries";
};
}