Gentoo Archives: gentoo-commits

From: Conrad Kostecki <conikost@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-lua/luadbi/files/, dev-lua/luadbi/
Date: Tue, 13 Oct 2020 07:57:31
Message-Id: 1602575758.b90c6060daebfd53490d906618c3c9db401d65e7.conikost@gentoo
1 commit: b90c6060daebfd53490d906618c3c9db401d65e7
2 Author: Conrad Kostecki <conikost <AT> gentoo <DOT> org>
3 AuthorDate: Tue Oct 13 07:55:39 2020 +0000
4 Commit: Conrad Kostecki <conikost <AT> gentoo <DOT> org>
5 CommitDate: Tue Oct 13 07:55:58 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b90c6060
7
8 dev-lua/luadbi: bump to version 0.7.2
9
10 Closes: https://bugs.gentoo.org/709736
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/Manifest | 1 +
15 dev-lua/luadbi/files/luadbi-0.7.2-mysql-8.patch | 55 +++++++++++++++++++++++
16 dev-lua/luadbi/luadbi-0.7.2.ebuild | 60 +++++++++++++++++++++++++
17 3 files changed, 116 insertions(+)
18
19 diff --git a/dev-lua/luadbi/Manifest b/dev-lua/luadbi/Manifest
20 index 197912a6166..b80720a8565 100644
21 --- a/dev-lua/luadbi/Manifest
22 +++ b/dev-lua/luadbi/Manifest
23 @@ -1 +1,2 @@
24 +DIST luadbi-0.7.2.tar.gz 36462 BLAKE2B 581c7353bfa36b3f6cabed2df78372f8810300bf4525bf8d370e61d469f9daa5a5c40c58916164a8d0a621a61e983e85c67b23ef03f51212be79f09ad8512047 SHA512 891f99cbc8f1b5327ef820641a1608abf41410f2f28584b975cc3cf65154b9bebf6f1b9ca7d1818b9c965738ad700dd17ae042dfd2a7146cf755871ebae535b9
25 DIST luadbi.0.5.tar.gz 22454 BLAKE2B 538fa935ece2a8e0f852cef33716570a6e85100ec26892d7a76c5b00a7fceb82411e2ebe29d25de42cf6ee6bdbfdf5102875bb4d04d65f86dfdc9d79fecef359 SHA512 4ed641e113e90acc8a4f6b3b2d0f5d5044c0fbbef3b2fdfb84d15e17115e45c553a33b19bfb165e5af11a2adce501d66859963e3363d3ab1c6a39b0b2ae92e62
26
27 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
28 new file mode 100644
29 index 00000000000..ef463433357
30 --- /dev/null
31 +++ b/dev-lua/luadbi/files/luadbi-0.7.2-mysql-8.patch
32 @@ -0,0 +1,55 @@
33 +From b72503cad0654878841172451b2ea860a59e30c1 Mon Sep 17 00:00:00 2001
34 +From: Conrad Kostecki <conrad@××××××××.com>
35 +Date: Tue, 13 Oct 2020 07:34:16 +0200
36 +Subject: [PATCH] dbd/mysql/statement.c: fix compilation with mysql-8
37 +
38 +Signed-off-by: Conrad Kostecki <conrad@××××××××.com>
39 +---
40 + dbd/mysql/dbd_mysql.h | 2 +-
41 + dbd/mysql/statement.c | 6 +++---
42 + 2 files changed, 4 insertions(+), 4 deletions(-)
43 +
44 +diff --git a/dbd/mysql/dbd_mysql.h b/dbd/mysql/dbd_mysql.h
45 +index 233bc35..4777289 100644
46 +--- a/dbd/mysql/dbd_mysql.h
47 ++++ b/dbd/mysql/dbd_mysql.h
48 +@@ -3,7 +3,7 @@
49 + #endif
50 +
51 +
52 +-#include <mysql.h>
53 ++#include <mysql/mysql.h>
54 + #include <dbd/common.h>
55 +
56 + #define DBD_MYSQL_CONNECTION "DBD.MySQL.Connection"
57 +diff --git a/dbd/mysql/statement.c b/dbd/mysql/statement.c
58 +index aca865a..6af4c39 100644
59 +--- a/dbd/mysql/statement.c
60 ++++ b/dbd/mysql/statement.c
61 +@@ -424,7 +424,7 @@ static int statement_fetch_impl(lua_State *L, statement_t *statement, int named_
62 +
63 + if (fields[i].type == MYSQL_TYPE_TIMESTAMP || fields[i].type == MYSQL_TYPE_DATETIME) {
64 + char str[20];
65 +- struct st_mysql_time *t = bind[i].buffer;
66 ++ MYSQL_TIME *t = bind[i].buffer;
67 +
68 + snprintf(str, 20, "%d-%02d-%02d %02d:%02d:%02d", t->year, t->month, t->day, t->hour, t->minute, t->second);
69 +
70 +@@ -435,7 +435,7 @@ static int statement_fetch_impl(lua_State *L, statement_t *statement, int named_
71 + }
72 + } else if (fields[i].type == MYSQL_TYPE_TIME) {
73 + char str[9];
74 +- struct st_mysql_time *t = bind[i].buffer;
75 ++ MYSQL_TIME *t = bind[i].buffer;
76 +
77 + snprintf(str, 9, "%02d:%02d:%02d", t->hour, t->minute, t->second);
78 +
79 +@@ -446,7 +446,7 @@ static int statement_fetch_impl(lua_State *L, statement_t *statement, int named_
80 + }
81 + } else if (fields[i].type == MYSQL_TYPE_DATE) {
82 + char str[20];
83 +- struct st_mysql_time *t = bind[i].buffer;
84 ++ MYSQL_TIME *t = bind[i].buffer;
85 +
86 + snprintf(str, 11, "%d-%02d-%02d", t->year, t->month, t->day);
87 +
88
89 diff --git a/dev-lua/luadbi/luadbi-0.7.2.ebuild b/dev-lua/luadbi/luadbi-0.7.2.ebuild
90 new file mode 100644
91 index 00000000000..63e97642ea1
92 --- /dev/null
93 +++ b/dev-lua/luadbi/luadbi-0.7.2.ebuild
94 @@ -0,0 +1,60 @@
95 +# Copyright 1999-2020 Gentoo Authors
96 +# Distributed under the terms of the GNU General Public License v2
97 +
98 +EAPI=7
99 +
100 +inherit toolchain-funcs
101 +
102 +DESCRIPTION="A database interface library for Lua"
103 +HOMEPAGE="https://github.com/mwild1/luadbi"
104 +SRC_URI="https://github.com/mwild1/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
105 +
106 +LICENSE="MIT"
107 +SLOT="0"
108 +KEYWORDS="~amd64 ~arm ~arm64 ~x86"
109 +IUSE="mysql postgres +sqlite"
110 +REQUIRED_USE="|| ( mysql postgres sqlite )"
111 +
112 +RDEPEND="
113 + >=dev-lang/lua-5.1:=
114 + mysql? ( dev-db/mysql-connector-c:0= )
115 + postgres? ( dev-db/postgresql:= )
116 + sqlite? ( dev-db/sqlite )
117 +"
118 +
119 +DEPEND="${RDEPEND}"
120 +
121 +BDEPEND="virtual/pkgconfig"
122 +
123 +PATCHES=( "${FILESDIR}/${PN}-0.7.2-mysql-8.patch" )
124 +
125 +src_prepare() {
126 + default
127 +
128 + # Respect users CFLAGS
129 + sed -e 's/-g //' -e 's/-O2 //g' -i Makefile || die
130 +}
131 +
132 +src_compile() {
133 + tc-export AR CC
134 +
135 + local myemakeargs=(
136 + "LUA_INC=-I$($(tc-getPKG_CONFIG) --variable INSTALL_INC lua)/lua5.1"
137 + )
138 +
139 + use mysql && emake ${myemakeargs} MYSQL_INC="-I$(mariadb_config --libs)" mysql
140 + use postgres && emake ${myemakeargs} PSQL_INC="-I$(pg_config --libdir)" psql
141 + use sqlite emake ${myemakeargs} SQLITE3_INC="-I/usr/include" sqlite
142 +}
143 +
144 +src_install() {
145 + local myemakeargs=(
146 + DESTDIR="${ED}"
147 + LUA_CDIR="$($(tc-getPKG_CONFIG) --variable INSTALL_CMOD lua)"
148 + LUA_LDIR="$($(tc-getPKG_CONFIG) --variable INSTALL_LMOD lua)"
149 + )
150 +
151 + use mysql && emake ${myemakeargs[@]} install_mysql
152 + use postgres && emake ${myemakeargs[@]} install_psql
153 + use sqlite && emake ${myemakeargs[@]} install_sqlite3
154 +}