1 |
commit: 7a3c37c979437f1267fac04617e69b96cc86fa6f |
2 |
Author: Alexis Ballier <aballier <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon Mar 27 13:40:49 2017 +0000 |
4 |
Commit: Alexis Ballier <aballier <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Mar 27 13:59:25 2017 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7a3c37c9 |
7 |
|
8 |
dev-ml/batteries: Fix build with ocaml 4.05 |
9 |
|
10 |
Package-Manager: Portage-2.3.5, Repoman-2.3.2 |
11 |
|
12 |
dev-ml/batteries/batteries-2.5.3.ebuild | 8 ++- |
13 |
dev-ml/batteries/files/ocaml405.patch | 92 +++++++++++++++++++++++++++++++++ |
14 |
2 files changed, 98 insertions(+), 2 deletions(-) |
15 |
|
16 |
diff --git a/dev-ml/batteries/batteries-2.5.3.ebuild b/dev-ml/batteries/batteries-2.5.3.ebuild |
17 |
index 74e5c5a448e..3190fe9cecc 100644 |
18 |
--- a/dev-ml/batteries/batteries-2.5.3.ebuild |
19 |
+++ b/dev-ml/batteries/batteries-2.5.3.ebuild |
20 |
@@ -1,9 +1,9 @@ |
21 |
-# Copyright 1999-2016 Gentoo Foundation |
22 |
+# Copyright 1999-2017 Gentoo Foundation |
23 |
# Distributed under the terms of the GNU General Public License v2 |
24 |
|
25 |
EAPI=5 |
26 |
|
27 |
-inherit oasis |
28 |
+inherit oasis eutils |
29 |
|
30 |
DESCRIPTION="The community-maintained foundation library for your OCaml projects" |
31 |
HOMEPAGE="https://github.com/ocaml-batteries-team/batteries-included/" |
32 |
@@ -21,3 +21,7 @@ DEPEND="${RDEPEND} |
33 |
DOCS=( "ChangeLog" "FAQ" "README.folders" "README.md" ) |
34 |
|
35 |
S="${WORKDIR}/${PN}-included-${PV}" |
36 |
+ |
37 |
+src_prepare() { |
38 |
+ has_version '>=dev-lang/ocaml-4.05_beta' && epatch "${FILESDIR}/ocaml405.patch" |
39 |
+} |
40 |
|
41 |
diff --git a/dev-ml/batteries/files/ocaml405.patch b/dev-ml/batteries/files/ocaml405.patch |
42 |
new file mode 100644 |
43 |
index 00000000000..e5016ee0a3c |
44 |
--- /dev/null |
45 |
+++ b/dev-ml/batteries/files/ocaml405.patch |
46 |
@@ -0,0 +1,92 @@ |
47 |
+Index: batteries-included-2.5.3/src/batGc.mliv |
48 |
+=================================================================== |
49 |
+--- batteries-included-2.5.3.orig/src/batGc.mliv |
50 |
++++ batteries-included-2.5.3/src/batGc.mliv |
51 |
+@@ -182,7 +182,7 @@ external counters : unit -> float * floa |
52 |
+ is as fast at [quick_stat]. *) |
53 |
+ |
54 |
+ ##V>=4.4##external minor_words : unit -> (float [@unboxed]) |
55 |
+-##V>=4.4## = "caml_gc_minor_words" "caml_gc_minor_words_unboxed" [@@noalloc] |
56 |
++##V>=4.4## = "caml_gc_minor_words" "caml_gc_minor_words_unboxed" |
57 |
+ ##V>=4.4##(** Number of words allocated in the minor heap since the program was |
58 |
+ ##V>=4.4## started. This number is accurate in byte-code programs, but only an |
59 |
+ ##V>=4.4## approximation in programs compiled to native code. |
60 |
+@@ -227,7 +227,7 @@ val allocated_bytes : unit -> float |
61 |
+ started. It is returned as a [float] to avoid overflow problems |
62 |
+ with [int] on 32-bit machines. *) |
63 |
+ |
64 |
+-##V>=4.3##external get_minor_free : unit -> int = "caml_get_minor_free" [@@noalloc] |
65 |
++##V>=4.3##external get_minor_free : unit -> int = "caml_get_minor_free" |
66 |
+ (** Return the current size of the free space inside the minor heap. |
67 |
+ @since 2.5.0 and OCaml 4.03.0 *) |
68 |
+ |
69 |
+Index: batteries-included-2.5.3/src/batInnerWeaktbl.ml |
70 |
+=================================================================== |
71 |
+--- batteries-included-2.5.3.orig/src/batInnerWeaktbl.ml |
72 |
++++ batteries-included-2.5.3/src/batInnerWeaktbl.ml |
73 |
+@@ -107,6 +107,7 @@ module Make (H: Hashtbl.HashedType) : Ha |
74 |
+ try ignore (Stack.pop (W.find tbl (dummy key))) with Not_found -> () |
75 |
+ let replace tbl key data = remove tbl key; add tbl key data |
76 |
+ let mem tbl key = try ignore (find tbl key); true with Not_found -> false |
77 |
++ let find_opt tbl key = if mem tbl key then Some(find tbl key) else None |
78 |
+ let iter f tbl = |
79 |
+ let f' (bk,v) = match unbox bk with Some k -> f k (obj v) | None -> () in |
80 |
+ W.iter (Stack.iter f') tbl |
81 |
+Index: batteries-included-2.5.3/src/batUnix.mliv |
82 |
+=================================================================== |
83 |
+--- batteries-included-2.5.3.orig/src/batUnix.mliv |
84 |
++++ batteries-included-2.5.3/src/batUnix.mliv |
85 |
+@@ -272,6 +272,8 @@ type open_flag = Unix.open_flag = |
86 |
+ ##V>=4.1## descriptor returned by {!openfile} |
87 |
+ ##V>=4.1## |
88 |
+ ##V>=4.1## Since OCaml 4.1 *) |
89 |
++##V>=4.5## | O_KEEPEXEC (** Clear the close-on-exec flag. |
90 |
++##V>=4.5## This is currently the default. *) |
91 |
+ (** The flags to {!Unix.openfile}. *) |
92 |
+ |
93 |
+ |
94 |
+@@ -546,11 +548,11 @@ val access : string -> access_permission |
95 |
+ (** {6 Operations on file descriptors} *) |
96 |
+ |
97 |
+ |
98 |
+-val dup : file_descr -> file_descr |
99 |
++val dup : ?cloexec:bool -> file_descr -> file_descr |
100 |
+ (** Return a new file descriptor referencing the same file as |
101 |
+ the given descriptor. *) |
102 |
+ |
103 |
+-val dup2 : file_descr -> file_descr -> unit |
104 |
++val dup2 : ?cloexec:bool -> file_descr -> file_descr -> unit |
105 |
+ (** [dup2 fd1 fd2] duplicates [fd1] to [fd2], closing [fd2] if already |
106 |
+ opened. *) |
107 |
+ |
108 |
+@@ -615,7 +617,7 @@ val closedir : dir_handle -> unit |
109 |
+ |
110 |
+ (** {6 Pipes and redirections} *) |
111 |
+ |
112 |
+-val pipe : unit -> file_descr * file_descr |
113 |
++val pipe : ?cloexec:bool -> unit -> file_descr * file_descr |
114 |
+ (** Create a pipe. The first component of the result is opened |
115 |
+ for reading, that's the exit to the pipe. The second component is |
116 |
+ opened for writing, that's the entrance to the pipe. *) |
117 |
+@@ -1151,7 +1153,7 @@ type sockaddr = Unix.sockaddr = |
118 |
+ domain; [addr] is the Internet address of the machine, and |
119 |
+ [port] is the port number. *) |
120 |
+ |
121 |
+-val socket : socket_domain -> socket_type -> int -> file_descr |
122 |
++val socket : ?cloexec:bool -> socket_domain -> socket_type -> int -> file_descr |
123 |
+ (** Create a new socket in the given domain, and with the |
124 |
+ given kind. The third argument is the protocol type; 0 selects |
125 |
+ the default protocol for that kind of sockets. *) |
126 |
+@@ -1160,10 +1162,10 @@ val domain_of_sockaddr: sockaddr -> sock |
127 |
+ (** Return the socket domain adequate for the given socket address. *) |
128 |
+ |
129 |
+ val socketpair : |
130 |
+- socket_domain -> socket_type -> int -> file_descr * file_descr |
131 |
++ ?cloexec:bool -> socket_domain -> socket_type -> int -> file_descr * file_descr |
132 |
+ (** Create a pair of unnamed sockets, connected together. *) |
133 |
+ |
134 |
+-val accept : file_descr -> file_descr * sockaddr |
135 |
++val accept : ?cloexec:bool -> file_descr -> file_descr * sockaddr |
136 |
+ (** Accept connections on the given socket. The returned descriptor |
137 |
+ is a socket connected to the client; the returned address is |
138 |
+ the address of the connecting client. *) |