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,97 @@
{
lib,
fetchurl,
version ? "0.27.0",
astring,
base,
camlp-streams,
cmdliner_1_0,
cmdliner_1_1,
csexp,
dune-build-info,
either,
fix,
fpath,
menhirLib,
menhirSdk,
ocaml-version,
ocp-indent,
odoc-parser,
result,
stdio,
uuseg,
uutf,
...
}:
# The ocamlformat package have been split into two in version 0.25.1:
# one for the library and one for the executable.
# Both have the same sources and very similar dependencies.
rec {
tarballName = "ocamlformat-${version}.tbz";
src = fetchurl {
url = "https://github.com/ocaml-ppx/ocamlformat/releases/download/${version}/${tarballName}";
sha256 =
{
"0.19.0" = "0ihgwl7d489g938m1jvgx8azdgq9f5np5mzqwwya797hx2m4dz32";
"0.20.0" = "sha256-JtmNCgwjbCyUE4bWqdH5Nc2YSit+rekwS43DcviIfgk=";
"0.20.1" = "sha256-fTpRZFQW+ngoc0T6A69reEUAZ6GmHkeQvxspd5zRAjU=";
"0.21.0" = "sha256-KhgX9rxYH/DM6fCqloe4l7AnJuKrdXSe6Y1XY3BXMy0=";
"0.22.4" = "sha256-61TeK4GsfMLmjYGn3ICzkagbc3/Po++Wnqkb2tbJwGA=";
"0.23.0" = "sha256-m9Pjz7DaGy917M1GjyfqG5Lm5ne7YSlJF2SVcDHe3+0=";
"0.24.0" = "sha256-Zil0wceeXmq2xy0OVLxa/Ujl4Dtsmc4COyv6Jo7rVaM=";
"0.24.1" = "sha256-AjQl6YGPgOpQU3sjcaSnZsFJqZV9BYB+iKAE0tX0Qc4=";
"0.25.1" = "sha256-3I8qMwyjkws2yssmI7s2Dti99uSorNKT29niJBpv0z0=";
"0.26.0" = "sha256-AxSUq3cM7xCo9qocvrVmDkbDqmwM1FexEP7IWadeh30=";
"0.26.1" = "sha256-2gBuQn8VuexhL7gI1EZZm9m3w+4lq+s9VVdHpw10xtc=";
"0.26.2" = "sha256-Lk9Za/eqNnqET+g7oPawvxSyplF53cCCNj/peT0DdcU=";
"0.27.0" = "sha256-3b9ITAdtCPmUAO6Et5DsIx9cj8vV0zJKZADVOI6EbRU=";
}
."${version}";
};
inherit version;
odoc-parser_v = odoc-parser.override {
version =
if lib.versionAtLeast version "0.24.0" then
"2.0.0"
else if lib.versionAtLeast version "0.20.1" then
"1.0.1"
else
"0.9.0";
};
cmdliner_v = if lib.versionAtLeast version "0.21.0" then cmdliner_1_1 else cmdliner_1_0;
library_deps = [
base
cmdliner_v
dune-build-info
fix
fpath
menhirLib
menhirSdk
ocp-indent
stdio
uuseg
uutf
]
++ lib.optionals (lib.versionAtLeast version "0.20.0") [
either
ocaml-version
]
++ lib.optionals (lib.versionAtLeast version "0.22.4") [ csexp ]
++ (
if lib.versionOlder version "0.25.1" then
[ odoc-parser_v ]
else
[
camlp-streams
result
astring
]
);
}

View File

@@ -0,0 +1,36 @@
# Version can be selected with the 'version' argument, see generic.nix.
{
lib,
callPackage,
buildDunePackage,
menhir,
...
}@args:
let
inherit (callPackage ./generic.nix args) src version library_deps;
in
assert (lib.versionAtLeast version "0.25.1");
buildDunePackage {
pname = "ocamlformat-lib";
inherit src version;
minimalOCamlVersion = "4.08";
duneVersion = "3";
nativeBuildInputs = [ menhir ];
propagatedBuildInputs = library_deps;
meta = {
homepage = "https://github.com/ocaml-ppx/ocamlformat";
description = "Auto-formatter for OCaml code (library)";
maintainers = with lib.maintainers; [
Zimmi48
Julow
];
license = lib.licenses.mit;
};
}

View File

@@ -0,0 +1,40 @@
# Version can be selected with the 'version' argument, see generic.nix.
{
lib,
buildDunePackage,
ocaml,
csexp,
sexplib0,
callPackage,
...
}@args:
let
# for compat with ocaml-lsp
version_arg = if lib.versionAtLeast ocaml.version "4.13" then { } else { version = "0.20.0"; };
inherit (callPackage ./generic.nix (args // version_arg)) src version;
in
buildDunePackage {
pname = "ocamlformat-rpc-lib";
inherit src version;
minimalOCamlVersion = "4.08";
duneVersion = "3";
propagatedBuildInputs = [
csexp
sexplib0
];
meta = with lib; {
homepage = "https://github.com/ocaml-ppx/ocamlformat";
description = "Auto-formatter for OCaml code (RPC mode)";
license = licenses.mit;
maintainers = with maintainers; [
Zimmi48
Julow
];
};
}

View File

@@ -0,0 +1,53 @@
# Version can be selected with the 'version' argument, see generic.nix.
{
lib,
callPackage,
buildDunePackage,
ocaml,
re,
ocamlformat-lib,
menhir,
...
}@args:
let
inherit (callPackage ./generic.nix args) src version library_deps;
in
lib.throwIf
(
lib.versionAtLeast ocaml.version "5.0" && !lib.versionAtLeast version "0.23"
|| lib.versionAtLeast ocaml.version "5.1" && !lib.versionAtLeast version "0.25"
|| lib.versionAtLeast ocaml.version "5.2" && !lib.versionAtLeast version "0.26.2"
|| lib.versionAtLeast ocaml.version "5.3" && !lib.versionAtLeast version "0.27"
)
"ocamlformat ${version} is not available for OCaml ${ocaml.version}"
buildDunePackage
{
pname = "ocamlformat";
inherit src version;
minimalOCamlVersion = "4.08";
nativeBuildInputs = if lib.versionAtLeast version "0.25.1" then [ ] else [ menhir ];
buildInputs = [
re
]
++ library_deps
++ lib.optionals (lib.versionAtLeast version "0.25.1") [
(ocamlformat-lib.override { inherit version; })
];
meta = {
homepage = "https://github.com/ocaml-ppx/ocamlformat";
description = "Auto-formatter for OCaml code";
maintainers = with lib.maintainers; [
Zimmi48
Julow
];
license = lib.licenses.mit;
mainProgram = "ocamlformat";
};
}