1 |
commit: 2775fe2fb1c9ace2fc1a9020d1e9ef07563559fa |
2 |
Author: Alexis Ballier <aballier <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue May 3 15:46:48 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=2775fe2f |
7 |
|
8 |
dev-ml/ppx_sexp_message: 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_sexp_message/files/oc43.patch | 90 ++++++++++++++++++++++ |
14 |
.../ppx_sexp_message-113.33.00.ebuild | 4 + |
15 |
2 files changed, 94 insertions(+) |
16 |
|
17 |
diff --git a/dev-ml/ppx_sexp_message/files/oc43.patch b/dev-ml/ppx_sexp_message/files/oc43.patch |
18 |
new file mode 100644 |
19 |
index 0000000..d2d4e09 |
20 |
--- /dev/null |
21 |
+++ b/dev-ml/ppx_sexp_message/files/oc43.patch |
22 |
@@ -0,0 +1,90 @@ |
23 |
+diff -uNr ppx_sexp_message-113.33.00/_oasis ppx_sexp_message-113.33.00+4.03/_oasis |
24 |
+--- ppx_sexp_message-113.33.00/_oasis 2016-03-09 16:44:54.000000000 +0100 |
25 |
++++ ppx_sexp_message-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_sexp_message |
32 |
+-Version: 113.33.00 |
33 |
++Version: 113.33.00+4.03 |
34 |
+ Synopsis: A ppx rewriter for easy construction of s-expressions |
35 |
+ Authors: Jane Street Group, LLC <opensource@××××××××××.com> |
36 |
+ Copyrights: (C) 2015-2016 Jane Street Group LLC <opensource@××××××××××.com> |
37 |
+diff -uNr ppx_sexp_message-113.33.00/opam ppx_sexp_message-113.33.00+4.03/opam |
38 |
+--- ppx_sexp_message-113.33.00/opam 2016-03-18 12:08:01.000000000 +0100 |
39 |
++++ ppx_sexp_message-113.33.00+4.03/opam 2016-03-22 17:51:37.000000000 +0100 |
40 |
+@@ -18,4 +18,4 @@ |
41 |
+ "ppx_sexp_conv" |
42 |
+ "ppx_tools" {>= "0.99.3"} |
43 |
+ ] |
44 |
+-available: [ ocaml-version >= "4.02.3" ] |
45 |
++available: [ ocaml-version >= "4.03.0" ] |
46 |
+diff -uNr ppx_sexp_message-113.33.00/src/ppx_sexp_message.ml ppx_sexp_message-113.33.00+4.03/src/ppx_sexp_message.ml |
47 |
+--- ppx_sexp_message-113.33.00/src/ppx_sexp_message.ml 2016-03-09 16:44:54.000000000 +0100 |
48 |
++++ ppx_sexp_message-113.33.00+4.03/src/ppx_sexp_message.ml 2016-03-22 15:13:51.000000000 +0100 |
49 |
+@@ -42,13 +42,10 @@ |
50 |
+ eapply ~loc (evar ~loc ("Sexplib.Conv.sexp_of_" ^ typ)) [pexp_constant ~loc const] |
51 |
+ in |
52 |
+ match const with |
53 |
+- | Const_int _ -> f "int" |
54 |
+- | Const_char _ -> f "char" |
55 |
+- | Const_string _ -> f "string" |
56 |
+- | Const_float _ -> f "float" |
57 |
+- | Const_int32 _ -> f "int32" |
58 |
+- | Const_int64 _ -> f "int64" |
59 |
+- | Const_nativeint _ -> f "nativeint" |
60 |
++ | Pconst_integer _ -> f "int" |
61 |
++ | Pconst_char _ -> f "char" |
62 |
++ | Pconst_string _ -> f "string" |
63 |
++ | Pconst_float _ -> f "float" |
64 |
+ ;; |
65 |
+ |
66 |
+ let rewrite_here e = |
67 |
+@@ -62,7 +59,7 @@ |
68 |
+ let e = rewrite_here e in |
69 |
+ let loc = e.pexp_loc in |
70 |
+ match e.pexp_desc with |
71 |
+- | Pexp_constant (Const_string ("", _)) -> |
72 |
++ | Pexp_constant (Pconst_string ("", _)) -> |
73 |
+ None |
74 |
+ | Pexp_constant const -> |
75 |
+ Some (sexp_of_constant ~loc const) |
76 |
+@@ -71,18 +68,6 @@ |
77 |
+ | _ -> Some [%expr Sexplib.Conv.sexp_of_string [%e e]] |
78 |
+ ;; |
79 |
+ |
80 |
+-type arg_label = |
81 |
+- | Nolabel |
82 |
+- | Labelled of string |
83 |
+- | Optional |
84 |
+- |
85 |
+-(* Will help with the switch to 4.03 *) |
86 |
+-let arg_label_of_string = function |
87 |
+- | "" -> Nolabel |
88 |
+- | s when s.[0] = '?' -> Optional |
89 |
+- | s -> Labelled s |
90 |
+-;; |
91 |
+- |
92 |
+ let sexp_of_labelled_expr (label, e) = |
93 |
+ let loc = e.pexp_loc in |
94 |
+ match label, e.pexp_desc with |
95 |
+@@ -97,7 +82,7 @@ |
96 |
+ | Labelled label, _ -> |
97 |
+ Some (sexp_inline ~loc (sexp_atom ~loc (estring ~loc label) |
98 |
+ :: List.of_option (sexp_of_expr e))) |
99 |
+- | Optional, _ -> |
100 |
++ | Optional _, _ -> |
101 |
+ (* Could be used to encode sexp_option if that's ever needed. *) |
102 |
+ Location.raise_errorf ~loc |
103 |
+ "ppx_sexp_value: optional argument not allowed here" |
104 |
+@@ -112,7 +97,7 @@ |
105 |
+ let labelled_exprs = |
106 |
+ match e.pexp_desc with |
107 |
+ | Pexp_apply (f, args) -> |
108 |
+- (Nolabel, f) :: List.map args ~f:(fun (label, e) -> arg_label_of_string label, e) |
109 |
++ (Nolabel, f) :: args |
110 |
+ | _ -> |
111 |
+ (Nolabel, e) :: [] |
112 |
+ in |
113 |
|
114 |
diff --git a/dev-ml/ppx_sexp_message/ppx_sexp_message-113.33.00.ebuild b/dev-ml/ppx_sexp_message/ppx_sexp_message-113.33.00.ebuild |
115 |
index 1c74f60..710c5fb 100644 |
116 |
--- a/dev-ml/ppx_sexp_message/ppx_sexp_message-113.33.00.ebuild |
117 |
+++ b/dev-ml/ppx_sexp_message/ppx_sexp_message-113.33.00.ebuild |
118 |
@@ -24,6 +24,10 @@ DEPEND="dev-ml/ppx_tools:= |
119 |
RDEPEND="${DEPEND}" |
120 |
DEPEND="${DEPEND} dev-ml/opam" |
121 |
|
122 |
+src_prepare() { |
123 |
+ has_version '>=dev-lang/ocaml-4.03' && epatch "${FILESDIR}/oc43.patch" |
124 |
+} |
125 |
+ |
126 |
src_configure() { |
127 |
emake setup.exe |
128 |
OASIS_SETUP_COMMAND="./setup.exe" oasis_src_configure |