commit:     ebedfa131a4d00867a4cb02b9a518859cb9418d9
Author:     Alexis Ballier <aballier <AT> gentoo <DOT> org>
AuthorDate: Sun May  1 18:09:57 2016 +0000
Commit:     Alexis Ballier <aballier <AT> gentoo <DOT> org>
CommitDate: Tue May  3 09:13:52 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ebedfa13

dev-ml/ppx_type_conv: fix build with ocaml 4.03

Package-Manager: portage-2.2.28
Signed-off-by: Alexis Ballier <aballier <AT> gentoo.org>

 dev-ml/ppx_type_conv/files/oc43.patch              | 93 ++++++++++++++++++++++
 .../ppx_type_conv/ppx_type_conv-113.33.00.ebuild   |  6 +-
 2 files changed, 98 insertions(+), 1 deletion(-)

diff --git a/dev-ml/ppx_type_conv/files/oc43.patch 
b/dev-ml/ppx_type_conv/files/oc43.patch
new file mode 100644
index 0000000..ac3a1df
--- /dev/null
+++ b/dev-ml/ppx_type_conv/files/oc43.patch
@@ -0,0 +1,93 @@
+diff -uNr ppx_type_conv-113.33.00/_oasis ppx_type_conv-113.33.00+4.03/_oasis
+--- ppx_type_conv-113.33.00/_oasis     2016-03-09 16:44:55.000000000 +0100
++++ ppx_type_conv-113.33.00+4.03/_oasis        2016-03-22 15:13:51.000000000 
+0100
+@@ -1,8 +1,8 @@
+ OASISFormat:      0.4
+-OCamlVersion:     >= 4.02.3
++OCamlVersion:     >= 4.03.0
+ FindlibVersion:   >= 1.3.2
+ Name:             ppx_type_conv
+-Version:          113.33.00
++Version:          113.33.00+4.03
+ Synopsis:         Support Library for type-driven code generators
+ Authors:          Jane Street Group, LLC <[email protected]>
+ Copyrights:       (C) 2015-2016 Jane Street Group LLC 
<[email protected]>
+diff -uNr ppx_type_conv-113.33.00/opam ppx_type_conv-113.33.00+4.03/opam
+--- ppx_type_conv-113.33.00/opam       2016-03-18 12:08:01.000000000 +0100
++++ ppx_type_conv-113.33.00+4.03/opam  2016-03-22 17:51:38.000000000 +0100
+@@ -17,4 +17,4 @@
+   "ppx_driver"
+   "ppx_tools"    {>= "0.99.3"}
+ ]
+-available: [ ocaml-version >= "4.02.3" ]
++available: [ ocaml-version >= "4.03.0" ]
+diff -uNr ppx_type_conv-113.33.00/src/type_conv.ml 
ppx_type_conv-113.33.00+4.03/src/type_conv.ml
+--- ppx_type_conv-113.33.00/src/type_conv.ml   2016-03-09 16:44:55.000000000 
+0100
++++ ppx_type_conv-113.33.00+4.03/src/type_conv.ml      2016-03-22 
15:13:51.000000000 +0100
+@@ -472,9 +472,10 @@
+     Ast_pattern.(
+       let label =
+         map' __ ~f:(fun loc f label ->
+-          if label = "" || label.[0] = '?' then
++          match label with
++          | Nolabel | Optional _ ->
+             Location.raise_errorf ~loc "non-optional labeled argument 
expected"
+-          else
++          | Labelled label ->
+             f label)
+       in
+       let generator_name () =
+@@ -530,16 +531,6 @@
+ let get_str_exception_derivers = get_derivers deriving_attr_ec 
Deriver.Field.str_exception
+ let get_sig_exception_derivers = get_derivers deriving_attr_ec 
Deriver.Field.sig_exception
+ 
+-let get_rec_flag tds =
+-  let has_nonrec td =
+-    List.exists td.ptype_attributes ~f:(fun (name, _) -> name.txt = "nonrec")
+-  in
+-  if List.exists tds ~f:has_nonrec then
+-    Nonrecursive
+-  else
+-    Recursive
+-;;
+-
+ (* +-----------------------------------------------------------------+
+    | Unused warning stuff                                            |
+    +-----------------------------------------------------------------+ *)
+@@ -627,17 +618,16 @@
+       let item = super#structure_item path item in
+       let loc = item.pstr_loc in
+       match item.pstr_desc with
+-      | Pstr_type tds ->
++      | Pstr_type (rec_flag, tds) ->
+         begin match get_str_type_decl_derivers tds with
+         | None -> [item]
+         | Some (tds, generators) ->
+-          let rec_flag = get_rec_flag tds in
+           let generated =
+             types_used_by_type_conv tds
+             @ Generator.apply_all ~rev:true ~loc ~path (rec_flag, tds) 
generators;
+           in
+           let tds = List.map tds ~f:(remove generators)#type_declaration in
+-          let item = { item with pstr_desc = Pstr_type tds } in
++          let item = { item with pstr_desc = Pstr_type (rec_flag, tds) } in
+           item :: disable_unused_warning_str ~loc generated
+         end
+ 
+@@ -670,14 +660,13 @@
+       let item = super#signature_item path item in
+       let loc = item.psig_loc in
+       match item.psig_desc with
+-      | Psig_type tds ->
++      | Psig_type (rec_flag, tds) ->
+         begin match get_sig_type_decl_derivers tds with
+         | None -> [item]
+         | Some (tds, generators) ->
+-          let rec_flag = get_rec_flag tds in
+           let generated = Generator.apply_all ~loc ~path (rec_flag, tds) 
generators in
+           let tds = List.map tds ~f:(remove generators)#type_declaration in
+-          let item = { item with psig_desc = Psig_type tds } in
++          let item = { item with psig_desc = Psig_type (rec_flag, tds) } in
+           item :: disable_unused_warning_sig ~loc generated
+         end
+ 

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
index 3520939..c1370e2 100644
--- 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
@@ -4,7 +4,7 @@
 
 EAPI="5"
 
-inherit oasis
+inherit oasis eutils
 
 DESCRIPTION="Support Library for type-driven code generators"
 HOMEPAGE="http://www.janestreet.com/ocaml";
@@ -24,6 +24,10 @@ DEPEND="dev-ml/ppx_tools:=
 RDEPEND="${DEPEND}"
 DEPEND="${DEPEND} dev-ml/opam"
 
+src_prepare() {
+       has_version '>=dev-lang/ocaml-4.03' && epatch "${FILESDIR}/oc43.patch"
+}
+
 src_configure() {
        emake setup.exe
        OASIS_SETUP_COMMAND="./setup.exe" oasis_src_configure

Reply via email to