summaryrefslogtreecommitdiff
path: root/dev-python/cbor2
diff options
context:
space:
mode:
Diffstat (limited to 'dev-python/cbor2')
-rw-r--r--dev-python/cbor2/Manifest1
-rw-r--r--dev-python/cbor2/cbor2-5.5.0.ebuild46
-rw-r--r--dev-python/cbor2/metadata.xml6
3 files changed, 53 insertions, 0 deletions
diff --git a/dev-python/cbor2/Manifest b/dev-python/cbor2/Manifest
index 0827dd0e64bf..49122fba3815 100644
--- a/dev-python/cbor2/Manifest
+++ b/dev-python/cbor2/Manifest
@@ -1 +1,2 @@
DIST cbor2-5.4.6.tar.gz 86909 BLAKE2B df24c786f32819f9a93a2db28536b78349db6185108188d0a20e7298ff8c083d1feb59110865b4e21190e0363b113201ccddaa0d36b49bd7bbacf9d5ee7695f4 SHA512 44fb3e2e2249c79b1454487670d53eb672ffae4c22374d2a2bb9e314ac15470e4e7913e4eb1981a8bd4d722e6827328dde7e57c5f0556843e951c4723ae5bd8e
+DIST cbor2-5.5.0.tar.gz 94286 BLAKE2B 01c3659c161d47b3e0fa5c9e8833989e448b60d40f408f8c9ebde0a4e3d388dd047aea1666a93f3bb4be1e49695a4089e869d658b594456839c71e2bfe17cb29 SHA512 64b9ef0e358ac02113f85a2e633ed52900c4d5d6c89f889d9322f181e29fbdf9462663b5eaec7a255d5e6d47c82c4902cb7ff56999251c5ec070c7b610e615b3
diff --git a/dev-python/cbor2/cbor2-5.5.0.ebuild b/dev-python/cbor2/cbor2-5.5.0.ebuild
new file mode 100644
index 000000000000..40cfb90674c1
--- /dev/null
+++ b/dev-python/cbor2/cbor2-5.5.0.ebuild
@@ -0,0 +1,46 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DISTUTILS_EXT=1
+DISTUTILS_USE_PEP517=setuptools
+PYTHON_COMPAT=( python3_{8,9,10,11,12} pypy3 )
+
+inherit distutils-r1 pypi
+
+DESCRIPTION="Pure Python CBOR (de)serializer with extensive tag support"
+HOMEPAGE="
+ https://github.com/agronholm/cbor2/
+ https://pypi.org/project/cbor2/
+"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~loong ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
+IUSE="+native-extensions"
+
+BDEPEND="
+ >=dev-python/setuptools-61[${PYTHON_USEDEP}]
+ >=dev-python/setuptools-scm-6.4[${PYTHON_USEDEP}]
+ test? (
+ dev-python/hypothesis[${PYTHON_USEDEP}]
+ )
+"
+
+distutils_enable_tests pytest
+
+python_prepare_all() {
+ # remove pytest-cov dep
+ sed -i -e "s/--cov//" pyproject.toml || die
+ distutils-r1_python_prepare_all
+}
+
+python_compile() {
+ local -x CBOR2_BUILD_C_EXTENSION=1
+ # pypy3 not supported upstream
+ if [[ ${EPYTHON} == pypy3 ]] || ! use native-extensions; then
+ CBOR2_BUILD_C_EXTENSION=0
+ fi
+ distutils-r1_python_compile
+}
diff --git a/dev-python/cbor2/metadata.xml b/dev-python/cbor2/metadata.xml
index d3d03e766940..96ef1e2ff0f3 100644
--- a/dev-python/cbor2/metadata.xml
+++ b/dev-python/cbor2/metadata.xml
@@ -22,5 +22,11 @@ Python Standard Library.
<name>Brian Olson</name>
</maintainer>
</upstream>
+ <use>
+ <flag name="native-extensions">
+ Compiles native "C" extensions (speedups, instead of using python
+ fallback code).
+ </flag>
+ </use>
<origin>gentoo-staging</origin>
</pkgmetadata> \ No newline at end of file