dev-python/zc-lockfile: keyworded 2.0 for ia64, bug #717946
[gentoo.git] / dev-python / mysql-connector-python / mysql-connector-python-8.0.19.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=7
5
6 PYTHON_COMPAT=( python3_{6,7,8} )
7 inherit distutils-r1
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"
12
13 KEYWORDS="~amd64 ~arm ~x86"
14 LICENSE="GPL-2"
15 SLOT="0"
16 IUSE="examples test"
17
18 BDEPEND=">=dev-libs/protobuf-3.6.1"
19
20 RDEPEND="
21         >=dev-db/mysql-connector-c-8.0
22         >=dev-python/protobuf-python-3.6.1[${PYTHON_USEDEP}]
23         dev-python/dnspython[${PYTHON_USEDEP}]
24 "
25 # tests/mysqld.py does not like MariaDB version strings.
26 # See the regex MySQLServerBase._get_version.
27 DEPEND="${RDEPEND} test? ( dev-db/mysql[server(+)] )"
28
29 # Tests currently fail.
30 # mysql.connector.errors.DatabaseError: 1300 (HY000): Invalid utf8 character string: ''
31 RESTRICT="test"
32
33 DOCS=( README.txt CHANGES.txt README.rst )
34
35 python_test() {
36         "${EPYTHON}" unittests.py --with-mysql="${EPREFIX}/usr" --unix-socket="${T}" --mysql-topdir="${T}"
37 }
38
39 # Yeah, this is really broken, but the extension will only build this way during "install"
40 python_install() {
41         distutils-r1_python_install \
42                 --with-mysql-capi="${EPREFIX}/usr" \
43                 --with-protobuf-include-dir="${EPREFIX}/usr/include/google/protobuf/" \
44                 --with-protobuf-lib-dir="${EPREFIX}/usr/$(get_libdir)" \
45                 --with-protoc="${EPREFIX}/usr/bin/protoc"
46 }
47
48 python_install_all() {
49         distutils-r1_python_install_all
50         if use examples ; then
51                 dodoc -r examples
52         fi
53 }