Gentoo Archives: gentoo-commits

From: Alexis Ballier <aballier@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-ml/ppx_variants_conv/, dev-ml/ppx_variants_conv/files/
Date: Tue, 03 May 2016 17:44:50
Message-Id: 1462297462.87ec0d4d127155a8461d96aae5c2cb9a8e4ac095.aballier@gentoo
1 commit: 87ec0d4d127155a8461d96aae5c2cb9a8e4ac095
2 Author: Alexis Ballier <aballier <AT> gentoo <DOT> org>
3 AuthorDate: Tue May 3 14:48:13 2016 +0000
4 Commit: Alexis Ballier <aballier <AT> gentoo <DOT> org>
5 CommitDate: Tue May 3 17:44:22 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=87ec0d4d
7
8 dev-ml/ppx_variants_conv: fix build with ocaml 4.03
9
10 Package-Manager: portage-2.2.28
11 Signed-off-by: Alexis Ballier <aballier <AT> gentoo.org>
12
13 dev-ml/ppx_variants_conv/files/oc43.patch | 87 ++++++++++++++++++++++
14 .../ppx_variants_conv-113.33.00.ebuild | 4 +
15 2 files changed, 91 insertions(+)
16
17 diff --git a/dev-ml/ppx_variants_conv/files/oc43.patch b/dev-ml/ppx_variants_conv/files/oc43.patch
18 new file mode 100644
19 index 0000000..5c59422
20 --- /dev/null
21 +++ b/dev-ml/ppx_variants_conv/files/oc43.patch
22 @@ -0,0 +1,87 @@
23 +diff -uNr ppx_variants_conv-113.33.00/_oasis ppx_variants_conv-113.33.00+4.03/_oasis
24 +--- ppx_variants_conv-113.33.00/_oasis 2016-03-09 16:44:55.000000000 +0100
25 ++++ ppx_variants_conv-113.33.00+4.03/_oasis 2016-03-22 15:13:51.000000000 +0100
26 +@@ -1,8 +1,8 @@
27 + OASISFormat: 0.4
28 +-OCamlVersion: >= 4.02.3
29 ++OCamlVersion: >= 4.03.0
30 + FindlibVersion: >= 1.3.2
31 + Name: ppx_variants_conv
32 +-Version: 113.33.00
33 ++Version: 113.33.00+4.03
34 + Synopsis: Generation of accessor and iteration functions for ocaml variant types
35 + Authors: Jane Street Group, LLC <opensource@××××××××××.com>
36 + Copyrights: (C) 2015-2016 Jane Street Group LLC <opensource@××××××××××.com>
37 +diff -uNr ppx_variants_conv-113.33.00/opam ppx_variants_conv-113.33.00+4.03/opam
38 +--- ppx_variants_conv-113.33.00/opam 2016-03-18 12:08:01.000000000 +0100
39 ++++ ppx_variants_conv-113.33.00+4.03/opam 2016-03-22 17:51:38.000000000 +0100
40 +@@ -18,4 +18,4 @@
41 + "ppx_type_conv"
42 + "variantslib"
43 + ]
44 +-available: [ ocaml-version >= "4.02.3" ]
45 ++available: [ ocaml-version >= "4.03.0" ]
46 +diff -uNr ppx_variants_conv-113.33.00/src/ppx_variants_conv.ml ppx_variants_conv-113.33.00+4.03/src/ppx_variants_conv.ml
47 +--- ppx_variants_conv-113.33.00/src/ppx_variants_conv.ml 2016-03-09 16:44:55.000000000 +0100
48 ++++ ppx_variants_conv-113.33.00+4.03/src/ppx_variants_conv.ml 2016-03-22 15:13:51.000000000 +0100
49 +@@ -34,7 +34,7 @@
50 +
51 + let lambda_sig loc arg_tys body_ty =
52 + List.fold_right arg_tys ~init:body_ty ~f:(fun arg_ty acc ->
53 +- ptyp_arrow ~loc "" arg_ty acc)
54 ++ ptyp_arrow ~loc Nolabel arg_ty acc)
55 + ;;
56 +
57 + let lambda_sig' loc arg_tys body_ty =
58 +@@ -94,9 +94,14 @@
59 + let constructor body_ty cd : Variant_definition.t =
60 + if cd.pcd_res <> None then
61 + Location.raise_errorf ~loc:cd.pcd_loc "GADTs are not supported by variantslib";
62 ++ let pcd_args =
63 ++ match cd.pcd_args with
64 ++ | Pcstr_tuple pcd_args -> pcd_args
65 ++ | Pcstr_record _ -> failwith "Pcstr_record not supported"
66 ++ in
67 + { name = cd.pcd_name.txt
68 + ; body_ty
69 +- ; arg_tys = cd.pcd_args
70 ++ ; arg_tys = pcd_args
71 + ; kind = `Normal
72 + }
73 +
74 +@@ -120,7 +125,7 @@
75 + ptyp_constr ~loc (Located.lident ~loc ty_name) tps
76 +
77 + let label_arg _loc name ty =
78 +- (String.lowercase name, ty)
79 ++ (Asttypes.Labelled (String.lowercase name), ty)
80 + ;;
81 +
82 + let variant_arg loc f v =
83 +@@ -186,7 +191,7 @@
84 + in
85 + let types = List.map variants ~f in
86 + let t = Create.lambda_sig' loc
87 +- (("", variant_type) :: types) result_type in
88 ++ ((Nolabel, variant_type) :: types) result_type in
89 + psig_value ~loc (value_description ~loc ~name:(Located.mk ~loc "map") ~type_:t
90 + ~prim:[])
91 + ;;
92 +@@ -316,7 +321,7 @@
93 + | None -> name
94 + | Some n -> n
95 + in
96 +- (l, pvar ~loc name)
97 ++ (Asttypes.Labelled l, pvar ~loc name)
98 + ;;
99 +
100 + let label_arg_fun loc name =
101 +@@ -408,7 +413,7 @@
102 + List.map variants ~f:(fun variant ->
103 + label_arg_fun loc (variant_name_to_string variant.V.name))
104 + in
105 +- let lambda = Create.lambda loc (("", [%pat? t__]) :: patterns) body in
106 ++ let lambda = Create.lambda loc ((Nolabel, [%pat? t__]) :: patterns) body in
107 + [%stri let map = [%e lambda] ]
108 + ;;
109 +
110
111 diff --git a/dev-ml/ppx_variants_conv/ppx_variants_conv-113.33.00.ebuild b/dev-ml/ppx_variants_conv/ppx_variants_conv-113.33.00.ebuild
112 index 54403e9..ab4bbd0 100644
113 --- a/dev-ml/ppx_variants_conv/ppx_variants_conv-113.33.00.ebuild
114 +++ b/dev-ml/ppx_variants_conv/ppx_variants_conv-113.33.00.ebuild
115 @@ -24,6 +24,10 @@ DEPEND="dev-ml/ppx_tools:=
116 RDEPEND="${DEPEND}"
117 DEPEND="${DEPEND} dev-ml/opam"
118
119 +src_prepare() {
120 + has_version '>=dev-lang/ocaml-4.03' && epatch "${FILESDIR}/oc43.patch"
121 +}
122 +
123 src_configure() {
124 emake setup.exe
125 OASIS_SETUP_COMMAND="./setup.exe" oasis_src_configure