about summary refs log tree commit diff
path: root/pkgs/development/ocaml-modules/cstruct/default.nix
blob: 0f5380f9a41fee9f3d43975557a9b1d96ae69a1a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
{ stdenv, fetchurl, ocaml, jbuilder, findlib, sexplib, ocplib-endian }:

stdenv.mkDerivation rec {
  name = "ocaml${ocaml.version}-cstruct-${version}";
  version = "3.1.1";
  src = fetchurl {
    url = "https://github.com/mirage/ocaml-cstruct/releases/download/v${version}/cstruct-${version}.tbz";
    sha256 = "1x4jxsvd1lrfibnjdjrkfl7hqsc48rljnwbap6faanj9qhwwa6v2";
  };

  unpackCmd = "tar -xjf $curSrc";

  buildInputs = [ ocaml jbuilder findlib ];

  propagatedBuildInputs = [ sexplib ocplib-endian ];

  buildPhase = "jbuilder build -p cstruct";

  inherit (jbuilder) installPhase;

  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;
  };
}