2017-11-27 11:08:40 -08:00
|
|
|
{ stdenv, fetchurl, ocaml, jbuilder, findlib, sexplib, ocplib-endian }:
|
2015-02-21 23:17:52 -08:00
|
|
|
|
2017-11-27 11:08:40 -08:00
|
|
|
stdenv.mkDerivation rec {
|
2017-11-27 17:11:15 -08:00
|
|
|
name = "ocaml${ocaml.version}-cstruct-${version}";
|
2018-03-30 22:25:21 -07:00
|
|
|
version = "3.1.1";
|
2017-11-27 17:11:15 -08:00
|
|
|
src = fetchurl {
|
|
|
|
url = "https://github.com/mirage/ocaml-cstruct/releases/download/v${version}/cstruct-${version}.tbz";
|
2018-03-30 22:25:21 -07:00
|
|
|
sha256 = "1x4jxsvd1lrfibnjdjrkfl7hqsc48rljnwbap6faanj9qhwwa6v2";
|
2017-11-27 17:11:15 -08:00
|
|
|
};
|
2016-11-12 01:17:30 -08:00
|
|
|
|
2017-11-27 17:11:15 -08:00
|
|
|
unpackCmd = "tar -xjf $curSrc";
|
2016-11-12 01:17:30 -08:00
|
|
|
|
2017-11-27 17:11:15 -08:00
|
|
|
buildInputs = [ ocaml jbuilder findlib ];
|
2015-02-21 23:17:52 -08:00
|
|
|
|
2017-11-27 17:11:15 -08:00
|
|
|
propagatedBuildInputs = [ sexplib ocplib-endian ];
|
2015-02-21 23:17:52 -08:00
|
|
|
|
2017-11-27 17:11:15 -08:00
|
|
|
buildPhase = "jbuilder build -p cstruct";
|
2015-02-21 23:17:52 -08:00
|
|
|
|
2017-11-27 17:11:15 -08:00
|
|
|
inherit (jbuilder) installPhase;
|
2016-11-12 01:17:30 -08:00
|
|
|
|
2017-11-27 17:11:15 -08:00
|
|
|
meta = {
|
|
|
|
description = "Access C-like structures directly from OCaml";
|
|
|
|
license = stdenv.lib.licenses.isc;
|
|
|
|
homepage = "https://github.com/mirage/ocaml-cstruct";
|
|
|
|
maintainers = [ stdenv.lib.maintainers.vbgl ];
|
|
|
|
inherit (ocaml.meta) platforms;
|
|
|
|
};
|
2015-02-21 23:17:52 -08:00
|
|
|
}
|