1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 PYTHON_COMPAT=( python3_{6,7,8} )
9 DESCRIPTION="Python client library for MariaDB/MySQL"
10 HOMEPAGE="https://dev.mysql.com/downloads/connector/python/"
11 SRC_URI="https://dev.mysql.com/get/Downloads/Connector-Python/${P}.tar.gz"
13 KEYWORDS="~amd64 ~arm ~x86"
18 BDEPEND=">=dev-libs/protobuf-3.6.1"
21 >=dev-db/mysql-connector-c-8.0
22 >=dev-python/protobuf-python-3.6.1[${PYTHON_USEDEP}]
24 # tests/mysqld.py does not like MariaDB version strings.
25 # See the regex MySQLServerBase._get_version.
26 DEPEND="${RDEPEND} test? ( dev-db/mysql[server(+)] )"
28 # Tests currently fail.
29 # mysql.connector.errors.DatabaseError: 1300 (HY000): Invalid utf8 character string: ''
32 DOCS=( README.txt CHANGES.txt README.rst )
35 "${EPYTHON}" unittests.py --with-mysql="${EPREFIX}/usr" --unix-socket="${T}" --mysql-topdir="${T}"
38 # Yeah, this is really broken, but the extension will only build this way during "install"
40 distutils-r1_python_install \
41 --with-mysql-capi="${EPREFIX}/usr" \
42 --with-protobuf-include-dir="${EPREFIX}/usr/include/google/protobuf/" \
43 --with-protobuf-lib-dir="${EPREFIX}/usr/$(get_libdir)" \
44 --with-protoc="${EPREFIX}/usr/bin/protoc"
48 distutils-r1_python_install_all
49 if use examples ; then