summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorConrad Kostecki <conikost@gentoo.org>2020-10-12 01:33:07 +0200
committerConrad Kostecki <conikost@gentoo.org>2020-10-12 01:33:07 +0200
commitaf72c733c6f6687dde699b73c9197c20ab5cf97d (patch)
treef67694ce781b3c756cfee0f7f347b37f95ecd093 /dev-lua
parentdev-lua/lua-zlib: add ~arm64 keyword (diff)
downloadgentoo-af72c733c6f6687dde699b73c9197c20ab5cf97d.tar.gz
gentoo-af72c733c6f6687dde699b73c9197c20ab5cf97d.tar.bz2
gentoo-af72c733c6f6687dde699b73c9197c20ab5cf97d.zip
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@gentoo.org>
Diffstat (limited to 'dev-lua')
-rw-r--r--dev-lua/luadbi/files/luadbi-0.5-mysql-8.patch78
-rw-r--r--dev-lua/luadbi/luadbi-0.5-r5.ebuild1
-rw-r--r--dev-lua/luadbi/luadbi-0.5-r6.ebuild5
3 files changed, 83 insertions, 1 deletions
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 000000000000..a75c9d46d07d
--- /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 e46445c3b8fa..a2d657fb7d5c 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 2a24cb490174..44ae7c129ca2 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