2016-11-04 11:24:57 +00:00
|
|
|
{stdenv, writeText, fetchurl, ocaml, ocplib-endian, sexplib_p4, findlib,
|
|
|
|
async_p4 ? null, lwt ? null, camlp4}:
|
2015-02-22 07:17:52 +00:00
|
|
|
|
2016-11-04 11:24:57 +00:00
|
|
|
assert stdenv.lib.versionAtLeast (stdenv.lib.getVersion ocaml) "4.01";
|
2015-02-22 07:17:52 +00:00
|
|
|
|
2016-11-04 11:24:57 +00:00
|
|
|
stdenv.mkDerivation {
|
|
|
|
name = "ocaml-cstruct-1.6.0";
|
2015-02-22 07:17:52 +00:00
|
|
|
|
2016-11-04 11:24:57 +00:00
|
|
|
src = fetchurl {
|
|
|
|
url = https://github.com/mirage/ocaml-cstruct/archive/v1.6.0.tar.gz;
|
|
|
|
sha256 = "0f90a1b7a03091cf22a3ccb11a0cce03b6500f064ad3766b5ed81418ac008ece";
|
2015-02-22 07:17:52 +00:00
|
|
|
};
|
|
|
|
|
2016-11-04 11:24:57 +00:00
|
|
|
configureFlags = stdenv.lib.strings.concatStringsSep " " ((if lwt != null then ["--enable-lwt"] else []) ++
|
|
|
|
(if async_p4 != null then ["--enable-async"] else []));
|
|
|
|
buildInputs = [ocaml findlib camlp4];
|
|
|
|
propagatedBuildInputs = [ocplib-endian sexplib_p4 lwt async_p4];
|
2015-02-22 07:17:52 +00:00
|
|
|
|
|
|
|
createFindlibDestdir = true;
|
2015-05-15 15:32:33 +01:00
|
|
|
dontStrip = true;
|
2015-02-22 07:17:52 +00:00
|
|
|
|
2015-05-15 15:32:33 +01:00
|
|
|
meta = with stdenv.lib; {
|
2015-02-22 07:17:52 +00:00
|
|
|
homepage = https://github.com/mirage/ocaml-cstruct;
|
2015-05-15 15:32:33 +01:00
|
|
|
description = "Map OCaml arrays onto C-like structs";
|
2015-02-22 07:17:52 +00:00
|
|
|
license = stdenv.lib.licenses.isc;
|
2015-05-15 15:32:33 +01:00
|
|
|
maintainers = [ maintainers.vbgl maintainers.ericbmerritt ];
|
2015-12-24 17:49:07 +00:00
|
|
|
platforms = ocaml.meta.platforms or [];
|
2015-02-22 07:17:52 +00:00
|
|
|
};
|
|
|
|
}
|