1 |
commit: cbc29b26347423fa03e477352f098a522f994125 |
2 |
Author: Alexis Ballier <aballier <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun May 1 18:09:34 2016 +0000 |
4 |
Commit: Alexis Ballier <aballier <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue May 3 09:13:52 2016 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=cbc29b26 |
7 |
|
8 |
dev-ml/ppx_driver: 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_driver/files/oc43.patch | 67 +++++++++++++++++++++++++++ |
14 |
dev-ml/ppx_driver/ppx_driver-113.33.00.ebuild | 6 ++- |
15 |
2 files changed, 72 insertions(+), 1 deletion(-) |
16 |
|
17 |
diff --git a/dev-ml/ppx_driver/files/oc43.patch b/dev-ml/ppx_driver/files/oc43.patch |
18 |
new file mode 100644 |
19 |
index 0000000..630d6bf |
20 |
--- /dev/null |
21 |
+++ b/dev-ml/ppx_driver/files/oc43.patch |
22 |
@@ -0,0 +1,67 @@ |
23 |
+diff -uNr ppx_driver-113.33.00/_oasis ppx_driver-113.33.00+4.03/_oasis |
24 |
+--- ppx_driver-113.33.00/_oasis 2016-03-09 16:44:54.000000000 +0100 |
25 |
++++ ppx_driver-113.33.00+4.03/_oasis 2016-03-22 15:13:50.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_driver |
32 |
+-Version: 113.33.00 |
33 |
++Version: 113.33.00+4.03 |
34 |
+ Synopsis: Feature-full driver for OCaml AST transformers |
35 |
+ Authors: Jane Street Group, LLC <opensource@××××××××××.com> |
36 |
+ Copyrights: (C) 2015-2016 Jane Street Group LLC <opensource@××××××××××.com> |
37 |
+diff -uNr ppx_driver-113.33.00/opam ppx_driver-113.33.00+4.03/opam |
38 |
+--- ppx_driver-113.33.00/opam 2016-03-18 12:08:01.000000000 +0100 |
39 |
++++ ppx_driver-113.33.00+4.03/opam 2016-03-22 17:51:36.000000000 +0100 |
40 |
+@@ -16,4 +16,4 @@ |
41 |
+ "ppx_core" |
42 |
+ "ppx_optcomp" |
43 |
+ ] |
44 |
+-available: [ ocaml-version >= "4.02.3" ] |
45 |
++available: [ ocaml-version >= "4.03.0" ] |
46 |
+diff -uNr ppx_driver-113.33.00/src/ppx_driver.ml ppx_driver-113.33.00+4.03/src/ppx_driver.ml |
47 |
+--- ppx_driver-113.33.00/src/ppx_driver.ml 2016-03-09 16:44:54.000000000 +0100 |
48 |
++++ ppx_driver-113.33.00+4.03/src/ppx_driver.ml 2016-03-22 15:13:50.000000000 +0100 |
49 |
+@@ -111,6 +111,24 @@ |
50 |
+ |> fst |
51 |
+ ;; |
52 |
+ |
53 |
++let remove_empty_lets = object |
54 |
++ inherit Ast_traverse.map as super |
55 |
++ |
56 |
++ method! structure_item st = |
57 |
++ let st = super#structure_item st in |
58 |
++ match st.pstr_desc with |
59 |
++ | Pstr_value (_, []) -> |
60 |
++ let (module B) = Ast_builder.make st.pstr_loc in |
61 |
++ B.pstr_value Nonrecursive [B.value_binding ~pat:B.punit ~expr:B.eunit] |
62 |
++ | _ -> st |
63 |
++ |
64 |
++ method! expression e = |
65 |
++ let e = super#expression e in |
66 |
++ match e.pexp_desc with |
67 |
++ | Pexp_let (_, [], e) -> e |
68 |
++ | _ -> e |
69 |
++end |
70 |
++ |
71 |
+ let map_structure st = |
72 |
+ let st = |
73 |
+ if !perform_checks then begin |
74 |
+@@ -123,6 +141,7 @@ |
75 |
+ apply_transforms st ~field:(fun (ct : Transform.t) -> ct.impl) |
76 |
+ ~dropped_so_far:Attribute.dropped_so_far_structure |
77 |
+ in |
78 |
++ let st = remove_empty_lets#structure st in |
79 |
+ if !perform_checks then begin |
80 |
+ Attribute.check_unused#structure st; |
81 |
+ Extension.check_unused#structure st; |
82 |
+@@ -143,6 +162,7 @@ |
83 |
+ apply_transforms sg ~field:(fun ct -> ct.intf) |
84 |
+ ~dropped_so_far:Attribute.dropped_so_far_signature |
85 |
+ in |
86 |
++ let sg = remove_empty_lets#signature sg in |
87 |
+ if !perform_checks then begin |
88 |
+ Attribute.check_unused#signature sg; |
89 |
+ Extension.check_unused#signature sg; |
90 |
|
91 |
diff --git a/dev-ml/ppx_driver/ppx_driver-113.33.00.ebuild b/dev-ml/ppx_driver/ppx_driver-113.33.00.ebuild |
92 |
index 9e4a762..798b803 100644 |
93 |
--- a/dev-ml/ppx_driver/ppx_driver-113.33.00.ebuild |
94 |
+++ b/dev-ml/ppx_driver/ppx_driver-113.33.00.ebuild |
95 |
@@ -4,7 +4,7 @@ |
96 |
|
97 |
EAPI="5" |
98 |
|
99 |
-inherit oasis |
100 |
+inherit oasis eutils |
101 |
|
102 |
DESCRIPTION="Feature-full driver for OCaml AST transformers" |
103 |
HOMEPAGE="http://www.janestreet.com/ocaml" |
104 |
@@ -22,6 +22,10 @@ DEPEND="dev-ml/ppx_tools:= |
105 |
RDEPEND="${DEPEND}" |
106 |
DEPEND="${DEPEND} dev-ml/opam" |
107 |
|
108 |
+src_prepare() { |
109 |
+ has_version '>=dev-lang/ocaml-4.03' && epatch "${FILESDIR}/oc43.patch" |
110 |
+} |
111 |
+ |
112 |
src_configure() { |
113 |
emake setup.exe |
114 |
OASIS_SETUP_COMMAND="./setup.exe" oasis_src_configure |