1 |
commit: e318bddd93a4c6ad9645a90534e6416edff4d7fd |
2 |
Author: Alexis Ballier <aballier <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun May 1 14:44:09 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=e318bddd |
7 |
|
8 |
dev-ml/ocaml-mysql: 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/ocaml-mysql/files/oc43.patch | 37 +++++++++++++++++++++++++++++ |
14 |
dev-ml/ocaml-mysql/ocaml-mysql-1.2.0.ebuild | 4 ++++ |
15 |
2 files changed, 41 insertions(+) |
16 |
|
17 |
diff --git a/dev-ml/ocaml-mysql/files/oc43.patch b/dev-ml/ocaml-mysql/files/oc43.patch |
18 |
new file mode 100644 |
19 |
index 0000000..5782c34 |
20 |
--- /dev/null |
21 |
+++ b/dev-ml/ocaml-mysql/files/oc43.patch |
22 |
@@ -0,0 +1,37 @@ |
23 |
+Index: ocaml-mysql-1.2.0/mysql_stubs.c |
24 |
+=================================================================== |
25 |
+--- ocaml-mysql-1.2.0.orig/mysql_stubs.c |
26 |
++++ ocaml-mysql-1.2.0/mysql_stubs.c |
27 |
+@@ -508,14 +508,14 @@ db_fetch (value result) |
28 |
+ |
29 |
+ EXTERNAL value |
30 |
+ db_to_row(value result, value offset) { |
31 |
+- int64 off = Int64_val(offset); |
32 |
++ int64_t off = Int64_val(offset); |
33 |
+ MYSQL_RES *res; |
34 |
+ |
35 |
+ res = RESval(result); |
36 |
+ if (!res) |
37 |
+ mysqlfailwith("Mysql.to_row: result did not return fetchable data"); |
38 |
+ |
39 |
+- if (off < 0 || off > (int64)mysql_num_rows(res)-1) |
40 |
++ if (off < 0 || off > (int64_t)mysql_num_rows(res)-1) |
41 |
+ invalid_argument("Mysql.to_row: offset out of range"); |
42 |
+ |
43 |
+ mysql_data_seek(res, off); |
44 |
+@@ -640,13 +640,13 @@ db_size(value result) |
45 |
+ { |
46 |
+ CAMLparam1(result); |
47 |
+ MYSQL_RES *res; |
48 |
+- int64 size; |
49 |
++ int64_t size; |
50 |
+ |
51 |
+ res = RESval(result); |
52 |
+ if (!res) |
53 |
+ size = 0; |
54 |
+ else |
55 |
+- size = (int64)(mysql_num_rows(res)); |
56 |
++ size = (int64_t)(mysql_num_rows(res)); |
57 |
+ |
58 |
+ CAMLreturn(copy_int64(size)); |
59 |
+ } |
60 |
|
61 |
diff --git a/dev-ml/ocaml-mysql/ocaml-mysql-1.2.0.ebuild b/dev-ml/ocaml-mysql/ocaml-mysql-1.2.0.ebuild |
62 |
index 76292cf..af4aeb1 100644 |
63 |
--- a/dev-ml/ocaml-mysql/ocaml-mysql-1.2.0.ebuild |
64 |
+++ b/dev-ml/ocaml-mysql/ocaml-mysql-1.2.0.ebuild |
65 |
@@ -22,6 +22,10 @@ SLOT="0/${PV}" |
66 |
LICENSE="LGPL-2" |
67 |
KEYWORDS="~amd64 ~ppc ~x86" |
68 |
|
69 |
+src_prepare() { |
70 |
+ has_version '>=dev-lang/ocaml-4.03' && epatch "${FILESDIR}/oc43.patch" |
71 |
+} |
72 |
+ |
73 |
src_compile() |
74 |
{ |
75 |
emake all |