blob: 4b5ffd910f508124678ea5970663f7348a5ab5a0 [file] [log] [blame]
Allen Webb5835a372019-03-15 10:54:01 -07001# Copyright 2008-2019 Gentoo Authors
2# Distributed under the terms of the GNU General Public License v2
3
4EAPI="6"
5PYTHON_COMPAT=(python{2_7,3_4,3_5,3_6,3_7})
6
7inherit distutils-r1
8
9DESCRIPTION="Google's Protocol Buffers - Python bindings"
10HOMEPAGE="https://developers.google.com/protocol-buffers/ https://github.com/protocolbuffers/protobuf"
11SRC_URI="https://github.com/protocolbuffers/protobuf/archive/v${PV}.tar.gz -> protobuf-${PV}.tar.gz"
12
13LICENSE="BSD"
14SLOT="0/18"
15KEYWORDS="*"
16IUSE=""
17
18DEPEND="${PYTHON_DEPS}
19 ~dev-libs/protobuf-${PV}
20 dev-python/namespace-google[${PYTHON_USEDEP}]
21 dev-python/setuptools[${PYTHON_USEDEP}]
22 dev-python/six[${PYTHON_USEDEP}]"
23RDEPEND="${DEPEND}
24 !<dev-libs/protobuf-3[python(-)]"
25
26S="${WORKDIR}/protobuf-${PV}/python"
27
28python_prepare_all() {
29 eapply -p2 "${FILESDIR}/${PN}-3.7.0-google.protobuf.pyext._message.MessageMeta.patch"
30 distutils-r1_python_prepare_all
31}
32
33python_configure_all() {
34 mydistutilsargs=(--cpp_implementation)
35}
36
37python_compile() {
38 python_is_python3 || local -x CXXFLAGS="${CXXFLAGS} -fno-strict-aliasing"
39 distutils-r1_python_compile
40}
41
42python_test() {
43 esetup.py test
44}
45
46python_install_all() {
47 distutils-r1_python_install_all
48
49 find "${D}" -name "*.pth" -delete || die
50}