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