aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2018-03-26 10:25:53 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2018-03-26 10:25:53 +0000
commit1df361816c6a1773d5648e22746e57b29d35eae8 (patch)
treeae41793d26f1473b91d24d095d9646854e6acbc1
parent85f0f07629898b1eb094735899e1ee63918642f3 (diff)
downloadaports-1df361816c6a1773d5648e22746e57b29d35eae8.tar.bz2
aports-1df361816c6a1773d5648e22746e57b29d35eae8.tar.xz
community/py-mysqldb: rebuild against mariadb-connector-c, modernize
-rw-r--r--community/py-mysqldb/APKBUILD34
-rw-r--r--community/py-mysqldb/mariadb.patch13
2 files changed, 24 insertions, 23 deletions
diff --git a/community/py-mysqldb/APKBUILD b/community/py-mysqldb/APKBUILD
index d4cdbc00c0..797c0da91a 100644
--- a/community/py-mysqldb/APKBUILD
+++ b/community/py-mysqldb/APKBUILD
@@ -2,40 +2,28 @@
# Maintainer: Francesco Colista <francesco.colista@gmail.com>
pkgname=py-mysqldb
pkgver=1.2.5
-pkgrel=0
+pkgrel=1
pkgdesc="MySQL database connector for Python (legacy version)"
url="https://github.com/farcepest/MySQLdb1"
arch="all"
license="GPL"
depends="python2"
-depends_dev="mariadb-dev"
+depends_dev="mariadb-connector-c-dev"
makedepends="$depends_dev python2-dev py-setuptools"
-install=""
-subpackages=""
-source="https://files.pythonhosted.org/packages/source/M/MySQL-python/MySQL-python-$pkgver.zip"
+source="https://files.pythonhosted.org/packages/source/M/MySQL-python/MySQL-python-$pkgver.zip
+ mariadb.patch"
-_builddir="$srcdir"/MySQL-python-$pkgver
-
-prepare() {
- local i
- cd "$_builddir"
- for i in $source; do
- case $i in
- *.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
- esac
- done
-}
+builddir="$srcdir"/MySQL-python-$pkgver
build() {
- cd "$_builddir"
- python2 setup.py build || return 1
+ cd "$builddir"
+ python2 setup.py build
}
package() {
- cd "$_builddir"
- python2 setup.py install --prefix=/usr --root="$pkgdir" || return 1
+ cd "$builddir"
+ python2 setup.py install --prefix=/usr --root="$pkgdir"
}
-md5sums="654f75b302db6ed8dc5a898c625e030c MySQL-python-1.2.5.zip"
-sha256sums="811040b647e5d5686f84db415efd697e6250008b112b6909ba77ac059e140c74 MySQL-python-1.2.5.zip"
-sha512sums="37521c6fd855c4cde495cc8ec085aca79c2d441a6e3710759385bf2e2c17f43d3311cf1166663892829d2e3999c419443c358c7031cdda225ac44611ced188d0 MySQL-python-1.2.5.zip"
+sha512sums="37521c6fd855c4cde495cc8ec085aca79c2d441a6e3710759385bf2e2c17f43d3311cf1166663892829d2e3999c419443c358c7031cdda225ac44611ced188d0 MySQL-python-1.2.5.zip
+edc8b1fc11c4dfbc4af42b9a2122bf8adb0bc32ae593606be0bda6a2a5987f47e5136281c7d1b10f84aa6643ecb93f45853960153a4701e49e42ea4158d34ec0 mariadb.patch"
diff --git a/community/py-mysqldb/mariadb.patch b/community/py-mysqldb/mariadb.patch
new file mode 100644
index 0000000000..a2cbd8574b
--- /dev/null
+++ b/community/py-mysqldb/mariadb.patch
@@ -0,0 +1,13 @@
+diff --git a/_mysql.c b/_mysql.c
+index f081346..481617e 100644
+--- a/_mysql.c
++++ b/_mysql.c
+@@ -2002,7 +2002,7 @@ _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