svn commit: r446515 - in head/databases/py-MySQLdb: . files

Bernard Spil brnrd at FreeBSD.org
Mon Jul 24 09:43:41 UTC 2017


Author: brnrd
Date: Mon Jul 24 09:43:40 2017
New Revision: 446515
URL: https://svnweb.freebsd.org/changeset/ports/446515

Log:
  bases/py-MySQLdb: Fix build with MariaDB 10.2.7
  
  With MariaDB 10.2.6 the Connect/C is updated to ~3.0. This means the C interface changed slightly and some functions are changed.
  
   - Replace direct struct access with accessor in _mysql.c
   - Add LICENSE/LICENSE_FILE
   - Strip Binaries
   - Remove conflict with itself
  
  PR:		219797
  Reviewed_by:	sunpoet, koobs, brnrd
  Submitted by:	sirl33tname at gmail.com
  Approved by:	koobs (python)
  Differential Revision:	https://reviews.freebsd.org/D11054

Modified:
  head/databases/py-MySQLdb/Makefile
  head/databases/py-MySQLdb/files/patch-_mysql.c

Modified: head/databases/py-MySQLdb/Makefile
==============================================================================
--- head/databases/py-MySQLdb/Makefile	Mon Jul 24 09:30:40 2017	(r446514)
+++ head/databases/py-MySQLdb/Makefile	Mon Jul 24 09:43:40 2017	(r446515)
@@ -10,13 +10,17 @@ PKGNAMEPREFIX=	${PYTHON_PKGNAMEPREFIX}
 MAINTAINER=	python at FreeBSD.org
 COMMENT=	Access a MySQL database through Python
 
+LICENSE=	GPLv2
+LICENSE_FILE=	${WRKSRC}/GPL-2.0
+
 USES=		python:2 mysql
 USE_PYTHON=	distutils autoplist
 USE_GITHUB=	yes
 GH_ACCOUNT=	farcepest
 GH_PROJECT=	${PORTNAME}1
 
-CONFLICTS=	py*-MySQLdb-[0-9]* py*-MySQLdb5[0-9]-[0-9]* py*-mysqlclient-[0-9]*
+CONFLICTS=	${PYTHON_PKGNAMEPREFIX}-MySQLdb5[0-9]-[0-9]* \
+		${PYTHON_PKGNAMEPREFIX}-mysqlclient-[0-9]*
 
 PORTDOCS=	*
 DOCSDIR=	${PREFIX}/share/doc/${PKGNAMEPREFIX}${PORTNAME}
@@ -37,5 +41,6 @@ post-install:
 	@${MKDIR} ${STAGEDIR}${DOCSDIR}
 	${INSTALL_DATA} ${WRKSRC}/README.md ${STAGEDIR}${DOCSDIR}
 	${INSTALL_DATA} ${WRKSRC}/doc/* ${STAGEDIR}${DOCSDIR}
+	${STRIP_CMD} ${STAGEDIR}${PYTHON_SITELIBDIR}/_mysql.so
 
 .include <bsd.port.mk>

Modified: head/databases/py-MySQLdb/files/patch-_mysql.c
==============================================================================
--- head/databases/py-MySQLdb/files/patch-_mysql.c	Mon Jul 24 09:30:40 2017	(r446514)
+++ head/databases/py-MySQLdb/files/patch-_mysql.c	Mon Jul 24 09:43:40 2017	(r446515)
@@ -1,7 +1,7 @@
---- _mysql.c.orig	2014-03-18 19:07:07.000000000 +0400
-+++ _mysql.c	2014-03-18 19:07:40.000000000 +0400
-@@ -102,6 +102,10 @@ static int _mysql_server_init_done = 0;
- #define check_server_init(x) if (!_mysql_server_init_done) _mysql_server_init_done = 1
+--- _mysql.c.orig	2014-01-02 19:15:03 UTC
++++ _mysql.c
+@@ -124,6 +124,10 @@ static int _mysql_server_init_done = 0;
+ #define HAVE_MYSQL_OPT_TIMEOUTS 1
  #endif
  
 +#if MYSQL_VERSION_ID >= 50500
@@ -11,3 +11,14 @@
  PyObject *
  _mysql_Exception(_mysql_ConnectionObject *c)
  {
+@@ -2002,7 +2006,9 @@ _mysql_ConnectionObject_ping(
+ 	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) {
++		mysql_options(&self->connection, MYSQL_OPT_RECONNECT, &reconnect);
++	}
+ 	Py_BEGIN_ALLOW_THREADS
+ 	r = mysql_ping(&(self->connection));
+ 	Py_END_ALLOW_THREADS


More information about the svn-ports-all mailing list