dev-ml/ppx_expect: fix build with ocaml 4.03
authorAlexis Ballier <aballier@gentoo.org>
Tue, 3 May 2016 17:20:53 +0000 (19:20 +0200)
committerAlexis Ballier <aballier@gentoo.org>
Tue, 3 May 2016 17:44:22 +0000 (19:44 +0200)
Package-Manager: portage-2.2.28
Signed-off-by: Alexis Ballier <aballier@gentoo.org>
dev-ml/ppx_expect/files/oc43.patch [new file with mode: 0644]
dev-ml/ppx_expect/ppx_expect-113.33.01.ebuild

diff --git a/dev-ml/ppx_expect/files/oc43.patch b/dev-ml/ppx_expect/files/oc43.patch
new file mode 100644 (file)
index 0000000..3606d29
--- /dev/null
@@ -0,0 +1,49 @@
+diff -uNr ppx_expect-113.33.01/expect_payload/ppx_expect_payload.ml ppx_expect-113.33.01+4.03/expect_payload/ppx_expect_payload.ml
+--- ppx_expect-113.33.01/expect_payload/ppx_expect_payload.ml  2016-03-22 17:09:17.000000000 +0100
++++ ppx_expect-113.33.01+4.03/expect_payload/ppx_expect_payload.ml     2016-04-06 12:35:50.000000000 +0200
+@@ -63,7 +63,7 @@
+ let pattern () =
+   Ast_pattern.(
+-    map (single_expr_payload (pexp_loc __ (pexp_constant (const_string __ __))))
++    map (single_expr_payload (pexp_loc __ (pexp_constant (pconst_string __ __))))
+       ~f:(fun f loc s tag -> f (Some (loc, s, tag)))
+     |||
+     map (pstr nil)
+diff -uNr ppx_expect-113.33.01/_oasis ppx_expect-113.33.01+4.03/_oasis
+--- ppx_expect-113.33.01/_oasis        2016-03-22 17:09:17.000000000 +0100
++++ ppx_expect-113.33.01+4.03/_oasis   2016-04-06 12:35:50.000000000 +0200
+@@ -1,8 +1,8 @@
+ OASISFormat:           0.4
+-OCamlVersion:          >= 4.02.3
++OCamlVersion:          >= 4.03.0
+ FindlibVersion:        >= 1.3.2
+ Name:                  ppx_expect
+-Version:               113.33.01
++Version:               113.33.01+4.03
+ Synopsis:              Cram like framework for OCaml
+ Authors:               Jane Street Group, LLC <opensource@janestreet.com>
+ Copyrights:            (C) 2015-2016 Jane Street Group LLC <opensource@janestreet.com>
+diff -uNr ppx_expect-113.33.01/opam ppx_expect-113.33.01+4.03/opam
+--- ppx_expect-113.33.01/opam  2016-03-22 18:31:21.000000000 +0100
++++ ppx_expect-113.33.01+4.03/opam     2016-04-06 12:54:27.000000000 +0200
+@@ -27,4 +27,4 @@
+   "sexplib"
+   "variantslib"
+ ]
+-available: [ ocaml-version >= "4.02.3" ]
++available: [ ocaml-version >= "4.03.0" ]
+diff -uNr ppx_expect-113.33.01/src/expect_extension.ml ppx_expect-113.33.01+4.03/src/expect_extension.ml
+--- ppx_expect-113.33.01/src/expect_extension.ml       2016-03-22 17:09:17.000000000 +0100
++++ ppx_expect-113.33.01+4.03/src/expect_extension.ml  2016-04-06 12:35:50.000000000 +0200
+@@ -24,9 +24,8 @@
+   pstr ((
+     pstr_value nonrecursive (
+       value_binding
+-        ~pat:(map (pstring __) ~f:(fun f x -> f (Some x)))
++        ~pat:(alt_option (pstring __) ppat_any)
+         ~expr ^:: nil)
+-    ||| map (pstr_eval expr nil) ~f:(fun f -> f None)
+   ) ^:: nil)
+ let expect_test =
index c605caa63581d0472f0e214d79b1ddf6a7f54595..4bb651b677f7a3c4f4d4d93be78ecb4a3051d150 100644 (file)
@@ -34,6 +34,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