commit:     af72c733c6f6687dde699b73c9197c20ab5cf97d
Author:     Conrad Kostecki <conikost <AT> gentoo <DOT> org>
AuthorDate: Sun Oct 11 23:33:07 2020 +0000
Commit:     Conrad Kostecki <conikost <AT> gentoo <DOT> org>
CommitDate: Sun Oct 11 23:33:07 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=af72c733

dev-lua/luadbi: fix compilation with mysql-8

Closes: https://bugs.gentoo.org/695378
Package-Manager: Portage-3.0.8, Repoman-3.0.1
Signed-off-by: Conrad Kostecki <conikost <AT> gentoo.org>

 dev-lua/luadbi/files/luadbi-0.5-mysql-8.patch | 78 +++++++++++++++++++++++++++
 dev-lua/luadbi/luadbi-0.5-r5.ebuild           |  1 +
 dev-lua/luadbi/luadbi-0.5-r6.ebuild           |  5 +-
 3 files changed, 83 insertions(+), 1 deletion(-)

diff --git a/dev-lua/luadbi/files/luadbi-0.5-mysql-8.patch 
b/dev-lua/luadbi/files/luadbi-0.5-mysql-8.patch
new file mode 100644
index 00000000000..a75c9d46d07
--- /dev/null
+++ b/dev-lua/luadbi/files/luadbi-0.5-mysql-8.patch
@@ -0,0 +1,78 @@
+--- a/dbd/mysql/statement.c    2020-03-09 15:55:43.212010825 +0100
++++ b/dbd/mysql/statement.c    2020-03-09 15:57:37.703464570 +0100
+@@ -200,7 +200,10 @@
+       switch(type) {
+           case LUA_TNIL:
+               bind[i].buffer_type = MYSQL_TYPE_NULL;
++#if MYSQL_VERSION_ID >= 80000
++#else
+               bind[i].is_null = (my_bool*)1;
++#endif
+               break;
+ 
+           case LUA_TBOOLEAN:
+@@ -209,7 +213,11 @@
+               *boolean = lua_toboolean(L, p);
+ 
+               bind[i].buffer_type = MYSQL_TYPE_LONG;
+-              bind[i].is_null = (my_bool*)0;
++#if MYSQL_VERSION_ID >= 80000
++                bind[i].is_null = (bool*) 0;
++#else
++                bind[i].is_null = (my_bool*)0;
++#endif
+               bind[i].buffer = (char *)boolean;
+               bind[i].length = 0;
+               break;
+@@ -224,7 +232,11 @@
+               *num = lua_tonumber(L, p);
+ 
+               bind[i].buffer_type = MYSQL_TYPE_DOUBLE;
+-              bind[i].is_null = (my_bool*)0;
++#if MYSQL_VERSION_ID >= 80000
++                bind[i].is_null = (bool*) 0;
++#else
++                bind[i].is_null = (my_bool*)0;
++#endif
+               bind[i].buffer = (char *)num;
+               bind[i].length = 0;
+               break;
+@@ -235,7 +247,11 @@
+               str = lua_tolstring(L, p, str_len);
+ 
+               bind[i].buffer_type = MYSQL_TYPE_STRING;
+-              bind[i].is_null = (my_bool*)0;
++#if MYSQL_VERSION_ID >= 80000
++                bind[i].is_null = (bool*) 0;
++#else
++                bind[i].is_null = (my_bool*)0;
++#endif
+               bind[i].buffer = (char *)str;
+               bind[i].length = str_len;
+               break;
+@@ -385,7 +385,7 @@
+ 
+                   if (fields[i].type == MYSQL_TYPE_TIMESTAMP || 
fields[i].type == MYSQL_TYPE_DATETIME) {
+                       char str[20];
+-                      struct st_mysql_time *t = bind[i].buffer;
++                      MYSQL_TIME *t = bind[i].buffer;
+ 
+                       snprintf(str, 20, "%d-%02d-%02d %02d:%02d:%02d", 
t->year, t->month, t->day, t->hour, t->minute, t->second);
+ 
+@@ -396,7 +396,7 @@
+                       }
+                   } else if (fields[i].type == MYSQL_TYPE_TIME) {
+                       char str[9];
+-                      struct st_mysql_time *t = bind[i].buffer;
++                      MYSQL_TIME *t = bind[i].buffer;
+ 
+                       snprintf(str, 9, "%02d:%02d:%02d", t->hour, t->minute, 
t->second);
+ 
+@@ -407,7 +407,7 @@
+                       }
+                   } else if (fields[i].type == MYSQL_TYPE_DATE) {
+                       char str[20];
+-                      struct st_mysql_time *t = bind[i].buffer;
++                      MYSQL_TIME *t = bind[i].buffer;
+ 
+                       snprintf(str, 11, "%d-%02d-%02d", t->year, t->month, 
t->day);

diff --git a/dev-lua/luadbi/luadbi-0.5-r5.ebuild 
b/dev-lua/luadbi/luadbi-0.5-r5.ebuild
index e46445c3b8f..a2d657fb7d5 100644
--- a/dev-lua/luadbi/luadbi-0.5-r5.ebuild
+++ b/dev-lua/luadbi/luadbi-0.5-r5.ebuild
@@ -26,6 +26,7 @@ S="${WORKDIR}"
 
 src_prepare() {
        epatch "${FILESDIR}"/${PV}-r2-Makefile.patch
+       epatch "${FILESDIR}"/${P}-mysql-8.patch
        sed -i -e "s#^INSTALL_DIR_LUA=.*#INSTALL_DIR_LUA=$(pkg-config 
--variable INSTALL_LMOD lua)#" \
                -e "s#^INSTALL_DIR_BIN=.*#INSTALL_DIR_BIN=$(pkg-config 
--variable INSTALL_CMOD lua)#" \
                -e "s#^LUA_INC_DIR=.*#LUA_INC_DIR=$(pkg-config --variable 
INSTALL_INC lua)#" \

diff --git a/dev-lua/luadbi/luadbi-0.5-r6.ebuild 
b/dev-lua/luadbi/luadbi-0.5-r6.ebuild
index 2a24cb49017..44ae7c129ca 100644
--- a/dev-lua/luadbi/luadbi-0.5-r6.ebuild
+++ b/dev-lua/luadbi/luadbi-0.5-r6.ebuild
@@ -24,7 +24,10 @@ DEPEND="${RDEPEND}
 
 S="${WORKDIR}"
 
-PATCHES=( "${FILESDIR}"/${PV}-r2-Makefile.patch )
+PATCHES=(
+       "${FILESDIR}"/${PV}-r2-Makefile.patch
+       "${FILESDIR}"/${P}-mysql-8.patch
+)
 
 src_prepare() {
        default

Reply via email to