1 |
commit: af72c733c6f6687dde699b73c9197c20ab5cf97d |
2 |
Author: Conrad Kostecki <conikost <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun Oct 11 23:33:07 2020 +0000 |
4 |
Commit: Conrad Kostecki <conikost <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Oct 11 23:33:07 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=af72c733 |
7 |
|
8 |
dev-lua/luadbi: fix compilation with mysql-8 |
9 |
|
10 |
Closes: https://bugs.gentoo.org/695378 |
11 |
Package-Manager: Portage-3.0.8, Repoman-3.0.1 |
12 |
Signed-off-by: Conrad Kostecki <conikost <AT> gentoo.org> |
13 |
|
14 |
dev-lua/luadbi/files/luadbi-0.5-mysql-8.patch | 78 +++++++++++++++++++++++++++ |
15 |
dev-lua/luadbi/luadbi-0.5-r5.ebuild | 1 + |
16 |
dev-lua/luadbi/luadbi-0.5-r6.ebuild | 5 +- |
17 |
3 files changed, 83 insertions(+), 1 deletion(-) |
18 |
|
19 |
diff --git a/dev-lua/luadbi/files/luadbi-0.5-mysql-8.patch b/dev-lua/luadbi/files/luadbi-0.5-mysql-8.patch |
20 |
new file mode 100644 |
21 |
index 00000000000..a75c9d46d07 |
22 |
--- /dev/null |
23 |
+++ b/dev-lua/luadbi/files/luadbi-0.5-mysql-8.patch |
24 |
@@ -0,0 +1,78 @@ |
25 |
+--- a/dbd/mysql/statement.c 2020-03-09 15:55:43.212010825 +0100 |
26 |
++++ b/dbd/mysql/statement.c 2020-03-09 15:57:37.703464570 +0100 |
27 |
+@@ -200,7 +200,10 @@ |
28 |
+ switch(type) { |
29 |
+ case LUA_TNIL: |
30 |
+ bind[i].buffer_type = MYSQL_TYPE_NULL; |
31 |
++#if MYSQL_VERSION_ID >= 80000 |
32 |
++#else |
33 |
+ bind[i].is_null = (my_bool*)1; |
34 |
++#endif |
35 |
+ break; |
36 |
+ |
37 |
+ case LUA_TBOOLEAN: |
38 |
+@@ -209,7 +213,11 @@ |
39 |
+ *boolean = lua_toboolean(L, p); |
40 |
+ |
41 |
+ bind[i].buffer_type = MYSQL_TYPE_LONG; |
42 |
+- bind[i].is_null = (my_bool*)0; |
43 |
++#if MYSQL_VERSION_ID >= 80000 |
44 |
++ bind[i].is_null = (bool*) 0; |
45 |
++#else |
46 |
++ bind[i].is_null = (my_bool*)0; |
47 |
++#endif |
48 |
+ bind[i].buffer = (char *)boolean; |
49 |
+ bind[i].length = 0; |
50 |
+ break; |
51 |
+@@ -224,7 +232,11 @@ |
52 |
+ *num = lua_tonumber(L, p); |
53 |
+ |
54 |
+ bind[i].buffer_type = MYSQL_TYPE_DOUBLE; |
55 |
+- bind[i].is_null = (my_bool*)0; |
56 |
++#if MYSQL_VERSION_ID >= 80000 |
57 |
++ bind[i].is_null = (bool*) 0; |
58 |
++#else |
59 |
++ bind[i].is_null = (my_bool*)0; |
60 |
++#endif |
61 |
+ bind[i].buffer = (char *)num; |
62 |
+ bind[i].length = 0; |
63 |
+ break; |
64 |
+@@ -235,7 +247,11 @@ |
65 |
+ str = lua_tolstring(L, p, str_len); |
66 |
+ |
67 |
+ bind[i].buffer_type = MYSQL_TYPE_STRING; |
68 |
+- bind[i].is_null = (my_bool*)0; |
69 |
++#if MYSQL_VERSION_ID >= 80000 |
70 |
++ bind[i].is_null = (bool*) 0; |
71 |
++#else |
72 |
++ bind[i].is_null = (my_bool*)0; |
73 |
++#endif |
74 |
+ bind[i].buffer = (char *)str; |
75 |
+ bind[i].length = str_len; |
76 |
+ break; |
77 |
+@@ -385,7 +385,7 @@ |
78 |
+ |
79 |
+ if (fields[i].type == MYSQL_TYPE_TIMESTAMP || fields[i].type == MYSQL_TYPE_DATETIME) { |
80 |
+ char str[20]; |
81 |
+- struct st_mysql_time *t = bind[i].buffer; |
82 |
++ MYSQL_TIME *t = bind[i].buffer; |
83 |
+ |
84 |
+ snprintf(str, 20, "%d-%02d-%02d %02d:%02d:%02d", t->year, t->month, t->day, t->hour, t->minute, t->second); |
85 |
+ |
86 |
+@@ -396,7 +396,7 @@ |
87 |
+ } |
88 |
+ } else if (fields[i].type == MYSQL_TYPE_TIME) { |
89 |
+ char str[9]; |
90 |
+- struct st_mysql_time *t = bind[i].buffer; |
91 |
++ MYSQL_TIME *t = bind[i].buffer; |
92 |
+ |
93 |
+ snprintf(str, 9, "%02d:%02d:%02d", t->hour, t->minute, t->second); |
94 |
+ |
95 |
+@@ -407,7 +407,7 @@ |
96 |
+ } |
97 |
+ } else if (fields[i].type == MYSQL_TYPE_DATE) { |
98 |
+ char str[20]; |
99 |
+- struct st_mysql_time *t = bind[i].buffer; |
100 |
++ MYSQL_TIME *t = bind[i].buffer; |
101 |
+ |
102 |
+ snprintf(str, 11, "%d-%02d-%02d", t->year, t->month, t->day); |
103 |
|
104 |
diff --git a/dev-lua/luadbi/luadbi-0.5-r5.ebuild b/dev-lua/luadbi/luadbi-0.5-r5.ebuild |
105 |
index e46445c3b8f..a2d657fb7d5 100644 |
106 |
--- a/dev-lua/luadbi/luadbi-0.5-r5.ebuild |
107 |
+++ b/dev-lua/luadbi/luadbi-0.5-r5.ebuild |
108 |
@@ -26,6 +26,7 @@ S="${WORKDIR}" |
109 |
|
110 |
src_prepare() { |
111 |
epatch "${FILESDIR}"/${PV}-r2-Makefile.patch |
112 |
+ epatch "${FILESDIR}"/${P}-mysql-8.patch |
113 |
sed -i -e "s#^INSTALL_DIR_LUA=.*#INSTALL_DIR_LUA=$(pkg-config --variable INSTALL_LMOD lua)#" \ |
114 |
-e "s#^INSTALL_DIR_BIN=.*#INSTALL_DIR_BIN=$(pkg-config --variable INSTALL_CMOD lua)#" \ |
115 |
-e "s#^LUA_INC_DIR=.*#LUA_INC_DIR=$(pkg-config --variable INSTALL_INC lua)#" \ |
116 |
|
117 |
diff --git a/dev-lua/luadbi/luadbi-0.5-r6.ebuild b/dev-lua/luadbi/luadbi-0.5-r6.ebuild |
118 |
index 2a24cb49017..44ae7c129ca 100644 |
119 |
--- a/dev-lua/luadbi/luadbi-0.5-r6.ebuild |
120 |
+++ b/dev-lua/luadbi/luadbi-0.5-r6.ebuild |
121 |
@@ -24,7 +24,10 @@ DEPEND="${RDEPEND} |
122 |
|
123 |
S="${WORKDIR}" |
124 |
|
125 |
-PATCHES=( "${FILESDIR}"/${PV}-r2-Makefile.patch ) |
126 |
+PATCHES=( |
127 |
+ "${FILESDIR}"/${PV}-r2-Makefile.patch |
128 |
+ "${FILESDIR}"/${P}-mysql-8.patch |
129 |
+) |
130 |
|
131 |
src_prepare() { |
132 |
default |