summaryrefslogtreecommitdiff
path: root/dev-ml
diff options
context:
space:
mode:
authorAlexis Ballier <aballier@gentoo.org>2016-05-01 19:12:48 +0200
committerAlexis Ballier <aballier@gentoo.org>2016-05-03 11:13:52 +0200
commit3d69094c95fb161c08bb0edd5cb0317a27c90343 (patch)
tree23e15f97468f41999c179425031db34582709f3f /dev-ml
parentdev-ml/js-build-tools: initial import; ebuild by me (diff)
downloadgentoo-3d69094c95fb161c08bb0edd5cb0317a27c90343.tar.gz
gentoo-3d69094c95fb161c08bb0edd5cb0317a27c90343.tar.bz2
gentoo-3d69094c95fb161c08bb0edd5cb0317a27c90343.zip
dev-ml/sexplib: 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/sexplib/files/oc43.patch56
-rw-r--r--dev-ml/sexplib/sexplib-113.33.00.ebuild6
2 files changed, 61 insertions, 1 deletions
diff --git a/dev-ml/sexplib/files/oc43.patch b/dev-ml/sexplib/files/oc43.patch
new file mode 100644
index 000000000000..9162d58dd481
--- /dev/null
+++ b/dev-ml/sexplib/files/oc43.patch
@@ -0,0 +1,56 @@
+diff -uNr sexplib-113.33.00/_oasis sexplib-113.33.00+4.03/_oasis
+--- sexplib-113.33.00/_oasis 2016-03-09 16:44:55.000000000 +0100
++++ sexplib-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: sexplib
+-Version: 113.33.00
++Version: 113.33.00+4.03
+ Synopsis: Library for serializing OCaml values to and from S-expressions
+ Authors: Jane Street Group, LLC <opensource@janestreet.com>
+ Copyrights: (C) 2005-2016 Jane Street Group LLC <opensource@janestreet.com>
+diff -uNr sexplib-113.33.00/src/conv.ml sexplib-113.33.00+4.03/src/conv.ml
+--- sexplib-113.33.00/src/conv.ml 2016-03-09 16:44:55.000000000 +0100
++++ sexplib-113.33.00+4.03/src/conv.ml 2016-03-22 15:13:51.000000000 +0100
+@@ -185,7 +185,7 @@
+
+ (* [Obj.extension_id] works on both the exception itself, and the extension slot of the
+ exception. *)
+- let rec clean_up_handler (slot : Obj.t) =
++ let rec clean_up_handler (slot : extension_constructor) =
+ let id = Obj.extension_id slot in
+ let old_exn_id_map = !exn_id_map in
+ let new_exn_id_map = Exn_ids.remove id old_exn_id_map in
+@@ -196,7 +196,7 @@
+ exn_id_map := new_exn_id_map
+
+ let add_auto ?(finalise = true) exn sexp_of_exn =
+- let id = Obj.extension_id exn in
++ let id = Obj.extension_id (Obj.extension_constructor exn) in
+ let rec loop () =
+ let old_exn_id_map = !exn_id_map in
+ let new_exn_id_map = Exn_ids.add id sexp_of_exn old_exn_id_map in
+@@ -205,13 +205,18 @@
+ loop ()
+ else begin
+ exn_id_map := new_exn_id_map;
+- if finalise then Gc.finalise clean_up_handler (Obj.extension_slot exn)
++ if finalise then
++ try
++ Gc.finalise clean_up_handler (Obj.extension_constructor exn)
++ with Invalid_argument _ ->
++ (* Pre-allocated extension constructors cannot be finalised *)
++ ()
+ end
+ in
+ loop ()
+
+ let find_auto exn =
+- let id = Obj.extension_id exn in
++ let id = Obj.extension_id (Obj.extension_constructor exn) in
+ match Exn_ids.find id !exn_id_map with
+ | exception Not_found -> None
+ | sexp_of_exn -> Some (sexp_of_exn exn)
diff --git a/dev-ml/sexplib/sexplib-113.33.00.ebuild b/dev-ml/sexplib/sexplib-113.33.00.ebuild
index 0e570c482ee5..f92685dedd48 100644
--- a/dev-ml/sexplib/sexplib-113.33.00.ebuild
+++ b/dev-ml/sexplib/sexplib-113.33.00.ebuild
@@ -7,7 +7,7 @@ EAPI=5
OASIS_BUILD_DOCS=1
OASIS_BUILD_TESTS=1
-inherit oasis
+inherit oasis eutils
DESCRIPTION="Library for automated conversion of OCaml-values to and from S-expressions"
HOMEPAGE="https://bitbucket.org/yminsky/ocaml-core/wiki/Home"
@@ -21,6 +21,10 @@ IUSE=""
RDEPEND=">=dev-ml/type-conv-113.00.00:="
DEPEND="${RDEPEND} 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