diff --git a/pkgs/development/ocaml-modules/atd/jsonlike.nix b/pkgs/development/ocaml-modules/atd/jsonlike.nix new file mode 100644 index 000000000000..7c75fe3df48d --- /dev/null +++ b/pkgs/development/ocaml-modules/atd/jsonlike.nix @@ -0,0 +1,18 @@ +{ + buildDunePackage, + atd, + re, +}: + +buildDunePackage { + pname = "atd-jsonlike"; + inherit (atd) src version; + + minimalOCamlVersion = "4.12"; + + propagatedBuildInputs = [ re ]; + + meta = (removeAttrs atd.meta [ "mainProgram" ]) // { + description = "Generic JSON-like AST for use with ATD code generators"; + }; +} diff --git a/pkgs/development/ocaml-modules/atd/yamlx.nix b/pkgs/development/ocaml-modules/atd/yamlx.nix new file mode 100644 index 000000000000..3d6b0957935f --- /dev/null +++ b/pkgs/development/ocaml-modules/atd/yamlx.nix @@ -0,0 +1,19 @@ +{ + buildDunePackage, + atd-jsonlike, + yamlx, +}: + +buildDunePackage { + pname = "atd-yamlx"; + inherit (atd-jsonlike) version src; + + propagatedBuildInputs = [ + atd-jsonlike + yamlx + ]; + + meta = atd-jsonlike.meta // { + description = "YAML-to-jsonlike bridge for use with ATD code generators"; + }; +} diff --git a/pkgs/development/ocaml-modules/atdgen/codec-runtime.nix b/pkgs/development/ocaml-modules/atdgen/codec-runtime.nix index 6e2270189c95..ae480041eb95 100644 --- a/pkgs/development/ocaml-modules/atdgen/codec-runtime.nix +++ b/pkgs/development/ocaml-modules/atdgen/codec-runtime.nix @@ -6,11 +6,11 @@ buildDunePackage (finalAttrs: { pname = "atdgen-codec-runtime"; - version = "4.0.0"; + version = "4.1.0"; src = fetchurl { url = "https://github.com/ahrefs/atd/releases/download/${finalAttrs.version}/atd-${finalAttrs.version}.tbz"; - hash = "sha256-NRT+TcTniGQLPpqf7DtbEG5vYJtZ0oUicB3hvS6pCfE="; + hash = "sha256-c7J+xg77vqYPMRy8oJwQS1U3vocz9HcnqfXth41uBGw="; }; meta = { diff --git a/pkgs/development/ocaml-modules/atdgen/default.nix b/pkgs/development/ocaml-modules/atdgen/default.nix index 7cd1a3c51013..c52f28b68e7d 100644 --- a/pkgs/development/ocaml-modules/atdgen/default.nix +++ b/pkgs/development/ocaml-modules/atdgen/default.nix @@ -1,12 +1,17 @@ { + lib, buildDunePackage, + ocaml, alcotest, atd, + atd-jsonlike, + atd-yamlx, atdgen-codec-runtime, atdgen-runtime, + atdml, biniou, re, - python3, + yamlx, }: buildDunePackage { @@ -20,15 +25,18 @@ buildDunePackage { propagatedBuildInputs = [ atdgen-runtime ]; - doCheck = true; + doCheck = lib.versionAtLeast ocaml.version "4.14"; nativeCheckInputs = [ atd + atdml biniou - (python3.withPackages (ps: [ ps.jsonschema ])) ]; checkInputs = [ alcotest atdgen-codec-runtime + yamlx + atd-jsonlike + atd-yamlx ]; meta = (removeAttrs atd.meta [ "mainProgram" ]) // { diff --git a/pkgs/development/ocaml-modules/atdml/default.nix b/pkgs/development/ocaml-modules/atdml/default.nix index 1b45f276222b..a2465772e000 100644 --- a/pkgs/development/ocaml-modules/atdml/default.nix +++ b/pkgs/development/ocaml-modules/atdml/default.nix @@ -9,6 +9,8 @@ buildDunePackage { pname = "atdml"; inherit (atd) version src; + minimalOCamlVersion = "4.10"; + buildInputs = [ cmdliner ]; propagatedBuildInputs = [ atd ]; diff --git a/pkgs/top-level/ocaml-packages.nix b/pkgs/top-level/ocaml-packages.nix index 15f61c9736e0..4c129821501e 100644 --- a/pkgs/top-level/ocaml-packages.nix +++ b/pkgs/top-level/ocaml-packages.nix @@ -70,6 +70,10 @@ let atd = callPackage ../development/ocaml-modules/atd { }; + atd-jsonlike = callPackage ../development/ocaml-modules/atd/jsonlike.nix { }; + + atd-yamlx = callPackage ../development/ocaml-modules/atd/yamlx.nix { }; + atdgen = callPackage ../development/ocaml-modules/atdgen { }; atdgen-codec-runtime = callPackage ../development/ocaml-modules/atdgen/codec-runtime.nix { };