dev-python/mysql-python: fix building against dev-db/mysql-8+

Closes: https://bugs.gentoo.org/632578
Package-Manager: Portage-2.3.91, Repoman-2.3.20
Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
This commit is contained in:
Thomas Deutschmann
2020-03-08 02:23:05 +01:00
parent 693d9c9b8b
commit 13926f8104
2 changed files with 61 additions and 0 deletions

View File

@@ -0,0 +1,15 @@
We don't use anything from my_config.h.
Bug: https://bugs.gentoo.org/632578
--- a/_mysql.c
+++ b/_mysql.c
@@ -40,8 +40,6 @@ PERFORMANCE OF THIS SOFTWARE.
#include "structmember.h"
#if defined(MS_WINDOWS)
#include <config-win.h>
-#else
-#include "my_config.h"
#endif
#include "mysql.h"
#include "mysqld_error.h"

View File

@@ -0,0 +1,46 @@
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
PYTHON_COMPAT=( python2_7 )
inherit distutils-r1 flag-o-matic
MY_PN="MySQL-python"
MY_P="${MY_PN}-${PV}"
DESCRIPTION="Python interface to MySQL"
HOMEPAGE="https://sourceforge.net/projects/mysql-python/ https://pypi.org/project/MySQL-python/"
SRC_URI="mirror://pypi/${MY_PN:0:1}/${MY_PN}/${MY_P}.zip"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
IUSE="doc"
RDEPEND="dev-db/mysql-connector-c"
DEPEND="${RDEPEND}"
BDEPEND="${RDEPEND}
app-arch/unzip
dev-python/setuptools[${PYTHON_USEDEP}]
doc? ( dev-python/sphinx[${PYTHON_USEDEP}] )"
S="${WORKDIR}/${MY_P}"
PATCHES=( "${FILESDIR}"/${PN}-1.2.5-drop-my_config.h-include.patch )
DOCS=( HISTORY README.md doc/{FAQ,MySQLdb}.rst )
python_configure_all() {
append-flags -fno-strict-aliasing
}
python_compile_all() {
use doc && sphinx-build -b html doc doc/_build/
}
python_install_all() {
use doc && local HTML_DOCS=( doc/_build/. )
distutils-r1_python_install_all
}