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_bin_prot/files/, dev-ml/ppx_bin_prot/
Date: Tue, 03 May 2016 17:44:38
Message-Id: 1462297462.fca565081ff32059d122499399258832dffdf481.aballier@gentoo
1 commit: fca565081ff32059d122499399258832dffdf481
2 Author: Alexis Ballier <aballier <AT> gentoo <DOT> org>
3 AuthorDate: Tue May 3 14:57:24 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=fca56508
7
8 dev-ml/ppx_bin_prot: 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_bin_prot/files/oc43.patch | 113 ++++++++++++++++++++++
14 dev-ml/ppx_bin_prot/ppx_bin_prot-113.33.00.ebuild | 4 +
15 2 files changed, 117 insertions(+)
16
17 diff --git a/dev-ml/ppx_bin_prot/files/oc43.patch b/dev-ml/ppx_bin_prot/files/oc43.patch
18 new file mode 100644
19 index 0000000..d328d5b
20 --- /dev/null
21 +++ b/dev-ml/ppx_bin_prot/files/oc43.patch
22 @@ -0,0 +1,113 @@
23 +diff -uNr ppx_bin_prot-113.33.00/_oasis ppx_bin_prot-113.33.00+4.03/_oasis
24 +--- ppx_bin_prot-113.33.00/_oasis 2016-03-09 16:44:53.000000000 +0100
25 ++++ ppx_bin_prot-113.33.00+4.03/_oasis 2016-03-22 15:13:49.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_bin_prot
32 +-Version: 113.33.00
33 ++Version: 113.33.00+4.03
34 + Synopsis: Generation of bin_prot readers and writers from types
35 + Authors: Jane Street Group, LLC <opensource@××××××××××.com>
36 + Copyrights: (C) 2015-2016 Jane Street Group LLC <opensource@××××××××××.com>
37 +diff -uNr ppx_bin_prot-113.33.00/opam ppx_bin_prot-113.33.00+4.03/opam
38 +--- ppx_bin_prot-113.33.00/opam 2016-03-18 12:08:01.000000000 +0100
39 ++++ ppx_bin_prot-113.33.00+4.03/opam 2016-03-22 17:51:35.000000000 +0100
40 +@@ -17,4 +17,4 @@
41 + "ppx_tools" {>= "0.99.3"}
42 + "ppx_type_conv"
43 + ]
44 +-available: [ ocaml-version >= "4.02.3" ]
45 ++available: [ ocaml-version >= "4.03.0" ]
46 +diff -uNr ppx_bin_prot-113.33.00/src/ppx_bin_prot.ml ppx_bin_prot-113.33.00+4.03/src/ppx_bin_prot.ml
47 +--- ppx_bin_prot-113.33.00/src/ppx_bin_prot.ml 2016-03-09 16:44:53.000000000 +0100
48 ++++ ppx_bin_prot-113.33.00+4.03/src/ppx_bin_prot.ml 2016-03-22 15:13:49.000000000 +0100
49 +@@ -37,7 +37,7 @@
50 + ~init:result_type
51 + ~f:(fun (tp, _variance) acc ->
52 + let loc = tp.ptyp_loc in
53 +- ptyp_arrow ~loc "" (wrap_type ~loc tp) acc)
54 ++ ptyp_arrow ~loc Nolabel (wrap_type ~loc tp) acc)
55 + in
56 + psig_value ~loc (value_description ~loc ~name ~type_:typ ~prim:[])
57 +
58 +@@ -72,7 +72,12 @@
59 + | Rinherit _ -> false)
60 + ;;
61 +
62 +-let atoms_in_variant cds = List.exists cds ~f:(fun cds -> cds.pcd_args = [])
63 ++let atoms_in_variant cds =
64 ++ List.exists cds ~f:(fun cds ->
65 ++ match cds.pcd_args with
66 ++ | Pcstr_tuple [] -> true
67 ++ | Pcstr_tuple _ -> false
68 ++ | Pcstr_record _ -> failwith "Pcstr_record not supported")
69 +
70 + let let_ins loc bindings expr =
71 + List.fold_right bindings ~init:expr ~f:(fun binding expr ->
72 +@@ -327,8 +332,8 @@
73 + Location.raise_errorf ~loc:ty.ptyp_loc
74 + "bin_size_sum: GADTs are not supported by bin_prot");
75 + match cd.pcd_args with
76 +- | [] -> acc
77 +- | args ->
78 ++ | Pcstr_tuple [] -> acc
79 ++ | Pcstr_tuple args ->
80 + let get_tp tp = tp in
81 + let mk_patt loc v_name _ = pvar ~loc v_name in
82 + let patts, size_args =
83 +@@ -344,7 +349,8 @@
84 + let size = [%e size_tag] in
85 + [%e size_args]
86 + ]
87 +- :: acc)
88 ++ :: acc
89 ++ | Pcstr_record _ -> failwith "Pcstr_record not supported")
90 + in
91 + let matchings =
92 + if atoms_in_variant alts then
93 +@@ -585,13 +591,13 @@
94 + Location.raise_errorf ~loc:ty.ptyp_loc
95 + "bin_write_sum: GADTs are not supported by bin_prot");
96 + match cd.pcd_args with
97 +- | [] ->
98 ++ | Pcstr_tuple [] ->
99 + let loc = cd.pcd_loc in
100 + case
101 + ~lhs:(pconstruct cd None)
102 + ~guard:None
103 + ~rhs:(eapply ~loc write_tag [eint ~loc i])
104 +- | args ->
105 ++ | Pcstr_tuple args ->
106 + let get_tp tp = tp in
107 + let mk_patt loc v_name _ = pvar ~loc v_name in
108 + let patts, write_args =
109 +@@ -606,7 +612,8 @@
110 + ~rhs:[%expr
111 + let pos = [%e write_tag] [%e eint ~loc i] in
112 + [%e write_args]
113 +- ])
114 ++ ]
115 ++ | Pcstr_record _ -> failwith "Pcstr_record not supported")
116 + in
117 + `Match matchings
118 +
119 +@@ -934,13 +941,14 @@
120 + Location.raise_errorf ~loc:cd.pcd_loc
121 + "bin_read_sum: GADTs are not supported by bin_prot");
122 + match cd.pcd_args with
123 +- | [] ->
124 ++ | Pcstr_tuple [] ->
125 + let loc = cd.pcd_loc in
126 + case ~lhs:(pint ~loc mi) ~guard:None ~rhs:(econstruct cd None)
127 +- | args ->
128 ++ | Pcstr_tuple args ->
129 + let bindings, args_expr = handle_arg_tp loc full_type_name args in
130 + let rhs = let_ins loc bindings (econstruct cd (Some args_expr)) in
131 + case ~lhs:(pint ~loc mi) ~guard:None ~rhs
132 ++ | Pcstr_record _ -> failwith "Pcstr_record not supported"
133 + in
134 + let mcs = List.mapi alts ~f:map in
135 + let n_alts = List.length alts in
136
137 diff --git a/dev-ml/ppx_bin_prot/ppx_bin_prot-113.33.00.ebuild b/dev-ml/ppx_bin_prot/ppx_bin_prot-113.33.00.ebuild
138 index 50cf669..88ae9f7 100644
139 --- a/dev-ml/ppx_bin_prot/ppx_bin_prot-113.33.00.ebuild
140 +++ b/dev-ml/ppx_bin_prot/ppx_bin_prot-113.33.00.ebuild
141 @@ -27,6 +27,10 @@ DEPEND="${DEPEND} dev-ml/opam"
142
143 S="${WORKDIR}/${MY_P}"
144
145 +src_prepare() {
146 + has_version '>=dev-lang/ocaml-4.03' && epatch "${FILESDIR}/oc43.patch"
147 +}
148 +
149 src_configure() {
150 emake setup.exe
151 OASIS_SETUP_COMMAND="./setup.exe" oasis_src_configure