1{
2 lib,
3 ocaml,
4 fetchFromGitHub,
5 buildDunePackage,
6 bigarray-compat,
7 containers,
8 cppo,
9 ctypes,
10 integers,
11 num,
12 ppxlib,
13 re,
14 findlib,
15}:
16
17lib.throwIf (lib.versionAtLeast ocaml.version "5.2")
18 "ppx_cstubs is not available for OCaml ${ocaml.version}"
19
20 buildDunePackage
21 rec {
22 pname = "ppx_cstubs";
23 version = "0.7.0";
24
25 minimalOCamlVersion = "4.08";
26
27 src = fetchFromGitHub {
28 owner = "fdopen";
29 repo = "ppx_cstubs";
30 rev = version;
31 hash = "sha256-qMmwRWCIfNyhCQYPKLiufnb57sTR3P+WInOqtPDywFs=";
32 };
33
34 patches = [ ./ppxlib.patch ];
35
36 nativeBuildInputs = [ cppo ];
37
38 buildInputs = [
39 bigarray-compat
40 containers
41 findlib
42 integers
43 num
44 ppxlib
45 re
46 ];
47
48 propagatedBuildInputs = [
49 ctypes
50 ];
51
52 meta = with lib; {
53 homepage = "https://github.com/fdopen/ppx_cstubs";
54 changelog = "https://github.com/fdopen/ppx_cstubs/raw/${version}/CHANGES.md";
55 description = "Preprocessor for easier stub generation with ocaml-ctypes";
56 license = licenses.lgpl21Plus;
57 maintainers = [ maintainers.osener ];
58 };
59 }