From 413d2406cb7ed7ce1171d8692a9cd2c7a5b6b1df Mon Sep 17 00:00:00 2001 From: Oleksandr Trotsenko Date: Thu, 7 Jun 2018 13:06:52 -0500 Subject: [PATCH] dev-python/brotlipy: Introducing the package Introduce the dev/python/brotlipy package into Gentoo. Closes: https://bugs.gentoo.org/654854 Closes: https://github.com/gentoo/gentoo/pull/8261 Package-Manager: Portage-2.3.40, Repoman-2.3.9 --- dev-python/brotlipy/Manifest | 2 + dev-python/brotlipy/brotlipy-0.7.0.ebuild | 48 +++++++++++++++++++++++ dev-python/brotlipy/metadata.xml | 12 ++++++ 3 files changed, 62 insertions(+) create mode 100644 dev-python/brotlipy/Manifest create mode 100644 dev-python/brotlipy/brotlipy-0.7.0.ebuild create mode 100644 dev-python/brotlipy/metadata.xml diff --git a/dev-python/brotlipy/Manifest b/dev-python/brotlipy/Manifest new file mode 100644 index 0000000000000..d8b0aa25bad29 --- /dev/null +++ b/dev-python/brotlipy/Manifest @@ -0,0 +1,2 @@ +DIST brotli-46c1a881b41bb638c76247558aa04b1591af3aa7.tar.gz 19840371 BLAKE2B b9a1c3c2e5b62bd63b392debe54bd1732ac1cb31f88500f0142108b453649d96901d9a03b6db98642cb9abaf9188c06d440f2b8bd3cf57fbbb52196a931f5079 SHA512 dc573c90491032a205f32f0ce9c93e95b06c70a3107caa9501e038a212226c37117d63709a29843367344bf7d18cf32d0c0578b11166387198e12b38b1522406 +DIST brotlipy-0.7.0.tar.gz 19375 BLAKE2B 035dc8757e491bc4fc0d8e2b6b82703eecc8f6f4150da42fda0f6c6f42a617519f5191371eb1dd976b8bbfeab88845bb018b874a395cdbf0ff409a6911f969f5 SHA512 bec8183cf3cc8ba9e594d1a86a8a33d88a6ac8e9c6a6287c837bda3726183ff1b486f2c49da4e489b5b3cb51b57dd5816413b59419920c2ced48435221f1beaf diff --git a/dev-python/brotlipy/brotlipy-0.7.0.ebuild b/dev-python/brotlipy/brotlipy-0.7.0.ebuild new file mode 100644 index 0000000000000..8d08a0abeedf5 --- /dev/null +++ b/dev-python/brotlipy/brotlipy-0.7.0.ebuild @@ -0,0 +1,48 @@ +# Copyright 1999-2018 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +PYTHON_COMPAT=( python{2_7,3_4,3_5,3_6} ) + +inherit distutils-r1 + +# Commit of the Brotli library bundled within brotlipy. +BROTLI_BUNDLED_COMMIT="46c1a881b41bb638c76247558aa04b1591af3aa7" + +DESCRIPTION="Python binding to the Brotli library" +HOMEPAGE="https://github.com/python-hyper/brotlipy/ https://pypi.python.org/pypi/brotlipy" +SRC_URI=" + https://github.com/python-hyper/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz + https://github.com/google/brotli/archive/${BROTLI_BUNDLED_COMMIT}.tar.gz -> brotli-${BROTLI_BUNDLED_COMMIT}.tar.gz +" + +LICENSE="MIT" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="test" + +RDEPEND="virtual/python-cffi[${PYTHON_USEDEP}]" +DEPEND=" + ${RDEPEND} + dev-python/setuptools[${PYTHON_USEDEP}] + test? ( + dev-python/hypothesis[${PYTHON_USEDEP}] + dev-python/pytest[${PYTHON_USEDEP}] + ) +" + +src_prepare() { + # Inject the brotli lib. + rm -r "${WORKDIR}/${P}/libbrotli" || die "Could not remove the bundled brotli lib folder." + cp -r "${WORKDIR}/brotli-${BROTLI_BUNDLED_COMMIT}/" "${WORKDIR}/${P}/libbrotli" || die "Could not inject the brotli lib." + + # Tests fail if we have this folder preserved within the lib. + rm -r "${WORKDIR}/${P}/libbrotli/python" || die "Could not remove 'python' subfolder." + + eapply_user +} + +python_test() { + py.test -v || die "Testing failed" +} diff --git a/dev-python/brotlipy/metadata.xml b/dev-python/brotlipy/metadata.xml new file mode 100644 index 0000000000000..e7214b7e32c54 --- /dev/null +++ b/dev-python/brotlipy/metadata.xml @@ -0,0 +1,12 @@ + + + + + oleksandr.trotsenko@gmail.com + Oleksandr Trotsenko + + + proxy-maint@gentoo.org + Proxy Maintainers + +