Gentoo Archives: gentoo-commits

From: Alexis Ballier <aballier@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-p2p/mldonkey/, net-p2p/mldonkey/files/
Date: Tue, 03 May 2016 09:14:22
Message-Id: 1462266832.1ddc06bf06bc144de45139545ff4eb6f660b443c.aballier@gentoo
1 commit: 1ddc06bf06bc144de45139545ff4eb6f660b443c
2 Author: Alexis Ballier <aballier <AT> gentoo <DOT> org>
3 AuthorDate: Sun May 1 16:01:08 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=1ddc06bf
7
8 net-p2p/mldonkey: 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 net-p2p/mldonkey/files/ocaml-4.03.patch | 145 ++++++++++++++++++++++++++++++++
14 net-p2p/mldonkey/mldonkey-3.1.5.ebuild | 1 +
15 2 files changed, 146 insertions(+)
16
17 diff --git a/net-p2p/mldonkey/files/ocaml-4.03.patch b/net-p2p/mldonkey/files/ocaml-4.03.patch
18 new file mode 100644
19 index 0000000..fce94c8
20 --- /dev/null
21 +++ b/net-p2p/mldonkey/files/ocaml-4.03.patch
22 @@ -0,0 +1,145 @@
23 +Index: mldonkey-3.1.5/src/config/unix/os_stubs_c.c
24 +===================================================================
25 +--- mldonkey-3.1.5.orig/src/config/unix/os_stubs_c.c
26 ++++ mldonkey-3.1.5/src/config/unix/os_stubs_c.c
27 +@@ -66,7 +66,7 @@ ssize_t os_read(OS_FD fd, char *buf, siz
28 +
29 + void os_ftruncate(OS_FD fd, OFF_T len, /* bool */ int sparse)
30 + {
31 +- int64 cursize;
32 ++ int64_t cursize;
33 + if(!fd) failwith("ftruncate32: file is closed");
34 +
35 + cursize = os_getfdsize(fd);
36 +@@ -109,7 +109,7 @@ int os_getdtablesize()
37 +
38 + *******************************************************************/
39 +
40 +-int64 os_getfdsize(OS_FD fd)
41 ++int64_t os_getfdsize(OS_FD fd)
42 + {
43 + struct stat buf;
44 +
45 +@@ -127,7 +127,7 @@ int64 os_getfdsize(OS_FD fd)
46 +
47 + *******************************************************************/
48 +
49 +-int64 os_getfilesize(char *path)
50 ++int64_t os_getfilesize(char *path)
51 + {
52 + struct stat buf;
53 +
54 +Index: mldonkey-3.1.5/src/networks/donkey/donkeyGlobals.ml
55 +===================================================================
56 +--- mldonkey-3.1.5.orig/src/networks/donkey/donkeyGlobals.ml
57 ++++ mldonkey-3.1.5/src/networks/donkey/donkeyGlobals.ml
58 +@@ -781,7 +781,6 @@ let set_client_name c name md4 =
59 + c.client_md4 <- md4;
60 + end
61 +
62 +-exception ClientFound of client
63 + let find_client_by_name name =
64 + try
65 + H.iter (fun c ->
66 +Index: mldonkey-3.1.5/src/utils/cdk/zip.ml
67 +===================================================================
68 +--- mldonkey-3.1.5.orig/src/utils/cdk/zip.ml
69 ++++ mldonkey-3.1.5/src/utils/cdk/zip.ml
70 +@@ -72,8 +72,6 @@ type out_file =
71 + mutable of_entries: entry list;
72 + of_comment: string }
73 +
74 +-exception Error of string * string * string
75 +-
76 + (* Return the position of the last occurrence of s1 in s2, or -1 if not
77 + found. *)
78 +
79 +Index: mldonkey-3.1.5/src/utils/cdk/zlibstubs.c
80 +===================================================================
81 +--- mldonkey-3.1.5.orig/src/utils/cdk/zlibstubs.c
82 ++++ mldonkey-3.1.5/src/utils/cdk/zlibstubs.c
83 +@@ -191,7 +191,7 @@ value camlzip_inflateEnd(value vzs)
84 +
85 + value camlzip_update_crc32(value crc, value buf, value pos, value len)
86 + {
87 +- return copy_int32(crc32((uint32) Int32_val(crc),
88 ++ return copy_int32(crc32((uint32_t) Int32_val(crc),
89 + &Byte_u(buf, Long_val(pos)),
90 + Long_val(len)));
91 + }
92 +Index: mldonkey-3.1.5/src/utils/lib/fst_hash.c
93 +===================================================================
94 +--- mldonkey-3.1.5.orig/src/utils/lib/fst_hash.c
95 ++++ mldonkey-3.1.5/src/utils/lib/fst_hash.c
96 +@@ -197,7 +197,7 @@ unsigned short fst_hash_checksum (unsign
97 + /*****************************************************************************/
98 +
99 + // hash file
100 +-int fst_hash_file (unsigned char *fth, char *file, int64 filesize)
101 ++int fst_hash_file (unsigned char *fth, char *file, int64_t filesize)
102 + {
103 + FILE *fp;
104 + unsigned char *buf;
105 +@@ -271,7 +271,7 @@ int fst_hash_file (unsigned char *fth, c
106 + }
107 +
108 +
109 +-void fst_hash_string (unsigned char *fth, unsigned char *file, int64 filesize)
110 ++void fst_hash_string (unsigned char *fth, unsigned char *file, int64_t filesize)
111 + {
112 + unsigned char * buf = file;
113 + size_t len = filesize;
114 +Index: mldonkey-3.1.5/src/utils/lib/options.ml4
115 +===================================================================
116 +--- mldonkey-3.1.5.orig/src/utils/lib/options.ml4
117 ++++ mldonkey-3.1.5/src/utils/lib/options.ml4
118 +@@ -332,7 +332,6 @@ let exit_exn = Exit
119 +
120 +
121 + let unsafe_get = String.unsafe_get
122 +-external is_printable : char -> bool = "caml_is_printable"
123 + let unsafe_set = String.unsafe_set
124 +
125 + let escaped s =
126 +@@ -343,7 +342,7 @@ let escaped s =
127 + (match unsafe_get s i with
128 + '"' | '\\' -> 2
129 + | '\n' | '\t' -> 1
130 +- | c -> if is_printable c then 1 else 4)
131 ++ | c -> 1)
132 + done;
133 + if !n = String.length s then s
134 + else
135 +@@ -354,16 +353,7 @@ let escaped s =
136 + '"' | '\\' as c -> unsafe_set s' !n '\\'; incr n; unsafe_set s' !n c
137 + | '\n' | '\t' as c -> unsafe_set s' !n c
138 + | c ->
139 +- if is_printable c then unsafe_set s' !n c
140 +- else
141 +- let a = int_of_char c in
142 +- unsafe_set s' !n '\\';
143 +- incr n;
144 +- unsafe_set s' !n (char_of_int (48 + a / 100));
145 +- incr n;
146 +- unsafe_set s' !n (char_of_int (48 + a / 10 mod 10));
147 +- incr n;
148 +- unsafe_set s' !n (char_of_int (48 + a mod 10))
149 ++ unsafe_set s' !n c
150 + end;
151 + incr n
152 + done;
153 +Index: mldonkey-3.1.5/src/utils/lib/os_stubs.h
154 +===================================================================
155 +--- mldonkey-3.1.5.orig/src/utils/lib/os_stubs.h
156 ++++ mldonkey-3.1.5/src/utils/lib/os_stubs.h
157 +@@ -155,8 +155,8 @@ extern OFF_T os_lseek(OS_FD fd, OFF_T po
158 + extern void os_ftruncate(OS_FD fd, OFF_T len, int sparse);
159 + extern ssize_t os_read(OS_FD fd, char *buf, size_t len);
160 + extern int os_getdtablesize();
161 +-extern int64 os_getfdsize(OS_FD fd);
162 +-extern int64 os_getfilesize(char *path);
163 ++extern int64_t os_getfdsize(OS_FD fd);
164 ++extern int64_t os_getfilesize(char *path);
165 + extern void os_set_nonblock(OS_SOCKET fd);
166 + extern void os_uname(char buf[]);
167 + extern int os_os_supported();
168
169 diff --git a/net-p2p/mldonkey/mldonkey-3.1.5.ebuild b/net-p2p/mldonkey/mldonkey-3.1.5.ebuild
170 index 84b99e1..b0eeb03 100644
171 --- a/net-p2p/mldonkey/mldonkey-3.1.5.ebuild
172 +++ b/net-p2p/mldonkey/mldonkey-3.1.5.ebuild
173 @@ -59,6 +59,7 @@ src_prepare() {
174 cd "${S}"
175 use ocamlopt || sed -i -e "s/ocamlopt/idontwantocamlopt/g" "${S}/config/configure" || die "failed to disable ocamlopt"
176 epatch "${FILESDIR}/ocaml4.patch"
177 + has_version '>=dev-lang/ocaml-4.03' && epatch "${FILESDIR}/ocaml-4.03.patch"
178 }
179
180 src_configure() {