2016-09-14 01:21:56 +01:00
|
|
|
{stdenv, writeText, fetchurl, ocaml, ocplib-endian, sexplib_p4, findlib,
|
2016-09-14 21:34:33 +01:00
|
|
|
async_p4 ? null, lwt ? null, camlp4}:
|
2015-02-22 07:17:52 +00:00
|
|
|
|
2015-06-01 21:35:34 +01:00
|
|
|
assert stdenv.lib.versionAtLeast (stdenv.lib.getVersion ocaml) "4.01";
|
2015-02-22 07:17:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
2015-05-15 15:32:33 +01:00
|
|
|
name = "ocaml-cstruct-1.6.0";
|
2015-02-22 07:17:52 +00:00
|
|
|
|
2015-05-15 15:32:33 +01: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
|
|
|
};
|
|
|
|
|
2015-05-15 15:32:33 +01:00
|
|
|
configureFlags = stdenv.lib.strings.concatStringsSep " " ((if lwt != null then ["--enable-lwt"] else []) ++
|
2016-09-14 21:34:33 +01:00
|
|
|
(if async_p4 != null then ["--enable-async"] else []));
|
2015-05-15 15:32:33 +01:00
|
|
|
buildInputs = [ocaml findlib camlp4];
|
2016-09-14 21:34:33 +01:00
|
|
|
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
|
|
|
};
|
|
|
|
}
|