1{stdenv, writeText, fetchurl, ocaml, ocplib-endian, sexplib, findlib,
2 async ? null, lwt ? null, camlp4}:
3
4assert stdenv.lib.versionAtLeast (stdenv.lib.getVersion ocaml) "4.01";
5
6stdenv.mkDerivation {
7 name = "ocaml-cstruct-1.6.0";
8
9 src = fetchurl {
10 url = https://github.com/mirage/ocaml-cstruct/archive/v1.6.0.tar.gz;
11 sha256 = "0f90a1b7a03091cf22a3ccb11a0cce03b6500f064ad3766b5ed81418ac008ece";
12 };
13
14 configureFlags = stdenv.lib.strings.concatStringsSep " " ((if lwt != null then ["--enable-lwt"] else []) ++
15 (if async != null then ["--enable-async"] else []));
16 buildInputs = [ocaml findlib camlp4];
17 propagatedBuildInputs = [ocplib-endian sexplib lwt async];
18
19 createFindlibDestdir = true;
20 dontStrip = true;
21
22 meta = with stdenv.lib; {
23 homepage = https://github.com/mirage/ocaml-cstruct;
24 description = "Map OCaml arrays onto C-like structs";
25 license = stdenv.lib.licenses.isc;
26 maintainers = [ maintainers.vbgl maintainers.ericbmerritt ];
27 platforms = ocaml.meta.platforms;
28 };
29}