* gnu/packages/ocaml.scm (ocaml-cstruct): New variable. --- gnu/packages/ocaml.scm | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+)
diff --git a/gnu/packages/ocaml.scm b/gnu/packages/ocaml.scm index ab2197c0c..4a861bcd7 100644 --- a/gnu/packages/ocaml.scm +++ b/gnu/packages/ocaml.scm @@ -2661,3 +2661,30 @@ and bigarrays, based on new primitives added in version 4.01. It works on strings, bytes and bigstring (Bigarrys of chars), and provides submodules for big- and little-endian, with their unsafe counter-parts.") (license license:lgpl2.1))) + +(define-public ocaml-cstruct + (package + (name "ocaml-cstruct") + (version "2.3.1") + (home-page "https://github.com/mirage/ocaml-cstruct/") + (source + (origin + (method url-fetch) + (uri (string-append home-page "/archive/v" version ".tar.gz")) + (sha256 (base32 + "15qpdc8421shq4pprdas9jznpva45229wkfqbwcxw9khaiiz7949")))) + (build-system ocaml-build-system) + (arguments `(#:configure-flags + (list "--enable-lwt" "--enable-async"))) + (native-inputs `(("ounit" ,ocaml-ounit) + ("ppx-tools" ,ocaml-ppx-tools) + ("camlp4" ,camlp4))) + (propagated-inputs `(("ocplib-endian" ,ocaml-ocplib-endian) + ("lwt" ,ocaml-lwt) + ("async" ,ocaml-async) + ("sexplib" ,ocaml-sexplib))) + (synopsis "Access C structures via a camlp4 extension") + (description "Cstruct is a library and syntax extension to make it easier +to access C-like structures directly from OCaml. It supports both reading and +writing to these structures, and they are accessed via the Bigarray module.") + (license license:isc))) -- 2.11.0