public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: dev-lua/luadbi/files/, dev-lua/luadbi/
@ 2019-02-07 18:10 Brian Evans
  0 siblings, 0 replies; 5+ messages in thread
From: Brian Evans @ 2019-02-07 18:10 UTC (permalink / raw
  To: gentoo-commits

commit:     51b32bb9d4bd111a3400fab7cdc68c2c881ba29c
Author:     Brian Evans <grknight <AT> gentoo <DOT> org>
AuthorDate: Thu Feb  7 18:10:09 2019 +0000
Commit:     Brian Evans <grknight <AT> gentoo <DOT> org>
CommitDate: Thu Feb  7 18:10:09 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=51b32bb9

dev-lua/luadbi: Revbump for dependency and EAPI change

Bug: https://bugs.gentoo.org/665884
Package-Manager: Portage-2.3.59, Repoman-2.3.12
Signed-off-by: Brian Evans <grknight <AT> gentoo.org>

 dev-lua/luadbi/files/0.5-r2-Makefile.patch |  4 +-
 dev-lua/luadbi/luadbi-0.5-r6.ebuild        | 66 ++++++++++++++++++++++++++++++
 2 files changed, 68 insertions(+), 2 deletions(-)

diff --git a/dev-lua/luadbi/files/0.5-r2-Makefile.patch b/dev-lua/luadbi/files/0.5-r2-Makefile.patch
index b37b3c00efe..98e4988b281 100644
--- a/dev-lua/luadbi/files/0.5-r2-Makefile.patch
+++ b/dev-lua/luadbi/files/0.5-r2-Makefile.patch
@@ -1,5 +1,5 @@
---- Makefile.orig	2013-02-01 13:34:54.490898002 +0400
-+++ Makefile	2013-02-01 13:44:25.927772130 +0400
+--- a/Makefile	2013-02-01 13:34:54.490898002 +0400
++++ b/Makefile	2013-02-01 13:44:25.927772130 +0400
 @@ -1,5 +1,6 @@
  CC=gcc
 -CFLAGS=-g -pedantic -Wall -O2 -shared -fpic -I /usr/include/lua5.1 -I /usr/include/mysql -I /usr/include/postgresql/ -I /opt/ibm/db2exc/V9.5/include/ -I /usr/lib/oracle/xe/app/oracle/product/10.2.0/client/rdbms/public/ -I .

diff --git a/dev-lua/luadbi/luadbi-0.5-r6.ebuild b/dev-lua/luadbi/luadbi-0.5-r6.ebuild
new file mode 100644
index 00000000000..2f194b5ab36
--- /dev/null
+++ b/dev-lua/luadbi/luadbi-0.5-r6.ebuild
@@ -0,0 +1,66 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit toolchain-funcs flag-o-matic
+
+DESCRIPTION="DBI module for Lua"
+HOMEPAGE="https://code.google.com/p/luadbi/"
+SRC_URI="https://luadbi.googlecode.com/files/${PN}.${PV}.tar.gz"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~x86"
+IUSE="mysql postgres +sqlite"
+REQUIRED_USE="|| ( mysql postgres sqlite )"
+
+RDEPEND=">=dev-lang/lua-5.1
+		mysql? ( dev-db/mysql-connector-c:0= )
+		postgres? ( dev-db/postgresql )
+		sqlite? ( >=dev-db/sqlite-3 )"
+DEPEND="${RDEPEND}
+	virtual/pkgconfig"
+
+S="${WORKDIR}"
+
+PATCHES=( "${FILESDIR}"/${PV}-r2-Makefile.patch )
+
+src_prepare() {
+	default
+	local pkgconf=$(tc-getPKG_CONFIG)
+	sed -i -e "s#^INSTALL_DIR_LUA=.*#INSTALL_DIR_LUA=$(${pkgconf} --variable INSTALL_LMOD lua)#" \
+		-e "s#^INSTALL_DIR_BIN=.*#INSTALL_DIR_BIN=$(${pkgconf} --variable INSTALL_CMOD lua)#" \
+		-e "s#^LUA_INC_DIR=.*#LUA_INC_DIR=$(${pkgconf} --variable INSTALL_INC lua)#" \
+		-e "s#^LUA_LIB_DIR=.*#LUA_LIB_DIR=$(${pkgconf} --variable INSTALL_LIB lua)#" \
+		-e "s#^LUA_LIB =.*#LUA_LIB=lua#" Makefile || die
+
+	drivers=""
+
+	if use mysql; then
+		drivers+="mysql "
+		sed -i -e "s#^\(INCLUDES.*\)#\1 $(mysql_config --include)#" \
+			-e "s#^\(MYSQL_LDFLAGS=\$(COMMON_LDFLAGS)\).*#\1 $(mysql_config --libs)#" Makefile || die
+	fi
+
+	if use postgres; then
+		drivers+="psql "
+		sed -i -e "s#^\(INCLUDES.*\)#\1 -I$(pg_config --includedir) -I$(pg_config --includedir-server)#" \
+			-e "s#^\(PSQL_LDFLAGS=\$(COMMON_LDFLAGS)\).*#\1 -L$(pg_config --libdir) -lpq#" Makefile || die
+	fi
+
+	use sqlite && drivers+="sqlite3"
+}
+
+src_compile() {
+	append-flags -fPIC
+	for driver in ${drivers}; do
+		emake CC="$(tc-getCC)" COMMON_LDFLAGS="${LDFLAGS}" ${driver}
+	done
+}
+
+src_install() {
+	for driver in ${drivers}; do
+		emake DESTDIR="${D}" "install_${driver// /}"
+	done
+}


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-lua/luadbi/files/, dev-lua/luadbi/
@ 2020-10-11 23:36 Conrad Kostecki
  0 siblings, 0 replies; 5+ messages in thread
From: Conrad Kostecki @ 2020-10-11 23:36 UTC (permalink / raw
  To: gentoo-commits

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


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-lua/luadbi/files/, dev-lua/luadbi/
@ 2020-10-11 23:36 Conrad Kostecki
  0 siblings, 0 replies; 5+ messages in thread
From: Conrad Kostecki @ 2020-10-11 23:36 UTC (permalink / raw
  To: gentoo-commits

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

dev-lua/luadbi: use proper patch name

Renamed patch for fit the default naming convention.

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

 .../luadbi/files/{0.5-r2-Makefile.patch => luadbi-0.5-makefile.patch}   | 0
 dev-lua/luadbi/luadbi-0.5-r5.ebuild                                     | 2 +-
 dev-lua/luadbi/luadbi-0.5-r6.ebuild                                     | 2 +-
 3 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/dev-lua/luadbi/files/0.5-r2-Makefile.patch b/dev-lua/luadbi/files/luadbi-0.5-makefile.patch
similarity index 100%
rename from dev-lua/luadbi/files/0.5-r2-Makefile.patch
rename to dev-lua/luadbi/files/luadbi-0.5-makefile.patch

diff --git a/dev-lua/luadbi/luadbi-0.5-r5.ebuild b/dev-lua/luadbi/luadbi-0.5-r5.ebuild
index a2d657fb7d5..f2dd0d9452f 100644
--- a/dev-lua/luadbi/luadbi-0.5-r5.ebuild
+++ b/dev-lua/luadbi/luadbi-0.5-r5.ebuild
@@ -25,7 +25,7 @@ DEPEND="${RDEPEND}
 S="${WORKDIR}"
 
 src_prepare() {
-	epatch "${FILESDIR}"/${PV}-r2-Makefile.patch
+	epatch "${FILESDIR}"/${P}-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)#" \

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


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-lua/luadbi/files/, dev-lua/luadbi/
@ 2020-10-13  7:57 Conrad Kostecki
  0 siblings, 0 replies; 5+ messages in thread
From: Conrad Kostecki @ 2020-10-13  7:57 UTC (permalink / raw
  To: gentoo-commits

commit:     b90c6060daebfd53490d906618c3c9db401d65e7
Author:     Conrad Kostecki <conikost <AT> gentoo <DOT> org>
AuthorDate: Tue Oct 13 07:55:39 2020 +0000
Commit:     Conrad Kostecki <conikost <AT> gentoo <DOT> org>
CommitDate: Tue Oct 13 07:55:58 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b90c6060

dev-lua/luadbi: bump to version 0.7.2

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

 dev-lua/luadbi/Manifest                         |  1 +
 dev-lua/luadbi/files/luadbi-0.7.2-mysql-8.patch | 55 +++++++++++++++++++++++
 dev-lua/luadbi/luadbi-0.7.2.ebuild              | 60 +++++++++++++++++++++++++
 3 files changed, 116 insertions(+)

diff --git a/dev-lua/luadbi/Manifest b/dev-lua/luadbi/Manifest
index 197912a6166..b80720a8565 100644
--- a/dev-lua/luadbi/Manifest
+++ b/dev-lua/luadbi/Manifest
@@ -1 +1,2 @@
+DIST luadbi-0.7.2.tar.gz 36462 BLAKE2B 581c7353bfa36b3f6cabed2df78372f8810300bf4525bf8d370e61d469f9daa5a5c40c58916164a8d0a621a61e983e85c67b23ef03f51212be79f09ad8512047 SHA512 891f99cbc8f1b5327ef820641a1608abf41410f2f28584b975cc3cf65154b9bebf6f1b9ca7d1818b9c965738ad700dd17ae042dfd2a7146cf755871ebae535b9
 DIST luadbi.0.5.tar.gz 22454 BLAKE2B 538fa935ece2a8e0f852cef33716570a6e85100ec26892d7a76c5b00a7fceb82411e2ebe29d25de42cf6ee6bdbfdf5102875bb4d04d65f86dfdc9d79fecef359 SHA512 4ed641e113e90acc8a4f6b3b2d0f5d5044c0fbbef3b2fdfb84d15e17115e45c553a33b19bfb165e5af11a2adce501d66859963e3363d3ab1c6a39b0b2ae92e62

diff --git a/dev-lua/luadbi/files/luadbi-0.7.2-mysql-8.patch b/dev-lua/luadbi/files/luadbi-0.7.2-mysql-8.patch
new file mode 100644
index 00000000000..ef463433357
--- /dev/null
+++ b/dev-lua/luadbi/files/luadbi-0.7.2-mysql-8.patch
@@ -0,0 +1,55 @@
+From b72503cad0654878841172451b2ea860a59e30c1 Mon Sep 17 00:00:00 2001
+From: Conrad Kostecki <conrad@kostecki.com>
+Date: Tue, 13 Oct 2020 07:34:16 +0200
+Subject: [PATCH] dbd/mysql/statement.c: fix compilation with mysql-8
+
+Signed-off-by: Conrad Kostecki <conrad@kostecki.com>
+---
+ dbd/mysql/dbd_mysql.h | 2 +-
+ dbd/mysql/statement.c | 6 +++---
+ 2 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/dbd/mysql/dbd_mysql.h b/dbd/mysql/dbd_mysql.h
+index 233bc35..4777289 100644
+--- a/dbd/mysql/dbd_mysql.h
++++ b/dbd/mysql/dbd_mysql.h
+@@ -3,7 +3,7 @@
+ #endif
+ 
+ 
+-#include <mysql.h>
++#include <mysql/mysql.h>
+ #include <dbd/common.h>
+ 
+ #define DBD_MYSQL_CONNECTION	"DBD.MySQL.Connection"
+diff --git a/dbd/mysql/statement.c b/dbd/mysql/statement.c
+index aca865a..6af4c39 100644
+--- a/dbd/mysql/statement.c
++++ b/dbd/mysql/statement.c
+@@ -424,7 +424,7 @@ static int statement_fetch_impl(lua_State *L, statement_t *statement, int named_
+ 
+ 		    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);
+ 
+@@ -435,7 +435,7 @@ static int statement_fetch_impl(lua_State *L, statement_t *statement, int named_
+ 			}
+ 		    } 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);
+ 
+@@ -446,7 +446,7 @@ static int statement_fetch_impl(lua_State *L, statement_t *statement, int named_
+ 			}
+ 		    } 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.7.2.ebuild b/dev-lua/luadbi/luadbi-0.7.2.ebuild
new file mode 100644
index 00000000000..63e97642ea1
--- /dev/null
+++ b/dev-lua/luadbi/luadbi-0.7.2.ebuild
@@ -0,0 +1,60 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit toolchain-funcs
+
+DESCRIPTION="A database interface library for Lua"
+HOMEPAGE="https://github.com/mwild1/luadbi"
+SRC_URI="https://github.com/mwild1/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~x86"
+IUSE="mysql postgres +sqlite"
+REQUIRED_USE="|| ( mysql postgres sqlite )"
+
+RDEPEND="
+	>=dev-lang/lua-5.1:=
+	mysql? ( dev-db/mysql-connector-c:0= )
+	postgres? ( dev-db/postgresql:= )
+	sqlite? ( dev-db/sqlite )
+"
+
+DEPEND="${RDEPEND}"
+
+BDEPEND="virtual/pkgconfig"
+
+PATCHES=( "${FILESDIR}/${PN}-0.7.2-mysql-8.patch" )
+
+src_prepare() {
+	default
+
+	# Respect users CFLAGS
+	sed -e 's/-g //' -e 's/-O2 //g' -i Makefile || die
+}
+
+src_compile() {
+	tc-export AR CC
+
+	local myemakeargs=(
+		"LUA_INC=-I$($(tc-getPKG_CONFIG) --variable INSTALL_INC lua)/lua5.1"
+	)
+
+	use mysql && emake ${myemakeargs} MYSQL_INC="-I$(mariadb_config --libs)" mysql
+	use postgres && emake ${myemakeargs} PSQL_INC="-I$(pg_config --libdir)" psql
+	use sqlite emake ${myemakeargs} SQLITE3_INC="-I/usr/include" sqlite
+}
+
+src_install() {
+	local myemakeargs=(
+		DESTDIR="${ED}"
+		LUA_CDIR="$($(tc-getPKG_CONFIG) --variable INSTALL_CMOD lua)"
+		LUA_LDIR="$($(tc-getPKG_CONFIG) --variable INSTALL_LMOD lua)"
+	)
+
+	use mysql && emake ${myemakeargs[@]} install_mysql
+	use postgres && emake ${myemakeargs[@]} install_psql
+	use sqlite && emake ${myemakeargs[@]} install_sqlite3
+}


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-lua/luadbi/files/, dev-lua/luadbi/
@ 2024-01-05 23:05 Conrad Kostecki
  0 siblings, 0 replies; 5+ messages in thread
From: Conrad Kostecki @ 2024-01-05 23:05 UTC (permalink / raw
  To: gentoo-commits

commit:     2b37dc824d13625662d79bfa6ab97c59e3419124
Author:     Conrad Kostecki <conikost <AT> gentoo <DOT> org>
AuthorDate: Fri Jan  5 23:04:36 2024 +0000
Commit:     Conrad Kostecki <conikost <AT> gentoo <DOT> org>
CommitDate: Fri Jan  5 23:04:36 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2b37dc82

dev-lua/luadbi: fix incompatible-pointer-types

Closes: https://bugs.gentoo.org/919307
Signed-off-by: Conrad Kostecki <conikost <AT> gentoo.org>

 .../luadbi-0.7.2-incompatible-pointer-type.patch   | 163 +++++++++++++++++++++
 .../luadbi-0.7.2-incompatible-pointer-type2.patch  |  29 ++++
 dev-lua/luadbi/luadbi-0.7.2-r1.ebuild              |   8 +-
 3 files changed, 198 insertions(+), 2 deletions(-)

diff --git a/dev-lua/luadbi/files/luadbi-0.7.2-incompatible-pointer-type.patch b/dev-lua/luadbi/files/luadbi-0.7.2-incompatible-pointer-type.patch
new file mode 100644
index 000000000000..dfe3db4b030d
--- /dev/null
+++ b/dev-lua/luadbi/files/luadbi-0.7.2-incompatible-pointer-type.patch
@@ -0,0 +1,163 @@
+From 7f9c10e753325e3cc00d4955bf9d6a77a896bdcb Mon Sep 17 00:00:00 2001
+From: Matthew Wild <mwild1@gmail.com>
+Date: Thu, 5 Sep 2019 14:25:20 +0100
+Subject: [PATCH 1/3] MySQL: Don't set (unused) field is_null to nonsense
+ value, fixes #56
+
+---
+ dbd/mysql/statement.c | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/dbd/mysql/statement.c b/dbd/mysql/statement.c
+index aca865a..dd01c1e 100644
+--- a/dbd/mysql/statement.c
++++ b/dbd/mysql/statement.c
+@@ -218,7 +218,6 @@ static int statement_execute(lua_State *L) {
+ 	switch(type) {
+ 	    case LUA_TNIL:
+ 		bind[i].buffer_type = MYSQL_TYPE_NULL;
+-		bind[i].is_null = (int*)1;
+ 		break;
+ 
+ 	    case LUA_TBOOLEAN:
+
+From 83954fe0ba8c83fbe9351937e0d30b9c842dadb1 Mon Sep 17 00:00:00 2001
+From: Matthew Wild <mwild1@gmail.com>
+Date: Thu, 5 Sep 2019 14:26:04 +0100
+Subject: [PATCH 2/3] Add test for handling of NULL values
+
+---
+ tests/run_tests.lua | 48 +++++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 48 insertions(+)
+
+diff --git a/tests/run_tests.lua b/tests/run_tests.lua
+index 0dd9f72..80526b6 100755
+--- a/tests/run_tests.lua
++++ b/tests/run_tests.lua
+@@ -301,6 +301,51 @@ local function test_insert_multi()
+ 
+ end
+ 
++local function test_insert_null()
++
++	local sth, sth2, err, success
++	local stringy = os.date()
++
++
++	sth, err = dbh:prepare(code('insert'))
++
++	assert.is_nil(err)
++	assert.is_not_nil(sth)
++
++	success, err = sth:execute(nil)
++
++	assert.is_true(success)
++	assert.is_nil(err)
++
++	assert.is_equal(1, sth:affected())
++
++	--
++	-- Grab it back, make sure it's all good
++	--
++
++	local id = dbh:last_id()
++	assert.is_not_nil(id)
++	sth:close()
++
++	sth2, err = dbh:prepare(code('insert_select'))
++
++	assert.is_nil(err)
++	assert.is_not_nil(sth)
++
++	success, err = sth2:execute(id)
++
++	assert.is_true(success)
++	assert.is_nil(err)
++
++	local row = sth2:rows(false)()
++	assert.is_not_nil(row)
++	assert.are_equal(id, row[1])
++	assert.is_nil(row[2])
++
++	sth:close()
++	sth2:close()
++
++end
+ 
+ local function test_insert_returning()
+ 
+@@ -494,6 +539,7 @@ describe("PostgreSQL #psql", function()
+ 	it( "Tests a simple select", test_select )
+ 	it( "Tests multi-row selects", test_select_multi )
+ 	it( "Tests inserts", test_insert_returning )
++	it( "Tests inserts of NULL", test_insert_null )
+ 	it( "Tests statement reuse", test_insert_multi )
+ 	it( "Tests no insert_id", test_no_insert_id )
+ 	it( "Tests affected rows", test_update )
+@@ -514,6 +560,7 @@ describe("SQLite3 #sqlite3", function()
+ 	it( "Tests simple selects", test_select )
+ 	it( "Tests multi-row selects", test_select_multi )
+ 	it( "Tests inserts", test_insert )
++	it( "Tests inserts of NULL", test_insert_null )
+ 	it( "Tests statement reuse", test_insert_multi )
+ 	it( "Tests no rowcount", test_no_rowcount )
+ 	it( "Tests affected rows", test_update )
+@@ -534,6 +581,7 @@ describe("MySQL #mysql", function()
+ 	it( "Tests simple selects", test_select )
+ 	it( "Tests multi-row selects", test_select_multi )
+ 	it( "Tests inserts", test_insert )
++	it( "Tests inserts of NULL", test_insert_null )
+ 	it( "Tests statement reuse", test_insert_multi )
+ 	it( "Tests affected rows", test_update )
+ 	it( "Tests closing dbh doesn't segfault", test_db_close_doesnt_segfault )
+
+From 4555eb0a63945e829ffba635cac87b9e22155ffc Mon Sep 17 00:00:00 2001
+From: Matthew Wild <mwild1@gmail.com>
+Date: Thu, 5 Sep 2019 14:35:52 +0100
+Subject: [PATCH 3/3] tests/schemas: allow null inserts for testing
+
+---
+ tests/schemas/mysql.sql      | 2 +-
+ tests/schemas/postgresql.sql | 2 +-
+ tests/schemas/sqlite3.sql    | 2 +-
+ 3 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/tests/schemas/mysql.sql b/tests/schemas/mysql.sql
+index 1134e64..2948075 100644
+--- a/tests/schemas/mysql.sql
++++ b/tests/schemas/mysql.sql
+@@ -46,7 +46,7 @@ drop table if exists insert_tests;
+ create table insert_tests
+ 	(
+ 		id int not null primary key auto_increment,
+-		val varchar(255) not null
++		val varchar(255)
+ 	);
+ 
+ grant insert, select on insert_tests to 'luadbi'@'%';
+diff --git a/tests/schemas/postgresql.sql b/tests/schemas/postgresql.sql
+index f430516..efe23f3 100644
+--- a/tests/schemas/postgresql.sql
++++ b/tests/schemas/postgresql.sql
+@@ -47,7 +47,7 @@ drop table if exists insert_tests cascade;
+ create table insert_tests
+ 	(
+ 		id serial primary key,
+-		val varchar(255) not null
++		val varchar(255)
+ 	);
+ 
+ grant insert, select on insert_tests to luadbi;
+diff --git a/tests/schemas/sqlite3.sql b/tests/schemas/sqlite3.sql
+index d3ba4bc..3bf0eb0 100644
+--- a/tests/schemas/sqlite3.sql
++++ b/tests/schemas/sqlite3.sql
+@@ -44,7 +44,7 @@ drop table if exists insert_tests;
+ create table insert_tests
+ 	(
+ 		id integer primary key,
+-		val varchar(255) not null
++		val varchar(255)
+ 	);
+ 
+ drop table if exists update_tests;

diff --git a/dev-lua/luadbi/files/luadbi-0.7.2-incompatible-pointer-type2.patch b/dev-lua/luadbi/files/luadbi-0.7.2-incompatible-pointer-type2.patch
new file mode 100644
index 000000000000..22a6e7c7e881
--- /dev/null
+++ b/dev-lua/luadbi/files/luadbi-0.7.2-incompatible-pointer-type2.patch
@@ -0,0 +1,29 @@
+--- a/dbd/mysql/statement.c
++++ b/dbd/mysql/statement.c
+@@ -226,7 +226,7 @@
+ 		*boolean = lua_toboolean(L, p);
+ 
+ 		bind[i].buffer_type = MYSQL_TYPE_LONG;
+-		bind[i].is_null = (int*)0;
++		bind[i].is_null = false;
+ 		bind[i].buffer = (char *)boolean;
+ 		bind[i].length = 0;
+ 		break;
+@@ -241,7 +241,7 @@
+ 		*num = lua_tonumber(L, p);
+ 
+ 		bind[i].buffer_type = MYSQL_TYPE_DOUBLE;
+-		bind[i].is_null = (int*)0;
++		bind[i].is_null = false;
+ 		bind[i].buffer = (char *)num;
+ 		bind[i].length = 0;
+ 		break;
+@@ -252,7 +252,7 @@
+ 		str = lua_tolstring(L, p, str_len);
+ 
+ 		bind[i].buffer_type = MYSQL_TYPE_STRING;
+-		bind[i].is_null = (int*)0;
++		bind[i].is_null = false;
+ 		bind[i].buffer = (char *)str;
+ 		bind[i].length = str_len;
+ 		break;

diff --git a/dev-lua/luadbi/luadbi-0.7.2-r1.ebuild b/dev-lua/luadbi/luadbi-0.7.2-r1.ebuild
index 2580d774ea53..f6a6bb822552 100644
--- a/dev-lua/luadbi/luadbi-0.7.2-r1.ebuild
+++ b/dev-lua/luadbi/luadbi-0.7.2-r1.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2022 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=8
@@ -38,7 +38,11 @@ BDEPEND="
 	)
 "
 
-PATCHES=( "${FILESDIR}/${PN}-0.7.2-mysql-8.patch" )
+PATCHES=(
+	"${FILESDIR}/${PN}-0.7.2-mysql-8.patch"
+	"${FILESDIR}/${PN}-0.7.2-incompatible-pointer-type.patch"
+	"${FILESDIR}/${PN}-0.7.2-incompatible-pointer-type2.patch"
+)
 
 src_prepare() {
 	default


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-01-05 23:05 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-10-13  7:57 [gentoo-commits] repo/gentoo:master commit in: dev-lua/luadbi/files/, dev-lua/luadbi/ Conrad Kostecki
  -- strict thread matches above, loose matches on Subject: below --
2024-01-05 23:05 Conrad Kostecki
2020-10-11 23:36 Conrad Kostecki
2020-10-11 23:36 Conrad Kostecki
2019-02-07 18:10 Brian Evans

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox