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_type_conv/files/, dev-ml/ppx_type_conv/
Date: Tue, 03 May 2016 09:14:35
Message-Id: 1462266832.ebedfa131a4d00867a4cb02b9a518859cb9418d9.aballier@gentoo
1 commit: ebedfa131a4d00867a4cb02b9a518859cb9418d9
2 Author: Alexis Ballier <aballier <AT> gentoo <DOT> org>
3 AuthorDate: Sun May 1 18:09:57 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=ebedfa13
7
8 dev-ml/ppx_type_conv: 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_type_conv/files/oc43.patch | 93 ++++++++++++++++++++++
14 .../ppx_type_conv/ppx_type_conv-113.33.00.ebuild | 6 +-
15 2 files changed, 98 insertions(+), 1 deletion(-)
16
17 diff --git a/dev-ml/ppx_type_conv/files/oc43.patch b/dev-ml/ppx_type_conv/files/oc43.patch
18 new file mode 100644
19 index 0000000..ac3a1df
20 --- /dev/null
21 +++ b/dev-ml/ppx_type_conv/files/oc43.patch
22 @@ -0,0 +1,93 @@
23 +diff -uNr ppx_type_conv-113.33.00/_oasis ppx_type_conv-113.33.00+4.03/_oasis
24 +--- ppx_type_conv-113.33.00/_oasis 2016-03-09 16:44:55.000000000 +0100
25 ++++ ppx_type_conv-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_type_conv
32 +-Version: 113.33.00
33 ++Version: 113.33.00+4.03
34 + Synopsis: Support Library for type-driven code generators
35 + Authors: Jane Street Group, LLC <opensource@××××××××××.com>
36 + Copyrights: (C) 2015-2016 Jane Street Group LLC <opensource@××××××××××.com>
37 +diff -uNr ppx_type_conv-113.33.00/opam ppx_type_conv-113.33.00+4.03/opam
38 +--- ppx_type_conv-113.33.00/opam 2016-03-18 12:08:01.000000000 +0100
39 ++++ ppx_type_conv-113.33.00+4.03/opam 2016-03-22 17:51:38.000000000 +0100
40 +@@ -17,4 +17,4 @@
41 + "ppx_driver"
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_type_conv-113.33.00/src/type_conv.ml ppx_type_conv-113.33.00+4.03/src/type_conv.ml
47 +--- ppx_type_conv-113.33.00/src/type_conv.ml 2016-03-09 16:44:55.000000000 +0100
48 ++++ ppx_type_conv-113.33.00+4.03/src/type_conv.ml 2016-03-22 15:13:51.000000000 +0100
49 +@@ -472,9 +472,10 @@
50 + Ast_pattern.(
51 + let label =
52 + map' __ ~f:(fun loc f label ->
53 +- if label = "" || label.[0] = '?' then
54 ++ match label with
55 ++ | Nolabel | Optional _ ->
56 + Location.raise_errorf ~loc "non-optional labeled argument expected"
57 +- else
58 ++ | Labelled label ->
59 + f label)
60 + in
61 + let generator_name () =
62 +@@ -530,16 +531,6 @@
63 + let get_str_exception_derivers = get_derivers deriving_attr_ec Deriver.Field.str_exception
64 + let get_sig_exception_derivers = get_derivers deriving_attr_ec Deriver.Field.sig_exception
65 +
66 +-let get_rec_flag tds =
67 +- let has_nonrec td =
68 +- List.exists td.ptype_attributes ~f:(fun (name, _) -> name.txt = "nonrec")
69 +- in
70 +- if List.exists tds ~f:has_nonrec then
71 +- Nonrecursive
72 +- else
73 +- Recursive
74 +-;;
75 +-
76 + (* +-----------------------------------------------------------------+
77 + | Unused warning stuff |
78 + +-----------------------------------------------------------------+ *)
79 +@@ -627,17 +618,16 @@
80 + let item = super#structure_item path item in
81 + let loc = item.pstr_loc in
82 + match item.pstr_desc with
83 +- | Pstr_type tds ->
84 ++ | Pstr_type (rec_flag, tds) ->
85 + begin match get_str_type_decl_derivers tds with
86 + | None -> [item]
87 + | Some (tds, generators) ->
88 +- let rec_flag = get_rec_flag tds in
89 + let generated =
90 + types_used_by_type_conv tds
91 + @ Generator.apply_all ~rev:true ~loc ~path (rec_flag, tds) generators;
92 + in
93 + let tds = List.map tds ~f:(remove generators)#type_declaration in
94 +- let item = { item with pstr_desc = Pstr_type tds } in
95 ++ let item = { item with pstr_desc = Pstr_type (rec_flag, tds) } in
96 + item :: disable_unused_warning_str ~loc generated
97 + end
98 +
99 +@@ -670,14 +660,13 @@
100 + let item = super#signature_item path item in
101 + let loc = item.psig_loc in
102 + match item.psig_desc with
103 +- | Psig_type tds ->
104 ++ | Psig_type (rec_flag, tds) ->
105 + begin match get_sig_type_decl_derivers tds with
106 + | None -> [item]
107 + | Some (tds, generators) ->
108 +- let rec_flag = get_rec_flag tds in
109 + let generated = Generator.apply_all ~loc ~path (rec_flag, tds) generators in
110 + let tds = List.map tds ~f:(remove generators)#type_declaration in
111 +- let item = { item with psig_desc = Psig_type tds } in
112 ++ let item = { item with psig_desc = Psig_type (rec_flag, tds) } in
113 + item :: disable_unused_warning_sig ~loc generated
114 + end
115 +
116
117 diff --git a/dev-ml/ppx_type_conv/ppx_type_conv-113.33.00.ebuild b/dev-ml/ppx_type_conv/ppx_type_conv-113.33.00.ebuild
118 index 3520939..c1370e2 100644
119 --- a/dev-ml/ppx_type_conv/ppx_type_conv-113.33.00.ebuild
120 +++ b/dev-ml/ppx_type_conv/ppx_type_conv-113.33.00.ebuild
121 @@ -4,7 +4,7 @@
122
123 EAPI="5"
124
125 -inherit oasis
126 +inherit oasis eutils
127
128 DESCRIPTION="Support Library for type-driven code generators"
129 HOMEPAGE="http://www.janestreet.com/ocaml"
130 @@ -24,6 +24,10 @@ DEPEND="dev-ml/ppx_tools:=
131 RDEPEND="${DEPEND}"
132 DEPEND="${DEPEND} dev-ml/opam"
133
134 +src_prepare() {
135 + has_version '>=dev-lang/ocaml-4.03' && epatch "${FILESDIR}/oc43.patch"
136 +}
137 +
138 src_configure() {
139 emake setup.exe
140 OASIS_SETUP_COMMAND="./setup.exe" oasis_src_configure