evcc: 0.131.4 -> 0.131.5
[NixPkgs.git] / pkgs / development / ocaml-modules / ppx_deriving / default.nix
blob1e79e8a1ffa88dee93ccb40cab990c203e8a1df8
1 { lib
2 , fetchurl
3 , buildDunePackage
4 , ocaml
5 , findlib
6 , cppo
7 , ppxlib
8 , ppx_derivers
9 , result
10 , ounit
11 , ounit2
12 , ocaml-migrate-parsetree
15 let params =
16   if lib.versionAtLeast ppxlib.version "0.20" then {
17     version = "5.2.1";
18     sha256 = "11h75dsbv3rs03pl67hdd3lbim7wjzh257ij9c75fcknbfr5ysz9";
19   } else if lib.versionAtLeast ppxlib.version "0.15" then {
20     version = "5.1";
21     sha256 = "1i64fd7qrfzbam5hfbl01r0sx4iihsahcwqj13smmrjlnwi3nkxh";
22   } else {
23     version = "5.0";
24     sha256 = "0fkzrn4pdyvf1kl0nwvhqidq01pnq3ql8zk1jd56hb0cxaw851w3";
25   }
26 ; in
28 buildDunePackage rec {
29   pname = "ppx_deriving";
30   inherit (params) version;
32   src = fetchurl {
33     url = "https://github.com/ocaml-ppx/ppx_deriving/releases/download/v${version}/ppx_deriving-v${version}.tbz";
34     inherit (params) sha256;
35   };
37   strictDeps = true;
39   nativeBuildInputs = [ cppo ];
40   buildInputs = [ findlib ppxlib ];
41   propagatedBuildInputs =
42     lib.optional (lib.versionOlder version "5.2") ocaml-migrate-parsetree ++ [
43     ppx_derivers
44     result
45   ];
47   doCheck = lib.versionAtLeast ocaml.version "4.08"
48     && lib.versionOlder ocaml.version "5.0";
49   checkInputs = [
50     (if lib.versionAtLeast version "5.2" then ounit2 else ounit)
51   ];
53   meta = with lib; {
54     description = "deriving is a library simplifying type-driven code generation on OCaml >=4.02";
55     maintainers = [ maintainers.maurer ];
56     license = licenses.mit;
57   };