summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarshall Brewer (Gentoo Key) <tomboy64@sina.cn>2016-04-17 21:25:41 +0200
committerIan Delaney <idella4@gentoo.org>2016-04-21 17:51:59 +0800
commitf47f7012a3efc785a9672d5197ed16f4038a0291 (patch)
tree3a1c3d1668dca4690950391e7861e657cc7d38be /dev-python/protobuf-python
parentdev-libs/protobuf: version bump, 3.0.0_beta2 (diff)
downloadgentoo-f47f7012a3efc785a9672d5197ed16f4038a0291.tar.gz
gentoo-f47f7012a3efc785a9672d5197ed16f4038a0291.tar.bz2
gentoo-f47f7012a3efc785a9672d5197ed16f4038a0291.zip
dev-python/protobuf-python: initial version, 3.0.0_beta2
- outsourced python implementation of dev-libs/protobuf - added PYTHON_COMPAT for python 3.* and pypy{,3} Package-Manager: portage-2.2.28 RepoMan-Options: --ignore-arches Closes: https://github.com/gentoo/gentoo/pull/1295 Signed-off-by: Ian Delaney <idella4@gentoo.org>
Diffstat (limited to 'dev-python/protobuf-python')
-rw-r--r--dev-python/protobuf-python/Manifest1
-rw-r--r--dev-python/protobuf-python/files/protobuf-3.0.0_beta2-link-against-installed-lib.patch32
-rw-r--r--dev-python/protobuf-python/metadata.xml24
-rw-r--r--dev-python/protobuf-python/protobuf-python-3.0.0_beta2.ebuild38
4 files changed, 95 insertions, 0 deletions
diff --git a/dev-python/protobuf-python/Manifest b/dev-python/protobuf-python/Manifest
new file mode 100644
index 000000000000..ba9743b769c0
--- /dev/null
+++ b/dev-python/protobuf-python/Manifest
@@ -0,0 +1 @@
+DIST protobuf-3.0.0_beta2.tar.gz 3333054 SHA256 be224d07ce87f12e362cff3df02851107bf92a4e4604349b1d7a4b1f0c3bfd86 SHA512 3a9329603226dabeaae7c28eb7463fb4403383e7774d53742e9e38a0426f5ef370803c68e4d4bc0d37585618fb340befe4f812731db0984b12032c3d931cdca7 WHIRLPOOL 0e77105c24d71c0269f4375ebfaef38175d762e1a90cdd81f594c13bbece9f390ada9291f722e8e0227952a1f5cd94976037f069b86703c7a3a37a9277cb66f8
diff --git a/dev-python/protobuf-python/files/protobuf-3.0.0_beta2-link-against-installed-lib.patch b/dev-python/protobuf-python/files/protobuf-3.0.0_beta2-link-against-installed-lib.patch
new file mode 100644
index 000000000000..3d419ba3d194
--- /dev/null
+++ b/dev-python/protobuf-python/files/protobuf-3.0.0_beta2-link-against-installed-lib.patch
@@ -0,0 +1,32 @@
+diff -Naur python/setup.py python/setup.py
+--- python/setup.py 2015-12-30 22:21:46.000000000 +0100
++++ python/setup.py 2016-04-18 00:51:49.490809789 +0200
+@@ -169,14 +169,26 @@
+ extra_compile_args.append('-Werror')
+ sys.argv.remove(warnings_as_errors)
+
++ inclD = ['.', '../src']
++ libD = []
++ try:
++ subprocess.check_call(['pkg-config', '--exists', 'protobuf'])
++ inclD += subprocess.check_output(['pkg-config','--variable=includedir','protobuf']).split()
++ libD = subprocess.check_output(['pkg-config','--variable=libdir','protobuf']).split()
++ except OSError as osex:
++ if osex.errno == errno.ENOENT:
++ info('pkg-config not found')
++ else:
++ warn("Running pkg-config failed - %s." % osexception)
++ libD = ['../src/.libs']
+ # C++ implementation extension
+ ext_module_list.append(
+ Extension(
+ "google.protobuf.pyext._message",
+ glob.glob('google/protobuf/pyext/*.cc'),
+- include_dirs=[".", "../src"],
++ include_dirs=inclD,
+ libraries=['protobuf'],
+- library_dirs=['../src/.libs'],
++ library_dirs=libD,
+ extra_compile_args=extra_compile_args,
+ )
+ )
diff --git a/dev-python/protobuf-python/metadata.xml b/dev-python/protobuf-python/metadata.xml
new file mode 100644
index 000000000000..4c6fe778f353
--- /dev/null
+++ b/dev-python/protobuf-python/metadata.xml
@@ -0,0 +1,24 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!DOCTYPE pkgmetadata SYSTEM 'http://www.gentoo.org/dtd/metadata.dtd'>
+<pkgmetadata>
+<maintainer type='person'>
+ <email>vapier@gentoo.org</email>
+</maintainer>
+<maintainer type='person'>
+ <email>tomboy64@sina.cn</email>
+</maintainer>
+<maintainer type="project">
+ <email>python@gentoo.org</email>
+ <name>Gentoo Python Project</name>
+</maintainer>
+<maintainer type="project">
+ <email>proxy-maint@gentoo.org</email>
+ <name>Gentoo Proxy Maintainers Project</name>
+</maintainer>
+<slots>
+ <subslots>soname major version number of protobuf</subslots>
+</slots>
+<upstream>
+ <remote-id type='github'>google/protobuf</remote-id>
+</upstream>
+</pkgmetadata>
diff --git a/dev-python/protobuf-python/protobuf-python-3.0.0_beta2.ebuild b/dev-python/protobuf-python/protobuf-python-3.0.0_beta2.ebuild
new file mode 100644
index 000000000000..05552d0615ae
--- /dev/null
+++ b/dev-python/protobuf-python/protobuf-python-3.0.0_beta2.ebuild
@@ -0,0 +1,38 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=6
+# pypy fails tests; pypy3 fails even running tests
+PYTHON_COMPAT=( python2_7 python3_3 python3_4 python3_5 )
+
+inherit distutils-r1
+
+MY_PV=${PV/_beta2/-beta-2}
+
+DESCRIPTION="Google's Protocol Buffers - official Python bindings"
+HOMEPAGE="https://github.com/google/protobuf/ https://developers.google.com/protocol-buffers/"
+SRC_URI="https://github.com/google/protobuf/archive/v${MY_PV}.tar.gz -> protobuf-${PV}.tar.gz"
+
+LICENSE="Apache-2.0"
+SLOT="0/10"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sh ~sparc ~x86 ~amd64-linux ~arm-linux ~x86-linux ~x64-macos ~x86-macos"
+IUSE=""
+
+# Protobuf is only a build-time dep, but depend on the exact same version
+# (excluding revision), since we are using the same tarball.
+# In case of using the (linked) cpp implementation we should be fine with the same subslot.
+RDEPEND="${PYTHON_DEPS}
+ !<dev-libs/protobuf-3[python(-)]"
+DEPEND="${RDEPEND}
+ >=dev-libs/protobuf-3
+ dev-python/setuptools[${PYTHON_USEDEP}]
+ dev-python/six[${PYTHON_USEDEP}]"
+S="${WORKDIR}/protobuf-${MY_PV}/python"
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+PATCHES=( "${FILESDIR}/protobuf-${PV}-link-against-installed-lib.patch" )
+
+python_test() {
+ distutils_install_for_testing
+ esetup.py test
+}