summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexis Ballier <aballier@gentoo.org>2017-07-14 00:07:49 +0200
committerAlexis Ballier <aballier@gentoo.org>2017-07-14 00:09:34 +0200
commit82b852916efb5ba3f1d49e0680b8071250c4d71f (patch)
treec6244f1b99546910b81835c27fb94efed2d45c2d /dev-ml/ppx_deriving
parentdev-ml/sedlex: bump to 1.99.4 (diff)
downloadgentoo-82b852916efb5ba3f1d49e0680b8071250c4d71f.tar.gz
gentoo-82b852916efb5ba3f1d49e0680b8071250c4d71f.tar.bz2
gentoo-82b852916efb5ba3f1d49e0680b8071250c4d71f.zip
dev-ml/ppx_deriving: Apply conditional patch, backported from upstream, to build with ocaml 4.05
Package-Manager: Portage-2.3.6, Repoman-2.3.2
Diffstat (limited to 'dev-ml/ppx_deriving')
-rw-r--r--dev-ml/ppx_deriving/files/ocaml405.patch21
-rw-r--r--dev-ml/ppx_deriving/ppx_deriving-4.1-r1.ebuild1
2 files changed, 22 insertions, 0 deletions
diff --git a/dev-ml/ppx_deriving/files/ocaml405.patch b/dev-ml/ppx_deriving/files/ocaml405.patch
new file mode 100644
index 000000000000..6f0a5c56f462
--- /dev/null
+++ b/dev-ml/ppx_deriving/files/ocaml405.patch
@@ -0,0 +1,21 @@
+Index: ppx_deriving-4.1/src/ppx_deriving.cppo.ml
+===================================================================
+--- ppx_deriving-4.1.orig/src/ppx_deriving.cppo.ml
++++ ppx_deriving-4.1/src/ppx_deriving.cppo.ml
+@@ -310,6 +310,7 @@ let free_vars_in_core_type typ =
+ List.map free_in xs |> List.concat
+ | { ptyp_desc = Ptyp_alias (x, name) } -> [name] @ free_in x
+ | { ptyp_desc = Ptyp_poly (bound, x) } ->
++ let bound = List.map (fun x -> x.Location.txt) bound in
+ List.filter (fun y -> not (List.mem y bound)) (free_in x)
+ | { ptyp_desc = Ptyp_variant (rows, _, _) } ->
+ List.map (
+@@ -401,7 +402,7 @@ let binop_reduce x a b =
+ [%expr [%e x] [%e a] [%e b]]
+
+ let strong_type_of_type ty =
+- let free_vars = free_vars_in_core_type ty in
++ let free_vars = List.map Location.mknoloc (free_vars_in_core_type ty) in
+ Typ.force_poly @@ Typ.poly free_vars ty
+
+ let derive path pstr_loc item attributes fn arg =
diff --git a/dev-ml/ppx_deriving/ppx_deriving-4.1-r1.ebuild b/dev-ml/ppx_deriving/ppx_deriving-4.1-r1.ebuild
index c0d348838f6c..5adaa541c9c4 100644
--- a/dev-ml/ppx_deriving/ppx_deriving-4.1-r1.ebuild
+++ b/dev-ml/ppx_deriving/ppx_deriving-4.1-r1.ebuild
@@ -24,6 +24,7 @@ DEPEND="${RDEPEND}
src_prepare() {
epatch "${FILESDIR}/ocb011.patch"
+ has_version '>=dev-lang/ocaml-4.05_rc' && epatch "${FILESDIR}/ocaml405.patch"
}
src_compile() {