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_compare/files/, dev-ml/ppx_compare/
Date: Tue, 03 May 2016 14:17:56
Message-Id: 1462285058.128a1b8f637967b5e9cd2e22d9e2e2b399e66c82.aballier@gentoo
1 commit: 128a1b8f637967b5e9cd2e22d9e2e2b399e66c82
2 Author: Alexis Ballier <aballier <AT> gentoo <DOT> org>
3 AuthorDate: Tue May 3 14:17:16 2016 +0000
4 Commit: Alexis Ballier <aballier <AT> gentoo <DOT> org>
5 CommitDate: Tue May 3 14:17:38 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=128a1b8f
7
8 dev-ml/ppx_compare: 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_compare/files/oc43.patch | 126 ++++++++++++++++++++++++
14 dev-ml/ppx_compare/ppx_compare-113.33.00.ebuild | 4 +
15 2 files changed, 130 insertions(+)
16
17 diff --git a/dev-ml/ppx_compare/files/oc43.patch b/dev-ml/ppx_compare/files/oc43.patch
18 new file mode 100644
19 index 0000000..d346f7b
20 --- /dev/null
21 +++ b/dev-ml/ppx_compare/files/oc43.patch
22 @@ -0,0 +1,126 @@
23 +diff -uNr ppx_compare-113.33.00/expander/ppx_compare_expander.ml ppx_compare-113.33.00+4.03/expander/ppx_compare_expander.ml
24 +--- ppx_compare-113.33.00/expander/ppx_compare_expander.ml 2016-03-09 16:44:53.000000000 +0100
25 ++++ ppx_compare-113.33.00+4.03/expander/ppx_compare_expander.ml 2016-03-22 15:13:50.000000000 +0100
26 +@@ -219,53 +219,56 @@
27 + if cd.pcd_res <> None then
28 + Location.raise_errorf ~loc "GADTs are not supported by comparelib";
29 + match cd.pcd_args with
30 +- | [] ->
31 +- let pcnstr = pconstruct cd None in
32 +- let pany = ppat_any ~loc in
33 +- let case l r n =
34 +- case ~guard:None ~lhs:(ppat_tuple ~loc [l; r]) ~rhs:(eint ~loc n)
35 +- in
36 +- if rightmost then
37 +- [ case pcnstr pcnstr 0 ]
38 +- else
39 +- [ case pcnstr pcnstr 0
40 +- ; case pcnstr pany (-1)
41 +- ; case pany pcnstr 1
42 +- ]
43 +- | tps ->
44 +- let ids_ty =
45 +- List.map tps
46 +- ~f:(fun ty ->
47 +- (gen_symbol ~prefix:"_a" (),
48 +- gen_symbol ~prefix:"_b" (),
49 +- ty))
50 +- in
51 +- let lpatt = List.map ids_ty ~f:(fun (l,_r,_ty) -> pvar ~loc l) |> ppat_tuple ~loc
52 +- and rpatt = List.map ids_ty ~f:(fun (_l,r,_ty) -> pvar ~loc r) |> ppat_tuple ~loc
53 +- and body =
54 +- List.map ids_ty ~f:(fun (l,r,ty) ->
55 +- compare_of_ty ty (evar ~loc l) (evar ~loc r))
56 +- |> chain_if
57 +- in
58 +- let res =
59 +- case ~guard:None
60 +- ~lhs:(ppat_tuple ~loc [ pconstruct cd (Some lpatt)
61 +- ; pconstruct cd (Some rpatt)
62 +- ])
63 +- ~rhs:body
64 +- in
65 +- if rightmost then
66 +- [ res ]
67 +- else
68 ++ | Pcstr_record _ -> failwith "Pcstr_record not supported"
69 ++ | Pcstr_tuple pcd_args ->
70 ++ match pcd_args with
71 ++ | [] ->
72 ++ let pcnstr = pconstruct cd None in
73 + let pany = ppat_any ~loc in
74 +- let pcnstr = pconstruct cd (Some pany) in
75 + let case l r n =
76 + case ~guard:None ~lhs:(ppat_tuple ~loc [l; r]) ~rhs:(eint ~loc n)
77 + in
78 +- [ res
79 +- ; case pcnstr pany (-1)
80 +- ; case pany pcnstr 1
81 +- ])
82 ++ if rightmost then
83 ++ [ case pcnstr pcnstr 0 ]
84 ++ else
85 ++ [ case pcnstr pcnstr 0
86 ++ ; case pcnstr pany (-1)
87 ++ ; case pany pcnstr 1
88 ++ ]
89 ++ | tps ->
90 ++ let ids_ty =
91 ++ List.map tps
92 ++ ~f:(fun ty ->
93 ++ (gen_symbol ~prefix:"_a" (),
94 ++ gen_symbol ~prefix:"_b" (),
95 ++ ty))
96 ++ in
97 ++ let lpatt = List.map ids_ty ~f:(fun (l,_r,_ty) -> pvar ~loc l) |> ppat_tuple ~loc
98 ++ and rpatt = List.map ids_ty ~f:(fun (_l,r,_ty) -> pvar ~loc r) |> ppat_tuple ~loc
99 ++ and body =
100 ++ List.map ids_ty ~f:(fun (l,r,ty) ->
101 ++ compare_of_ty ty (evar ~loc l) (evar ~loc r))
102 ++ |> chain_if
103 ++ in
104 ++ let res =
105 ++ case ~guard:None
106 ++ ~lhs:(ppat_tuple ~loc [ pconstruct cd (Some lpatt)
107 ++ ; pconstruct cd (Some rpatt)
108 ++ ])
109 ++ ~rhs:body
110 ++ in
111 ++ if rightmost then
112 ++ [ res ]
113 ++ else
114 ++ let pany = ppat_any ~loc in
115 ++ let pcnstr = pconstruct cd (Some pany) in
116 ++ let case l r n =
117 ++ case ~guard:None ~lhs:(ppat_tuple ~loc [l; r]) ~rhs:(eint ~loc n)
118 ++ in
119 ++ [ res
120 ++ ; case pcnstr pany (-1)
121 ++ ; case pany pcnstr 1
122 ++ ])
123 + |> List.map ~f:List.rev
124 + |> List.concat
125 + |> List.rev
126 +diff -uNr ppx_compare-113.33.00/_oasis ppx_compare-113.33.00+4.03/_oasis
127 +--- ppx_compare-113.33.00/_oasis 2016-03-09 16:44:53.000000000 +0100
128 ++++ ppx_compare-113.33.00+4.03/_oasis 2016-03-22 15:13:50.000000000 +0100
129 +@@ -1,8 +1,8 @@
130 + OASISFormat: 0.4
131 +-OCamlVersion: >= 4.02.3
132 ++OCamlVersion: >= 4.03.0
133 + FindlibVersion: >= 1.3.2
134 + Name: ppx_compare
135 +-Version: 113.33.00
136 ++Version: 113.33.00+4.03
137 + Synopsis: Generation of comparison functions from types
138 + Authors: Jane Street Group, LLC <opensource@××××××××××.com>
139 + Copyrights: (C) 2015-2016 Jane Street Group LLC <opensource@××××××××××.com>
140 +diff -uNr ppx_compare-113.33.00/opam ppx_compare-113.33.00+4.03/opam
141 +--- ppx_compare-113.33.00/opam 2016-03-18 12:08:01.000000000 +0100
142 ++++ ppx_compare-113.33.00+4.03/opam 2016-03-22 17:51:35.000000000 +0100
143 +@@ -17,4 +17,4 @@
144 + "ppx_tools" {>= "0.99.3"}
145 + "ppx_type_conv"
146 + ]
147 +-available: [ ocaml-version >= "4.02.3" ]
148 ++available: [ ocaml-version >= "4.03.0" ]
149
150 diff --git a/dev-ml/ppx_compare/ppx_compare-113.33.00.ebuild b/dev-ml/ppx_compare/ppx_compare-113.33.00.ebuild
151 index 7b95ef5..fe7683e 100644
152 --- a/dev-ml/ppx_compare/ppx_compare-113.33.00.ebuild
153 +++ b/dev-ml/ppx_compare/ppx_compare-113.33.00.ebuild
154 @@ -24,6 +24,10 @@ DEPEND="
155 RDEPEND="${DEPEND}"
156 DEPEND="${DEPEND} dev-ml/opam"
157
158 +src_prepare() {
159 + has_version '>=dev-lang/ocaml-4.03' && epatch "${FILESDIR}/oc43.patch"
160 +}
161 +
162 src_configure() {
163 emake setup.exe
164 OASIS_SETUP_COMMAND="./setup.exe" oasis_src_configure