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_tools/, dev-ml/ppx_tools/files/
Date: Tue, 29 Nov 2016 15:05:56
Message-Id: 1480431922.b16ff5e76b8aa2daf85deddf3eba603c8e263a80.aballier@gentoo
1 commit: b16ff5e76b8aa2daf85deddf3eba603c8e263a80
2 Author: Alexis Ballier <aballier <AT> gentoo <DOT> org>
3 AuthorDate: Tue Nov 29 12:37:39 2016 +0000
4 Commit: Alexis Ballier <aballier <AT> gentoo <DOT> org>
5 CommitDate: Tue Nov 29 15:05:22 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b16ff5e7
7
8 dev-ml/ppx_tools: backport upstream fixes for ocaml 4.04
9
10 Package-Manager: portage-2.3.2
11
12 dev-ml/ppx_tools/files/ocaml404.patch | 47 ++++++++++++++++++++++++++++
13 dev-ml/ppx_tools/ppx_tools-5.0.4.03.0.ebuild | 6 +++-
14 2 files changed, 52 insertions(+), 1 deletion(-)
15
16 diff --git a/dev-ml/ppx_tools/files/ocaml404.patch b/dev-ml/ppx_tools/files/ocaml404.patch
17 new file mode 100644
18 index 00000000..8a2ccee
19 --- /dev/null
20 +++ b/dev-ml/ppx_tools/files/ocaml404.patch
21 @@ -0,0 +1,47 @@
22 +Index: ppx_tools-5.0-4.03.0/ast_mapper_class.ml
23 +===================================================================
24 +--- ppx_tools-5.0-4.03.0.orig/ast_mapper_class.ml
25 ++++ ppx_tools-5.0-4.03.0/ast_mapper_class.ml
26 +@@ -335,6 +335,7 @@ module P = struct
27 + | Ppat_unpack s -> unpack ~loc ~attrs (map_loc sub s)
28 + | Ppat_exception p -> exception_ ~loc ~attrs (sub # pat p)
29 + | Ppat_extension x -> extension ~loc ~attrs (sub # extension x)
30 ++ | Ppat_open (l, p) -> open_ ~loc ~attrs (map_loc sub l) (sub # pat p)
31 + end
32 +
33 + module CE = struct
34 +Index: ppx_tools-5.0-4.03.0/genlifter.ml
35 +===================================================================
36 +--- ppx_tools-5.0-4.03.0.orig/genlifter.ml
37 ++++ ppx_tools-5.0-4.03.0/genlifter.ml
38 +@@ -49,8 +49,8 @@ module Main : sig end = struct
39 + let rec gen ty =
40 + if Hashtbl.mem printed ty then ()
41 + else let tylid = Longident.parse ty in
42 +- let (_, td) =
43 +- try Env.lookup_type tylid env
44 ++ let td =
45 ++ try Env.find_type (Env.lookup_type tylid env) env
46 + with Not_found ->
47 + Format.eprintf "** Cannot resolve type %s@." ty;
48 + exit 2
49 +Index: ppx_tools-5.0-4.03.0/rewriter.ml
50 +===================================================================
51 +--- ppx_tools-5.0-4.03.0.orig/rewriter.ml
52 ++++ ppx_tools-5.0-4.03.0/rewriter.ml
53 +@@ -92,13 +92,13 @@ let () =
54 + | `Struct ->
55 + let pstr = Parse.implementation lexer in
56 + let pstr = Pparse.apply_rewriters (* ~restore:true *) ~tool_name:!tool_name
57 +- Config.ast_impl_magic_number pstr in
58 ++ Pparse.Structure pstr in
59 + Pprintast.structure fmt pstr;
60 + Format.pp_print_newline fmt ()
61 + | `Sig ->
62 + let psig = Parse.interface lexer in
63 + let psig = Pparse.apply_rewriters (* ~restore:true *) ~tool_name:!tool_name
64 +- Config.ast_intf_magic_number psig in
65 ++ Pparse.Signature psig in
66 + Pprintast.signature fmt psig;
67 + Format.pp_print_newline fmt ())
68 + with exn ->
69
70 diff --git a/dev-ml/ppx_tools/ppx_tools-5.0.4.03.0.ebuild b/dev-ml/ppx_tools/ppx_tools-5.0.4.03.0.ebuild
71 index 0caa4d7..1b7a860 100644
72 --- a/dev-ml/ppx_tools/ppx_tools-5.0.4.03.0.ebuild
73 +++ b/dev-ml/ppx_tools/ppx_tools-5.0.4.03.0.ebuild
74 @@ -4,7 +4,7 @@
75
76 EAPI=5
77
78 -inherit findlib versionator
79 +inherit findlib versionator eutils
80
81 MY_PV=$(replace_version_separator 2 '+')
82 DESCRIPTION="Tools for authors of ppx rewriters"
83 @@ -20,6 +20,10 @@ DEPEND=">=dev-lang/ocaml-4.03.0:="
84 RDEPEND="${DEPEND}"
85 S="${WORKDIR}/${PN}-$(replace_version_separator 2 '-')"
86
87 +src_prepare() {
88 + has_version '>=dev-lang/ocaml-4.04_beta' && epatch "${FILESDIR}/ocaml404.patch"
89 +}
90 +
91 src_compile() {
92 emake -j1
93 }