Gentoo Archives: gentoo-commits

From: Alexis Ballier <aballier@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-ml/sexplib/, dev-ml/sexplib/files/
Date: Tue, 03 May 2016 09:14:29
Message-Id: 1462266832.3d69094c95fb161c08bb0edd5cb0317a27c90343.aballier@gentoo
1 commit: 3d69094c95fb161c08bb0edd5cb0317a27c90343
2 Author: Alexis Ballier <aballier <AT> gentoo <DOT> org>
3 AuthorDate: Sun May 1 17:12:48 2016 +0000
4 Commit: Alexis Ballier <aballier <AT> gentoo <DOT> org>
5 CommitDate: Tue May 3 09:13:52 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3d69094c
7
8 dev-ml/sexplib: fix build with ocaml 4.03
9
10 Package-Manager: portage-2.2.28
11 Signed-off-by: Alexis Ballier <aballier <AT> gentoo.org>
12
13 dev-ml/sexplib/files/oc43.patch | 56 +++++++++++++++++++++++++++++++++
14 dev-ml/sexplib/sexplib-113.33.00.ebuild | 6 +++-
15 2 files changed, 61 insertions(+), 1 deletion(-)
16
17 diff --git a/dev-ml/sexplib/files/oc43.patch b/dev-ml/sexplib/files/oc43.patch
18 new file mode 100644
19 index 0000000..9162d58
20 --- /dev/null
21 +++ b/dev-ml/sexplib/files/oc43.patch
22 @@ -0,0 +1,56 @@
23 +diff -uNr sexplib-113.33.00/_oasis sexplib-113.33.00+4.03/_oasis
24 +--- sexplib-113.33.00/_oasis 2016-03-09 16:44:55.000000000 +0100
25 ++++ sexplib-113.33.00+4.03/_oasis 2016-03-22 15:13:51.000000000 +0100
26 +@@ -1,8 +1,8 @@
27 + OASISFormat: 0.4
28 +-OCamlVersion: >= 4.02.3
29 ++OCamlVersion: >= 4.03.0
30 + FindlibVersion: >= 1.3.2
31 + Name: sexplib
32 +-Version: 113.33.00
33 ++Version: 113.33.00+4.03
34 + Synopsis: Library for serializing OCaml values to and from S-expressions
35 + Authors: Jane Street Group, LLC <opensource@××××××××××.com>
36 + Copyrights: (C) 2005-2016 Jane Street Group LLC <opensource@××××××××××.com>
37 +diff -uNr sexplib-113.33.00/src/conv.ml sexplib-113.33.00+4.03/src/conv.ml
38 +--- sexplib-113.33.00/src/conv.ml 2016-03-09 16:44:55.000000000 +0100
39 ++++ sexplib-113.33.00+4.03/src/conv.ml 2016-03-22 15:13:51.000000000 +0100
40 +@@ -185,7 +185,7 @@
41 +
42 + (* [Obj.extension_id] works on both the exception itself, and the extension slot of the
43 + exception. *)
44 +- let rec clean_up_handler (slot : Obj.t) =
45 ++ let rec clean_up_handler (slot : extension_constructor) =
46 + let id = Obj.extension_id slot in
47 + let old_exn_id_map = !exn_id_map in
48 + let new_exn_id_map = Exn_ids.remove id old_exn_id_map in
49 +@@ -196,7 +196,7 @@
50 + exn_id_map := new_exn_id_map
51 +
52 + let add_auto ?(finalise = true) exn sexp_of_exn =
53 +- let id = Obj.extension_id exn in
54 ++ let id = Obj.extension_id (Obj.extension_constructor exn) in
55 + let rec loop () =
56 + let old_exn_id_map = !exn_id_map in
57 + let new_exn_id_map = Exn_ids.add id sexp_of_exn old_exn_id_map in
58 +@@ -205,13 +205,18 @@
59 + loop ()
60 + else begin
61 + exn_id_map := new_exn_id_map;
62 +- if finalise then Gc.finalise clean_up_handler (Obj.extension_slot exn)
63 ++ if finalise then
64 ++ try
65 ++ Gc.finalise clean_up_handler (Obj.extension_constructor exn)
66 ++ with Invalid_argument _ ->
67 ++ (* Pre-allocated extension constructors cannot be finalised *)
68 ++ ()
69 + end
70 + in
71 + loop ()
72 +
73 + let find_auto exn =
74 +- let id = Obj.extension_id exn in
75 ++ let id = Obj.extension_id (Obj.extension_constructor exn) in
76 + match Exn_ids.find id !exn_id_map with
77 + | exception Not_found -> None
78 + | sexp_of_exn -> Some (sexp_of_exn exn)
79
80 diff --git a/dev-ml/sexplib/sexplib-113.33.00.ebuild b/dev-ml/sexplib/sexplib-113.33.00.ebuild
81 index 0e570c4..f92685d 100644
82 --- a/dev-ml/sexplib/sexplib-113.33.00.ebuild
83 +++ b/dev-ml/sexplib/sexplib-113.33.00.ebuild
84 @@ -7,7 +7,7 @@ EAPI=5
85 OASIS_BUILD_DOCS=1
86 OASIS_BUILD_TESTS=1
87
88 -inherit oasis
89 +inherit oasis eutils
90
91 DESCRIPTION="Library for automated conversion of OCaml-values to and from S-expressions"
92 HOMEPAGE="https://bitbucket.org/yminsky/ocaml-core/wiki/Home"
93 @@ -21,6 +21,10 @@ IUSE=""
94 RDEPEND=">=dev-ml/type-conv-113.00.00:="
95 DEPEND="${RDEPEND} dev-ml/opam"
96
97 +src_prepare() {
98 + has_version '>=dev-lang/ocaml-4.03' && epatch "${FILESDIR}/oc43.patch"
99 +}
100 +
101 src_configure() {
102 emake setup.exe
103 OASIS_SETUP_COMMAND="./setup.exe" oasis_src_configure