1 |
commit: 5dd6f2696efea4bb767e27f31cd0bfe8d6d02e83 |
2 |
Author: Alexis Ballier <aballier <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun May 1 15:46:49 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=5dd6f269 |
7 |
|
8 |
dev-ml/ocamlnet: 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/ocamlnet/files/oc43.patch | 84 +++++++++++++++++++++++++++++++++++ |
14 |
dev-ml/ocamlnet/ocamlnet-4.1.1.ebuild | 4 ++ |
15 |
2 files changed, 88 insertions(+) |
16 |
|
17 |
diff --git a/dev-ml/ocamlnet/files/oc43.patch b/dev-ml/ocamlnet/files/oc43.patch |
18 |
new file mode 100644 |
19 |
index 0000000..93c6d3e |
20 |
--- /dev/null |
21 |
+++ b/dev-ml/ocamlnet/files/oc43.patch |
22 |
@@ -0,0 +1,84 @@ |
23 |
+commit 0893920618cec4885b1633fd2f81de84e7a8be72 |
24 |
+Author: Gerd Stolpmann <gerd@××××××××××××××.de> |
25 |
+Date: Sun May 1 13:24:22 2016 +0200 |
26 |
+ |
27 |
+ Fixes for building against OCaml-4.03 |
28 |
+ |
29 |
+diff --git a/code/src/equeue/uq_engines_compat.ml b/code/src/equeue/uq_engines_compat.ml |
30 |
+index 512811a..e779410 100644 |
31 |
+--- a/code/src/equeue/uq_engines_compat.ml |
32 |
++++ b/code/src/equeue/uq_engines_compat.ml |
33 |
+@@ -7,7 +7,8 @@ class type server_socket_acceptor = server_endpoint_acceptor |
34 |
+ class type client_socket_connector = client_endpoint_connector |
35 |
+ |
36 |
+ |
37 |
+-exception Mem_not_supported = Uq_multiplex.Mem_not_supported |
38 |
++(* exception Mem_not_supported = Uq_multiplex.Mem_not_supported *) |
39 |
++(* already included from Uq_engines *) |
40 |
+ |
41 |
+ let create_multiplex_controller_for_connected_socket = |
42 |
+ Uq_multiplex.create_multiplex_controller_for_connected_socket |
43 |
+diff --git a/code/src/netstring/netasn1.ml b/code/src/netstring/netasn1.ml |
44 |
+index 05d5d3a..4cada35 100644 |
45 |
+--- a/code/src/netstring/netasn1.ml |
46 |
++++ b/code/src/netstring/netasn1.ml |
47 |
+@@ -437,7 +437,7 @@ module Value = struct |
48 |
+ let hour = int_of_string (Netstring_str.matched_group m 4 s) in |
49 |
+ let minute = int_of_string (Netstring_str.matched_group m 5 s) in |
50 |
+ let second = int_of_string (Netstring_str.matched_group m 6 s) in |
51 |
+- let zonestr = Netstring_str.matched_group m 8s in |
52 |
++ let zonestr = Netstring_str.matched_group m 8 s in |
53 |
+ let zone = get_zone zonestr in |
54 |
+ if month = 0 || month > 12 || day = 0 || day > 31 || |
55 |
+ hour > 23 || minute > 59 || second > 59 |
56 |
+diff --git a/code/src/netsys/netlog.ml b/code/src/netsys/netlog.ml |
57 |
+index 4d87c0e..4633655 100644 |
58 |
+--- a/code/src/netsys/netlog.ml |
59 |
++++ b/code/src/netsys/netlog.ml |
60 |
+@@ -8,6 +8,18 @@ type level = |
61 |
+ type logger = |
62 |
+ level -> string -> unit |
63 |
+ |
64 |
++type timespec = float * int |
65 |
++type clock_id |
66 |
++type clock = |
67 |
++ (* originally from Netsys_posix *) |
68 |
++ | CLOCK_REALTIME |
69 |
++ | CLOCK_MONOTONIC |
70 |
++ | CLOCK_ID of clock_id |
71 |
++ |
72 |
++external clock_gettime : clock -> timespec = "netsys_clock_gettime" |
73 |
++(* originally from Netsys_posix *) |
74 |
++ |
75 |
++ |
76 |
+ let level_weight = |
77 |
+ function |
78 |
+ | `Emerg -> 0 |
79 |
+@@ -95,7 +107,7 @@ let current_formatter = |
80 |
+ let channel_logger ch max_lev lev msg = |
81 |
+ if level_weight lev <= level_weight max_lev then ( |
82 |
+ let (sec,ns) = |
83 |
+- try Netsys_posix.clock_gettime Netsys_posix.CLOCK_REALTIME |
84 |
++ try clock_gettime CLOCK_REALTIME |
85 |
+ with Invalid_argument _ -> |
86 |
+ (Unix.gettimeofday(), 0) in |
87 |
+ let s = (* Netdate is unavailable here *) |
88 |
+diff --git a/code/src/netsys/netsys_posix.ml b/code/src/netsys/netsys_posix.ml |
89 |
+index 1062a6c..602ceae 100644 |
90 |
+--- a/code/src/netsys/netsys_posix.ml |
91 |
++++ b/code/src/netsys/netsys_posix.ml |
92 |
+@@ -771,12 +771,14 @@ external readlinkat : Unix.file_descr -> string -> string |
93 |
+ type timespec = float * int |
94 |
+ type clock_id |
95 |
+ type clock = |
96 |
++ (* also in Netlog *) |
97 |
+ | CLOCK_REALTIME |
98 |
+ | CLOCK_MONOTONIC |
99 |
+ | CLOCK_ID of clock_id |
100 |
+ |
101 |
+ external nanosleep : timespec -> timespec ref -> unit = "netsys_nanosleep" |
102 |
+ external clock_gettime : clock -> timespec = "netsys_clock_gettime" |
103 |
++ (* also in Netlog *) |
104 |
+ external clock_settime : clock -> timespec -> unit = "netsys_clock_settime" |
105 |
+ external clock_getres : clock -> timespec = "netsys_clock_getres" |
106 |
+ external clock_getcpuclockid : int -> clock_id = "netsys_clock_getcpuclockid" |
107 |
|
108 |
diff --git a/dev-ml/ocamlnet/ocamlnet-4.1.1.ebuild b/dev-ml/ocamlnet/ocamlnet-4.1.1.ebuild |
109 |
index 5fe2f7a..5c042a3 100644 |
110 |
--- a/dev-ml/ocamlnet/ocamlnet-4.1.1.ebuild |
111 |
+++ b/dev-ml/ocamlnet/ocamlnet-4.1.1.ebuild |
112 |
@@ -35,6 +35,10 @@ DEPEND="${RDEPEND} |
113 |
|
114 |
S=${WORKDIR}/${MY_P} |
115 |
|
116 |
+src_prepare() { |
117 |
+ has_version '>=dev-lang/ocaml-4.03' && epatch "${FILESDIR}/oc43.patch" |
118 |
+} |
119 |
+ |
120 |
ocamlnet_use_with() { |
121 |
if use $1; then |
122 |
echo "-with-$2" |