@@ -8870,3 +8870,62 @@ (define-public ocaml-elpi
ELPI is free software released under the terms of LGPL 2.1 or above.")
(license license:lgpl2.1)))
+
+;; NOTE: requires python-jsonschema with version at minimum 4.6.0 to run
+;; tests.
+;; See https://github.com/ahrefs/atd/issues/306 for more info on that.
+(define-public ocaml-atd
+ (package
+ (name "ocaml-atd")
+ (version "2.10.0")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/ahrefs/atd")
+ (commit version)
+ (recursive? #t)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "10fgahdigrl01py0k0q2d6a60yps38q96dxhjnzm9jz4g931716l"))))
+ (build-system dune-build-system)
+ (arguments
+ `(#:phases (modify-phases %standard-phases
+ (replace 'check
+ (lambda* (#:key tests? #:allow-other-keys)
+ ;; The dune-build-system does not run "make test" but
+ ;; "dune runtest test --release".
+ ;; This project, rather, needs us to run "make test".
+ ;;
+ ;; For this package (ocaml-atd), we DO NOT run all the
+ ;; tests. The atd repository has resources for several
+ ;; different interfaces (python, scala, etc), but we
+ ;; don't need to run those tests if we are just
+ ;; interested in the ocaml interface.
+ ;; So we stick with just the ocaml tests here.
+ (when tests?
+ (invoke "make" "test-ocaml")))))))
+ (propagated-inputs (list ocaml-menhir
+ ocaml-easy-format
+ ocaml-odoc
+ ocaml-re
+ ocaml-camlp-streams
+ ocaml-biniou
+ ocaml-yojson
+ ocaml-cmdliner))
+ (native-inputs (list ocaml-alcotest
+ python
+ python-pypa-build
+ python-jsonschema-4.15
+ python-flake8
+ python-mypy
+ python-pytest))
+ (home-page "https://github.com/ahrefs/atd")
+ (synopsis "Parser for the ATD data format description language")
+ (description
+ "ATD is the OCaml library providing a parser for the ATD language
+and various utilities. ATD stands for Adjustable Type Definitions in
+reference to its main property of supporting annotations that allow a
+good fit with a variety of data formats.")
+ ;; Modified BSD license
+ (license (license:non-copyleft "LICENSE.md"))))