dev-ml/ppx_pipebang: fix build with ocaml 4.03
authorAlexis Ballier <aballier@gentoo.org>
Tue, 3 May 2016 16:29:56 +0000 (18:29 +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_pipebang/files/oc43.patch [new file with mode: 0644]
dev-ml/ppx_pipebang/ppx_pipebang-113.33.00.ebuild

diff --git a/dev-ml/ppx_pipebang/files/oc43.patch b/dev-ml/ppx_pipebang/files/oc43.patch
new file mode 100644 (file)
index 0000000..5f10fc0
--- /dev/null
@@ -0,0 +1,46 @@
+diff -uNr ppx_pipebang-113.33.00/_oasis ppx_pipebang-113.33.00+4.03/_oasis
+--- ppx_pipebang-113.33.00/_oasis      2016-03-09 16:44:54.000000000 +0100
++++ ppx_pipebang-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_pipebang
+-Version:          113.33.00
++Version:          113.33.00+4.03
+ Synopsis:         A ppx rewriter that inlines reverse application operators `|>` and `|!`
+ Authors:          Jane Street Group, LLC <opensource@janestreet.com>
+ Copyrights:       (C) 2015-2016 Jane Street Group LLC <opensource@janestreet.com>
+diff -uNr ppx_pipebang-113.33.00/opam ppx_pipebang-113.33.00+4.03/opam
+--- ppx_pipebang-113.33.00/opam        2016-03-18 12:08:01.000000000 +0100
++++ ppx_pipebang-113.33.00+4.03/opam   2016-03-22 17:51:37.000000000 +0100
+@@ -16,4 +16,4 @@
+   "ppx_driver"
+   "ppx_tools"  {>= "0.99.3"}
+ ]
+-available: [ ocaml-version >= "4.02.3" ]
++available: [ ocaml-version >= "4.03.0" ]
+diff -uNr ppx_pipebang-113.33.00/src/ppx_pipebang.ml ppx_pipebang-113.33.00+4.03/src/ppx_pipebang.ml
+--- ppx_pipebang-113.33.00/src/ppx_pipebang.ml 2016-03-09 16:44:54.000000000 +0100
++++ ppx_pipebang-113.33.00+4.03/src/ppx_pipebang.ml    2016-03-22 15:13:51.000000000 +0100
+@@ -11,16 +11,16 @@
+     let loc = e.pexp_loc in
+     match e.pexp_desc with
+     | Pexp_apply ({ pexp_desc = Pexp_ident { txt = Lident ("|!" | "|>"); _ }; _ },
+-                  [("", x); ("", y)]) -> begin
++                  [(Nolabel, x); (Nolabel, y)]) -> begin
+         let x = self#expression x in
+         let y = self#expression y in
+         match y with
+         | { pexp_desc = Pexp_construct (id, None); _ } ->
+           { y with pexp_desc = Pexp_construct (id, Some x) }
+         | { pexp_desc = Pexp_apply (f, args); pexp_attributes = []; _ } ->
+-          { e with pexp_desc = Pexp_apply (f, args @ [("", x)]) }
++          { e with pexp_desc = Pexp_apply (f, args @ [(Nolabel, x)]) }
+         | _ ->
+-          { e with pexp_desc = Pexp_apply (y, [("", x)]) }
++          { e with pexp_desc = Pexp_apply (y, [(Nolabel, x)]) }
+       end
+     | Pexp_ident { txt = Lident ("|!" | "|>" as s); _ } ->
+       Location.raise_errorf ~loc "%s must be applied to two arguments" s
index ae35794117cb6b64dcae73d75b3d7034f427acd8..867ca54721e029f89b438acc5f47433456b07a10 100644 (file)
@@ -22,6 +22,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