about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/ocaml-modules/cstruct/1.9.0.nix
blob: 750a153c1c48aab66ac273e41b647099f2a0d357 (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
29
30
31
32
33
34
35
36
{ lib, stdenv, fetchFromGitHub, ocaml, ocamlbuild, ocplib-endian, sexplib, findlib, ppx_tools
, async ? null, lwt ? null
}:

assert lib.versionAtLeast ocaml.version "4.01";

let version = "1.9.0"; in

let opt = b: "--${if b != null then "en" else "dis"}able"; in

stdenv.mkDerivation {
  name = "ocaml${ocaml.version}-cstruct-${version}";

  src = fetchFromGitHub {
    owner = "mirage";
    repo = "ocaml-cstruct";
    rev = "v${version}";
    sha256 = "1c1j21zgmxi9spq23imy7byn50qr7hlds1cfpzxlsx9dp309jngy";
  };

  configureFlags = [ "${opt lwt}-lwt" "${opt async}-async" "${opt ppx_tools}-ppx" ];

  buildInputs = [ ocaml findlib ocamlbuild ppx_tools lwt async ];
  propagatedBuildInputs = [ ocplib-endian sexplib ];

  createFindlibDestdir = true;
  dontStrip = true;

  meta = with lib; {
    homepage = "https://github.com/mirage/ocaml-cstruct";
    description = "Map OCaml arrays onto C-like structs";
    license = lib.licenses.isc;
    maintainers = [ maintainers.vbgl maintainers.ericbmerritt ];
    platforms = ocaml.meta.platforms or [];
  };
}