nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 buildDunePackage,
4 fetchFromGitHub,
5 ocaml,
6 ppxlib,
7 ounit,
8 ounit2,
9 ppx_deriving,
10 result,
11 yojson,
12}:
13
14let
15 param =
16 if lib.versionAtLeast ppxlib.version "0.30" then
17 {
18 version = "3.9.0";
19 sha256 = "sha256-0d6YcBkeFoHXffCYjLIIvruw8B9ZB6NbUijhTv9uyN8=";
20 checkInputs = [ ounit2 ];
21 }
22 else
23 {
24 version = "3.6.1";
25 sha256 = "1icz5h6p3pfj7my5gi7wxpflrb8c902dqa17f9w424njilnpyrbk";
26 checkInputs = [ ounit ];
27 propagatedBuildInputs = [ result ];
28 };
29in
30
31buildDunePackage rec {
32 pname = "ppx_deriving_yojson";
33 inherit (param) version;
34
35 minimalOCamlVersion = "4.07";
36
37 src = fetchFromGitHub {
38 owner = "ocaml-ppx";
39 repo = "ppx_deriving_yojson";
40 rev = "v${version}";
41 inherit (param) sha256;
42 };
43
44 propagatedBuildInputs = [
45 ppxlib
46 ppx_deriving
47 yojson
48 ]
49 ++ param.propagatedBuildInputs or [ ];
50
51 doCheck = lib.versionAtLeast ocaml.version "4.08";
52 inherit (param) checkInputs;
53
54 meta = {
55 description = "Yojson codec generator for OCaml >= 4.04";
56 inherit (src.meta) homepage;
57 license = lib.licenses.mit;
58 maintainers = [ lib.maintainers.vbgl ];
59 };
60}