diff --git a/pkgs/development/ocaml-modules/charon/default.nix b/pkgs/development/ocaml-modules/charon/default.nix new file mode 100644 index 000000000000..a1f4604666b1 --- /dev/null +++ b/pkgs/development/ocaml-modules/charon/default.nix @@ -0,0 +1,54 @@ +{ + lib, + buildDunePackage, + fetchFromGitHub, + + # propagatedBuildInputs, + easy_logging, + name_matcher_parser, + ppx_deriving, + unionFind, + visitors, + yojson, + + nix-update-script, +}: + +buildDunePackage (finalAttrs: { + pname = "charon"; + version = "2026.06.12"; + __structuredAttrs = true; + + src = fetchFromGitHub { + owner = "AeneasVerif"; + repo = "charon"; + tag = "nightly-${finalAttrs.version}"; + hash = "sha256-XCNDFJ8HakRBQ68rWB29R5RF7zhmqmNMna098SvXDE0="; + }; + + propagatedBuildInputs = [ + easy_logging + name_matcher_parser + ppx_deriving + unionFind + visitors + yojson + ]; + + # The charon-ml test suite requires pre-generated `.llbc` fixtures produced by + # running the (Rust) charon binary, which are not part of the OCaml source + # distribution, so the tests cannot run here. + doCheck = false; + + passthru.updateScript = nix-update-script { + extraArgs = [ "--version=unstable" ]; + }; + + meta = { + description = "Analyze Rust crates without touching compiler internals"; + homepage = "https://github.com/AeneasVerif/charon"; + license = lib.licenses.asl20; + maintainers = with lib.maintainers; [ GaetanLepage ]; + platforms = lib.platforms.all; + }; +}) diff --git a/pkgs/development/ocaml-modules/name_matcher_parser/default.nix b/pkgs/development/ocaml-modules/name_matcher_parser/default.nix new file mode 100644 index 000000000000..e9763adadd8a --- /dev/null +++ b/pkgs/development/ocaml-modules/name_matcher_parser/default.nix @@ -0,0 +1,42 @@ +{ + lib, + buildDunePackage, + charon, + + # nativeBuildInputs, + menhir, + + # propagatedBuildInputs, + menhirLib, + ppx_deriving, + visitors, + zarith, +}: + +buildDunePackage (finalAttrs: { + pname = "name_matcher_parser"; + inherit (charon) version; + __structuredAttrs = true; + + inherit (charon) src; + + nativeBuildInputs = [ menhir ]; + + propagatedBuildInputs = [ + menhirLib + ppx_deriving + visitors + zarith + ]; + + # No test suite is defined for this package. + doCheck = false; + + meta = { + description = "Parser to define name matchers"; + homepage = "https://github.com/AeneasVerif/charon"; + license = lib.licenses.asl20; + maintainers = with lib.maintainers; [ GaetanLepage ]; + platforms = lib.platforms.all; + }; +}) diff --git a/pkgs/top-level/ocaml-packages.nix b/pkgs/top-level/ocaml-packages.nix index fe300b2eeac4..5d4f8316a419 100644 --- a/pkgs/top-level/ocaml-packages.nix +++ b/pkgs/top-level/ocaml-packages.nix @@ -247,6 +247,8 @@ let checkseum = callPackage ../development/ocaml-modules/checkseum { }; + charon = callPackage ../development/ocaml-modules/charon { }; + chrome-trace = callPackage ../development/ocaml-modules/chrome-trace { }; cil = callPackage ../development/ocaml-modules/cil { }; @@ -1423,6 +1425,8 @@ let ### N ### + name_matcher_parser = callPackage ../development/ocaml-modules/name_matcher_parser { }; + nbd = pkgs.libnbd.override { ocamlPackages = self; buildOcamlBindings = true;