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