summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortron <tron@pkgsrc.org>2021-07-27 23:21:23 +0000
committertron <tron@pkgsrc.org>2021-07-27 23:21:23 +0000
commit1e7a5bc76c06870edc6c3ca0229f620623e95958 (patch)
treedbee2bd8a738bc413338325dfe2c2a8eb3696eca
parent3f24cf0238592b2a2d6205590e8427db1b6e4e7e (diff)
downloadpkgsrc-1e7a5bc76c06870edc6c3ca0229f620623e95958.tar.gz
databases/py-mysqldb: Fix build with latest version of MariaDB
-rw-r--r--databases/py-mysqldb/Makefile4
-rw-r--r--databases/py-mysqldb/distinfo3
-rw-r--r--databases/py-mysqldb/patches/patch-_mysql.c28
3 files changed, 32 insertions, 3 deletions
diff --git a/databases/py-mysqldb/Makefile b/databases/py-mysqldb/Makefile
index d547c9ccc54..243c7257bfd 100644
--- a/databases/py-mysqldb/Makefile
+++ b/databases/py-mysqldb/Makefile
@@ -1,8 +1,8 @@
-# $NetBSD: Makefile,v 1.50 2021/06/23 20:33:09 nia Exp $
+# $NetBSD: Makefile,v 1.51 2021/07/27 23:21:23 tron Exp $
DISTNAME= MySQL-python-1.2.5
PKGNAME= ${PYPKGPREFIX}-${DISTNAME:S/MySQL-python/mysqldb/}
-PKGREVISION= 1
+PKGREVISION= 2
CATEGORIES= databases python
MASTER_SITES= ${MASTER_SITE_PYPI:=M/MySQL-python/}
EXTRACT_SUFX= .zip
diff --git a/databases/py-mysqldb/distinfo b/databases/py-mysqldb/distinfo
index 9c7f311205d..f2262e8a25b 100644
--- a/databases/py-mysqldb/distinfo
+++ b/databases/py-mysqldb/distinfo
@@ -1,6 +1,7 @@
-$NetBSD: distinfo,v 1.13 2015/11/03 01:56:27 agc Exp $
+$NetBSD: distinfo,v 1.14 2021/07/27 23:21:23 tron Exp $
SHA1 (MySQL-python-1.2.5.zip) = b935a26b3cf80338bcc21b8a991081d83eb9c3ae
RMD160 (MySQL-python-1.2.5.zip) = f6638f1bda4c6a3f721c05a5f0029951d07430a9
SHA512 (MySQL-python-1.2.5.zip) = 37521c6fd855c4cde495cc8ec085aca79c2d441a6e3710759385bf2e2c17f43d3311cf1166663892829d2e3999c419443c358c7031cdda225ac44611ced188d0
Size (MySQL-python-1.2.5.zip) = 108935 bytes
+SHA1 (patch-_mysql.c) = ebe33a112bb16de85d0bbc4e090c51527cbcdc1d
diff --git a/databases/py-mysqldb/patches/patch-_mysql.c b/databases/py-mysqldb/patches/patch-_mysql.c
new file mode 100644
index 00000000000..3b9aaa667c7
--- /dev/null
+++ b/databases/py-mysqldb/patches/patch-_mysql.c
@@ -0,0 +1,28 @@
+$NetBSD: patch-_mysql.c,v 1.1 2021/07/27 23:21:23 tron Exp $
+
+Use official MySQL API to fix build with latest version of MariaDB
+
+--- _mysql.c.orig 2014-01-02 13:52:50.000000000 +0000
++++ _mysql.c 2021-07-28 00:17:13.849678370 +0100
+@@ -40,8 +40,6 @@
+ #include "structmember.h"
+ #if defined(MS_WINDOWS)
+ #include <config-win.h>
+-#else
+-#include "my_config.h"
+ #endif
+ #include "mysql.h"
+ #include "mysqld_error.h"
+@@ -2002,7 +2000,11 @@
+ int r, reconnect = -1;
+ if (!PyArg_ParseTuple(args, "|I", &reconnect)) return NULL;
+ check_connection(self);
+- if ( reconnect != -1 ) self->connection.reconnect = reconnect;
++ if ( reconnect != -1 ) {
++ my_bool my_reconnect = reconnect != 0;
++ mysql_options(&self->connection, MYSQL_OPT_RECONNECT,
++ &my_reconnect);
++ }
+ Py_BEGIN_ALLOW_THREADS
+ r = mysql_ping(&(self->connection));
+ Py_END_ALLOW_THREADS