summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexis Ballier <aballier@gentoo.org>2016-11-29 13:37:39 +0100
committerAlexis Ballier <aballier@gentoo.org>2016-11-29 16:05:22 +0100
commitb16ff5e76b8aa2daf85deddf3eba603c8e263a80 (patch)
tree17feefd169cfaf0b0299e8c9b89b2e5551a3b50f /dev-ml/ppx_tools
parentnet-nntp/sabnzbd: remove 1.1.0 (diff)
downloadgentoo-b16ff5e76b8aa2daf85deddf3eba603c8e263a80.tar.gz
gentoo-b16ff5e76b8aa2daf85deddf3eba603c8e263a80.tar.bz2
gentoo-b16ff5e76b8aa2daf85deddf3eba603c8e263a80.zip
dev-ml/ppx_tools: backport upstream fixes for ocaml 4.04
Package-Manager: portage-2.3.2
Diffstat (limited to 'dev-ml/ppx_tools')
-rw-r--r--dev-ml/ppx_tools/files/ocaml404.patch47
-rw-r--r--dev-ml/ppx_tools/ppx_tools-5.0.4.03.0.ebuild6
2 files changed, 52 insertions, 1 deletions
diff --git a/dev-ml/ppx_tools/files/ocaml404.patch b/dev-ml/ppx_tools/files/ocaml404.patch
new file mode 100644
index 00000000000..8a2ccee071e
--- /dev/null
+++ b/dev-ml/ppx_tools/files/ocaml404.patch
@@ -0,0 +1,47 @@
+Index: ppx_tools-5.0-4.03.0/ast_mapper_class.ml
+===================================================================
+--- ppx_tools-5.0-4.03.0.orig/ast_mapper_class.ml
++++ ppx_tools-5.0-4.03.0/ast_mapper_class.ml
+@@ -335,6 +335,7 @@ module P = struct
+ | Ppat_unpack s -> unpack ~loc ~attrs (map_loc sub s)
+ | Ppat_exception p -> exception_ ~loc ~attrs (sub # pat p)
+ | Ppat_extension x -> extension ~loc ~attrs (sub # extension x)
++ | Ppat_open (l, p) -> open_ ~loc ~attrs (map_loc sub l) (sub # pat p)
+ end
+
+ module CE = struct
+Index: ppx_tools-5.0-4.03.0/genlifter.ml
+===================================================================
+--- ppx_tools-5.0-4.03.0.orig/genlifter.ml
++++ ppx_tools-5.0-4.03.0/genlifter.ml
+@@ -49,8 +49,8 @@ module Main : sig end = struct
+ let rec gen ty =
+ if Hashtbl.mem printed ty then ()
+ else let tylid = Longident.parse ty in
+- let (_, td) =
+- try Env.lookup_type tylid env
++ let td =
++ try Env.find_type (Env.lookup_type tylid env) env
+ with Not_found ->
+ Format.eprintf "** Cannot resolve type %s@." ty;
+ exit 2
+Index: ppx_tools-5.0-4.03.0/rewriter.ml
+===================================================================
+--- ppx_tools-5.0-4.03.0.orig/rewriter.ml
++++ ppx_tools-5.0-4.03.0/rewriter.ml
+@@ -92,13 +92,13 @@ let () =
+ | `Struct ->
+ let pstr = Parse.implementation lexer in
+ let pstr = Pparse.apply_rewriters (* ~restore:true *) ~tool_name:!tool_name
+- Config.ast_impl_magic_number pstr in
++ Pparse.Structure pstr in
+ Pprintast.structure fmt pstr;
+ Format.pp_print_newline fmt ()
+ | `Sig ->
+ let psig = Parse.interface lexer in
+ let psig = Pparse.apply_rewriters (* ~restore:true *) ~tool_name:!tool_name
+- Config.ast_intf_magic_number psig in
++ Pparse.Signature psig in
+ Pprintast.signature fmt psig;
+ Format.pp_print_newline fmt ())
+ with exn ->
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
index 0caa4d7a3dc..1b7a8601f9d 100644
--- 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
@@ -4,7 +4,7 @@
EAPI=5
-inherit findlib versionator
+inherit findlib versionator eutils
MY_PV=$(replace_version_separator 2 '+')
DESCRIPTION="Tools for authors of ppx rewriters"
@@ -20,6 +20,10 @@ DEPEND=">=dev-lang/ocaml-4.03.0:="
RDEPEND="${DEPEND}"
S="${WORKDIR}/${PN}-$(replace_version_separator 2 '-')"
+src_prepare() {
+ has_version '>=dev-lang/ocaml-4.04_beta' && epatch "${FILESDIR}/ocaml404.patch"
+}
+
src_compile() {
emake -j1
}