1{
2 lib,
3 buildDunePackage,
4 fetchpatch,
5 ocaml,
6 bitstring,
7 ppxlib,
8 ounit,
9}:
10
11if lib.versionOlder ppxlib.version "0.18.0" then
12 throw "ppx_bitstring is not available with ppxlib-${ppxlib.version}"
13else
14
15 buildDunePackage {
16 pname = "ppx_bitstring";
17 inherit (bitstring) version src;
18
19 patches = lib.optional (lib.versionAtLeast ppxlib.version "0.36") (fetchpatch {
20 url = "https://github.com/xguerin/bitstring/commit/b42d4924cbb5ec5fd5309e6807852b63f456f35d.patch";
21 hash = "sha256-wtpSnGOzIUTmB3LhyHGopecy7F/5SYFOwaR6eReV+6g=";
22 });
23
24 buildInputs = [
25 bitstring
26 ppxlib
27 ];
28
29 doCheck = lib.versionAtLeast ocaml.version "4.08";
30 checkInputs = [ ounit ];
31
32 meta = bitstring.meta // {
33 description = "Bitstrings and bitstring matching for OCaml - PPX extension";
34 };
35 }