summaryrefslogtreecommitdiff
path: root/dev-ml
diff options
context:
space:
mode:
authorAlexis Ballier <aballier@gentoo.org>2016-05-01 20:09:34 +0200
committerAlexis Ballier <aballier@gentoo.org>2016-05-03 11:13:52 +0200
commitcbc29b26347423fa03e477352f098a522f994125 (patch)
tree17819ca08cb7e59d8407da34316e98f35cbbe259 /dev-ml
parentdev-ml/ppx_optcomp: fix build with ocaml 4.03 (diff)
downloadgentoo-cbc29b26347423fa03e477352f098a522f994125.tar.gz
gentoo-cbc29b26347423fa03e477352f098a522f994125.tar.bz2
gentoo-cbc29b26347423fa03e477352f098a522f994125.zip
dev-ml/ppx_driver: fix build with ocaml 4.03
Package-Manager: portage-2.2.28 Signed-off-by: Alexis Ballier <aballier@gentoo.org>
Diffstat (limited to 'dev-ml')
-rw-r--r--dev-ml/ppx_driver/files/oc43.patch67
-rw-r--r--dev-ml/ppx_driver/ppx_driver-113.33.00.ebuild6
2 files changed, 72 insertions, 1 deletions
diff --git a/dev-ml/ppx_driver/files/oc43.patch b/dev-ml/ppx_driver/files/oc43.patch
new file mode 100644
index 000000000000..630d6bfff3fc
--- /dev/null
+++ b/dev-ml/ppx_driver/files/oc43.patch
@@ -0,0 +1,67 @@
+diff -uNr ppx_driver-113.33.00/_oasis ppx_driver-113.33.00+4.03/_oasis
+--- ppx_driver-113.33.00/_oasis 2016-03-09 16:44:54.000000000 +0100
++++ ppx_driver-113.33.00+4.03/_oasis 2016-03-22 15:13:50.000000000 +0100
+@@ -1,8 +1,8 @@
+ OASISFormat: 0.4
+-OCamlVersion: >= 4.02.3
++OCamlVersion: >= 4.03.0
+ FindlibVersion: >= 1.3.2
+ Name: ppx_driver
+-Version: 113.33.00
++Version: 113.33.00+4.03
+ Synopsis: Feature-full driver for OCaml AST transformers
+ Authors: Jane Street Group, LLC <opensource@janestreet.com>
+ Copyrights: (C) 2015-2016 Jane Street Group LLC <opensource@janestreet.com>
+diff -uNr ppx_driver-113.33.00/opam ppx_driver-113.33.00+4.03/opam
+--- ppx_driver-113.33.00/opam 2016-03-18 12:08:01.000000000 +0100
++++ ppx_driver-113.33.00+4.03/opam 2016-03-22 17:51:36.000000000 +0100
+@@ -16,4 +16,4 @@
+ "ppx_core"
+ "ppx_optcomp"
+ ]
+-available: [ ocaml-version >= "4.02.3" ]
++available: [ ocaml-version >= "4.03.0" ]
+diff -uNr ppx_driver-113.33.00/src/ppx_driver.ml ppx_driver-113.33.00+4.03/src/ppx_driver.ml
+--- ppx_driver-113.33.00/src/ppx_driver.ml 2016-03-09 16:44:54.000000000 +0100
++++ ppx_driver-113.33.00+4.03/src/ppx_driver.ml 2016-03-22 15:13:50.000000000 +0100
+@@ -111,6 +111,24 @@
+ |> fst
+ ;;
+
++let remove_empty_lets = object
++ inherit Ast_traverse.map as super
++
++ method! structure_item st =
++ let st = super#structure_item st in
++ match st.pstr_desc with
++ | Pstr_value (_, []) ->
++ let (module B) = Ast_builder.make st.pstr_loc in
++ B.pstr_value Nonrecursive [B.value_binding ~pat:B.punit ~expr:B.eunit]
++ | _ -> st
++
++ method! expression e =
++ let e = super#expression e in
++ match e.pexp_desc with
++ | Pexp_let (_, [], e) -> e
++ | _ -> e
++end
++
+ let map_structure st =
+ let st =
+ if !perform_checks then begin
+@@ -123,6 +141,7 @@
+ apply_transforms st ~field:(fun (ct : Transform.t) -> ct.impl)
+ ~dropped_so_far:Attribute.dropped_so_far_structure
+ in
++ let st = remove_empty_lets#structure st in
+ if !perform_checks then begin
+ Attribute.check_unused#structure st;
+ Extension.check_unused#structure st;
+@@ -143,6 +162,7 @@
+ apply_transforms sg ~field:(fun ct -> ct.intf)
+ ~dropped_so_far:Attribute.dropped_so_far_signature
+ in
++ let sg = remove_empty_lets#signature sg in
+ if !perform_checks then begin
+ Attribute.check_unused#signature sg;
+ Extension.check_unused#signature sg;
diff --git a/dev-ml/ppx_driver/ppx_driver-113.33.00.ebuild b/dev-ml/ppx_driver/ppx_driver-113.33.00.ebuild
index 9e4a762fd5c0..798b803817a8 100644
--- a/dev-ml/ppx_driver/ppx_driver-113.33.00.ebuild
+++ b/dev-ml/ppx_driver/ppx_driver-113.33.00.ebuild
@@ -4,7 +4,7 @@
EAPI="5"
-inherit oasis
+inherit oasis eutils
DESCRIPTION="Feature-full driver for OCaml AST transformers"
HOMEPAGE="http://www.janestreet.com/ocaml"
@@ -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