1 |
commit: 56013d6071db66e97a6a7193594792b595610f3a |
2 |
Author: Alexis Ballier <aballier <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Sep 7 09:33:53 2016 +0000 |
4 |
Commit: Alexis Ballier <aballier <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Sep 7 09:34:01 2016 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=56013d60 |
7 |
|
8 |
dev-ml/eliom: backport another patch from upstream to work with ocaml 4.03 |
9 |
|
10 |
Package-Manager: portage-2.3.0 |
11 |
|
12 |
...eliom-5.0.0-r1.ebuild => eliom-5.0.0-r2.ebuild} | 2 +- |
13 |
dev-ml/eliom/files/oc43-2.patch | 136 +++++++++++++++++++++ |
14 |
2 files changed, 137 insertions(+), 1 deletion(-) |
15 |
|
16 |
diff --git a/dev-ml/eliom/eliom-5.0.0-r1.ebuild b/dev-ml/eliom/eliom-5.0.0-r2.ebuild |
17 |
similarity index 96% |
18 |
rename from dev-ml/eliom/eliom-5.0.0-r1.ebuild |
19 |
rename to dev-ml/eliom/eliom-5.0.0-r2.ebuild |
20 |
index 8aaec1f..36923d1 100644 |
21 |
--- a/dev-ml/eliom/eliom-5.0.0-r1.ebuild |
22 |
+++ b/dev-ml/eliom/eliom-5.0.0-r2.ebuild |
23 |
@@ -34,7 +34,7 @@ DEPEND="${RDEPEND} |
24 |
|
25 |
src_prepare() { |
26 |
if has_version '>=dev-lang/ocaml-4.03' ; then |
27 |
- epatch "${FILESDIR}/"{camlp4,oc43}.patch |
28 |
+ epatch "${FILESDIR}/"{camlp4,oc43,oc43-2}.patch |
29 |
fi |
30 |
has_version '>=dev-ml/tyxml-4' && epatch "${FILESDIR}/tyxml4.patch" |
31 |
} |
32 |
|
33 |
diff --git a/dev-ml/eliom/files/oc43-2.patch b/dev-ml/eliom/files/oc43-2.patch |
34 |
new file mode 100644 |
35 |
index 00000000..c7eb8e2 |
36 |
--- /dev/null |
37 |
+++ b/dev-ml/eliom/files/oc43-2.patch |
38 |
@@ -0,0 +1,136 @@ |
39 |
+commit 27c69ac5dfbc26744e304232bb8c0cf22d396082 |
40 |
+Author: Vasilis Papavasileiou <git@×××××××××××××××.net> |
41 |
+Date: Thu May 5 11:14:02 2016 -0400 |
42 |
+ |
43 |
+ Fix PPX for 4.03 (empty let bindings) |
44 |
+ |
45 |
+diff --git a/src/ppx/ppx_eliom_client.ml b/src/ppx/ppx_eliom_client.ml |
46 |
+index 580d2b5..fb2d263 100644 |
47 |
+--- a/src/ppx/ppx_eliom_client.ml |
48 |
++++ b/src/ppx/ppx_eliom_client.ml |
49 |
+@@ -89,21 +89,25 @@ module Pass = struct |
50 |
+ ] |
51 |
+ |
52 |
+ let define_client_functions ~loc client_value_datas = |
53 |
+- let bindings = |
54 |
+- List.map |
55 |
+- (fun (_num, id, expr, args) -> |
56 |
+- let patt = Pat.var id in |
57 |
+- let typ = find_fragment id in |
58 |
+- let args = List.map Pat.var args in |
59 |
+- let expr = |
60 |
+- [%expr |
61 |
+- fun [%p pat_args args] -> ([%e expr] : [%t typ]) |
62 |
+- ] [@metaloc loc] |
63 |
+- in |
64 |
+- Vb.mk ~loc patt expr) |
65 |
+- client_value_datas |
66 |
+- in |
67 |
+- Str.value ~loc Nonrecursive bindings |
68 |
++ match client_value_datas with |
69 |
++ | [] -> |
70 |
++ [] |
71 |
++ | _ -> |
72 |
++ let bindings = |
73 |
++ List.map |
74 |
++ (fun (_num, id, expr, args) -> |
75 |
++ let patt = Pat.var id in |
76 |
++ let typ = find_fragment id in |
77 |
++ let args = List.map Pat.var args in |
78 |
++ let expr = |
79 |
++ [%expr |
80 |
++ fun [%p pat_args args] -> ([%e expr] : [%t typ]) |
81 |
++ ] [@metaloc loc] |
82 |
++ in |
83 |
++ Vb.mk ~loc patt expr) |
84 |
++ client_value_datas |
85 |
++ in |
86 |
++ [Str.value ~loc Nonrecursive bindings] |
87 |
+ |
88 |
+ (* For injections *) |
89 |
+ |
90 |
+@@ -139,8 +143,8 @@ module Pass = struct |
91 |
+ let client_expr_data = flush_client_value_datas () in |
92 |
+ open_client_section loc :: |
93 |
+ register_client_closures client_expr_data @ |
94 |
+- [ define_client_functions loc client_expr_data ; |
95 |
+- item ; |
96 |
++ define_client_functions loc client_expr_data @ |
97 |
++ [ item ; |
98 |
+ close_server_section loc ; |
99 |
+ ] |
100 |
+ |
101 |
+@@ -155,11 +159,13 @@ module Pass = struct |
102 |
+ push_client_value_data num id expr |
103 |
+ (List.map fst escaped_bindings); |
104 |
+ |
105 |
+- match context with |
106 |
+- | `Server -> |
107 |
++ match context, escaped_bindings with |
108 |
++ | `Server, _ -> |
109 |
+ (* We are in a server fragment, this code should always be discarded. *) |
110 |
+ Exp.extension @@ AM.extension_of_error @@ Location.errorf "Eliom: ICE" |
111 |
+- | `Shared -> |
112 |
++ | `Shared, [] -> |
113 |
++ [%expr [%e frag_eid] ()][@metaloc loc] |
114 |
++ | `Shared, _ -> |
115 |
+ let bindings = |
116 |
+ List.map |
117 |
+ (fun (gen_id, expr) -> |
118 |
+diff --git a/src/ppx/ppx_eliom_server.ml b/src/ppx/ppx_eliom_server.ml |
119 |
+index 97f0b53..b5238ad 100644 |
120 |
+--- a/src/ppx/ppx_eliom_server.ml |
121 |
++++ b/src/ppx/ppx_eliom_server.ml |
122 |
+@@ -85,6 +85,7 @@ module Pass = struct |
123 |
+ let $gen_id$ = $orig_expr$ and ... |
124 |
+ (Necessary for injections in shared section) *) |
125 |
+ let bind_injected_idents injections = |
126 |
++ assert (injections <> []); |
127 |
+ let bindings = |
128 |
+ List.map |
129 |
+ (fun (txt, expr,_) -> |
130 |
+@@ -134,10 +135,15 @@ module Pass = struct |
131 |
+ |
132 |
+ let client_str item = |
133 |
+ let all_injections = flush_injections () in |
134 |
+- let loc = item.pstr_loc in |
135 |
+- [ bind_injected_idents all_injections; |
136 |
++ let ccs = |
137 |
++ let loc = item.pstr_loc in |
138 |
+ close_client_section loc all_injections |
139 |
+- ] |
140 |
++ in |
141 |
++ match all_injections with |
142 |
++ | [] -> |
143 |
++ [ ccs ] |
144 |
++ | l -> |
145 |
++ [ bind_injected_idents l ; ccs ] |
146 |
+ |
147 |
+ let server_str item = [ |
148 |
+ item ; |
149 |
+@@ -146,12 +152,19 @@ module Pass = struct |
150 |
+ |
151 |
+ let shared_str item = |
152 |
+ let all_injections = flush_injections () in |
153 |
+- let loc = item.pstr_loc in |
154 |
+- [ bind_injected_idents all_injections ; |
155 |
+- item ; |
156 |
+- close_server_section loc ; |
157 |
+- close_client_section loc all_injections ; |
158 |
+- ] |
159 |
++ let cl = |
160 |
++ let loc = item.pstr_loc in |
161 |
++ [ |
162 |
++ item; |
163 |
++ close_server_section loc ; |
164 |
++ close_client_section loc all_injections ; |
165 |
++ ] |
166 |
++ in |
167 |
++ match all_injections with |
168 |
++ | [] -> |
169 |
++ cl |
170 |
++ | l -> |
171 |
++ bind_injected_idents l :: cl |
172 |
+ |
173 |
+ let fragment ?typ ~context:_ ~num ~id expr = |
174 |
+ let typ = |