summaryrefslogtreecommitdiff
path: root/dev-python/u-msgpack
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /dev-python/u-msgpack
reinit the tree, so we can have metadata
Diffstat (limited to 'dev-python/u-msgpack')
-rw-r--r--dev-python/u-msgpack/Manifest7
-rw-r--r--dev-python/u-msgpack/files/u-msgpack-2.4.1-little-endian.patch60
-rw-r--r--dev-python/u-msgpack/metadata.xml28
-rw-r--r--dev-python/u-msgpack/u-msgpack-2.3.0.ebuild24
-rw-r--r--dev-python/u-msgpack/u-msgpack-2.4.1.ebuild31
5 files changed, 150 insertions, 0 deletions
diff --git a/dev-python/u-msgpack/Manifest b/dev-python/u-msgpack/Manifest
new file mode 100644
index 000000000000..ed671d7d1161
--- /dev/null
+++ b/dev-python/u-msgpack/Manifest
@@ -0,0 +1,7 @@
+AUX u-msgpack-2.4.1-little-endian.patch 2129 SHA256 69237ab3a14928599eb7e77f563d32654ce5f8d7d7a32c4b3f0848f915b88248 SHA512 978c6eede0b89238134b31b596f9e0fd87d31431fd95d9f44578bb782b17fe8c39fea20bd494581a633219f8137c23156d5bbc454040c137552c7a72901525b5 WHIRLPOOL 6e65379db3edd8568d5deb707b0eb08312844b80d518472b6793798e1b09a88cdd41de3075a13c875dd6bd580f1e59a6604b34534e412d1766ab4ff9f987dd04
+DIST u-msgpack-2.3.0.tar.gz 11644 SHA256 d8df6bb0e2a838aa227c39cfd14aa147ab32b3df6871001874e9b9da9ce1760c SHA512 f39a30fd6b413f1fb57acee6faf0b2d032f940d048b47f04d7f51d46c7f5efc2cede8e298ffef2304c4bcb3e00ade730f76c5b89ebc50ec5766a3c0a69fff316 WHIRLPOOL 147b95349a0a8b631f3d4775ebd46563530cbd72f743ee19723c3330ef45c2866da1fac160d2876b3c949c4769e00f95e75cc59cfb4626f373c982ee8790c21a
+DIST u-msgpack-2.4.1.tar.gz 12026 SHA256 2f31fc1b6dd8632c230ea7012470e40f77119f20999274dda6f1afa9c305e590 SHA512 4c3edb72455e8eb8fa7a4ed9b6ef4461755b782391f2c362d52d0fafda3e790fb40d0d239d05ba99beb3ad4cfd9e200175e2a1917cd64ee1e5d8cc3c4e8b3f25 WHIRLPOOL 8df0c9b0c398b28b03c93b80e690192c6856085dd436e3719449d2c9a3e9ce6c70067c2da06afc5ebe318dd0f4a6cab21c7b08a28364808eb627e3d53b7a594e
+EBUILD u-msgpack-2.3.0.ebuild 588 SHA256 6f65fd92cf6940bce1deffa01036799f969908065716f1c8f7b7c6fcb8a72d28 SHA512 bdc9589e3118a43d5e6511b8796a9337eca5877855365b69578b0dcaa6cfe8a27b275e3f6505f520ae31e63d74f13477529d51cb509976cc98ec5c0cdba3994a WHIRLPOOL 76bab3fc45d4ff8a90bbc85eec53414d8cf0767a7608c45bc55e179fbc475e3141b9f0b6b4afc3d2ce8cbcaf4407c8dbfda36d73cfa35fef1b89e760dea996fa
+EBUILD u-msgpack-2.4.1.ebuild 807 SHA256 ba54f618d6da40434eedcaec6f9afd65eef782c9d4ef2af7344f0ebff1c0117d SHA512 743a0fcbdd13360c31e940060938528daa868f27ca560ae9f38fda8e1e694812fdd2b472b7b03e624eebac4d1d31c1b62ce68f51f20d227d85283b4b63101906 WHIRLPOOL 1db9ca65f2118fa77e8300d2614bc4b2ed0bdf29f91ca1cbf34e23761b59f712459c4d860db5df0eec6733273dc1b9da5f26fbf7c4d3e10cf2e3955d6d9c6573
+MISC ChangeLog 632 SHA256 f3ebdf45b0c25256e3d263a42349529361f828ec1da5c626e02ee3e8454b07a7 SHA512 30c33a3c45f6c3d824582416520a6443fdca8be269c13fc3b4b3dc54a19609f1c0139bee1f07492e04347c3515cb84651729edefcd66daefb528489b9fac1238 WHIRLPOOL 9c266fd8108e00caf6f704458f7fd5c729b6298b4fd275c9e5c5215c959bd7ab891bdc7987939cca0e70de06a614387a93d36c6a975161c343bf890f7f20a287
+MISC metadata.xml 1033 SHA256 fcc108ea5ec647efdb2d18055c2dd1ebc38657a0643438644e7193fc72b95c5e SHA512 8808188cce70672bf3d4e65a8a5f65e8964ca17a82dd5d605fcb49cd3ac8d5f50f6182723537af58499d1a718b728cbbe644e3a628ce23a5327b78f6f47719ac WHIRLPOOL 90d0d567c14bfde147b2c417e53131640af92910e11ef01237d741b8e8957678504b290530d9237643fb5dabf9111a4fe3f01ce16eb347b05866dcfbaea85073
diff --git a/dev-python/u-msgpack/files/u-msgpack-2.4.1-little-endian.patch b/dev-python/u-msgpack/files/u-msgpack-2.4.1-little-endian.patch
new file mode 100644
index 000000000000..c04aca3a3574
--- /dev/null
+++ b/dev-python/u-msgpack/files/u-msgpack-2.4.1-little-endian.patch
@@ -0,0 +1,60 @@
+https://github.com/vsergeev/u-msgpack-python/pull/31
+
+From 003289878812c63ef046dc7090953b8dde784f8c Mon Sep 17 00:00:00 2001
+From: Sergei Trofimovich <slyfox@gentoo.org>
+Date: Fri, 22 Sep 2017 12:09:30 +0100
+Subject: [PATCH] test_umsgpack.py: fix test on big-endian platforms
+
+On powerpc and powerpc64 one test fails as:
+
+```
+ $ py.test -v
+ ...
+ test_umsgpack.py::TestUmsgpack::test_pack_ext_handler FAILED
+ test_umsgpack.py::TestUmsgpack::test_unpack_ext_handler FAILED
+ ...
+
+ self = <test_umsgpack.TestUmsgpack testMethod=test_pack_ext_handler>
+
+ def test_pack_ext_handler(self):
+ for (name, obj, data) in ext_handlers_test_vectors:
+ obj_repr = repr(obj)
+ print("\tTesting %s: object %s" %
+ (name, obj_repr if len(obj_repr) < 24 else obj_repr[0:24] + "..."))
+ packed = umsgpack.packb(obj, ext_handlers=ext_handlers)
+ > self.assertEqual(packed, data)
+ E AssertionError: b'\xd7 ?\x80\x00\x00@\x00\x00\x00' != b'\xd7 \x00\x00\x80?\x00\x00\x00@'
+
+ test_umsgpack.py:484: AssertionError
+```
+
+The problem here is in 'struct.pack' output:
+it uses native endianness format but test hardcodes little-endian output.
+
+The change forces 'struct.pack' into little-endian format.
+That way all tests pass:.
+
+Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
+---
+ test_umsgpack.py | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/test_umsgpack.py b/test_umsgpack.py
+index a25b5b8..e500276 100644
+--- a/test_umsgpack.py
++++ b/test_umsgpack.py
+@@ -297,9 +297,9 @@ float_precision_test_vectors = [
+ CustomType = namedtuple('CustomType', ['x', 'y', 'z'])
+
+ ext_handlers = {
+- complex: lambda obj: umsgpack.Ext(0x20, struct.pack("ff", obj.real, obj.imag)),
++ complex: lambda obj: umsgpack.Ext(0x20, struct.pack("<ff", obj.real, obj.imag)),
+ CustomType: lambda obj: umsgpack.Ext(0x30, umsgpack.packb(list(obj))),
+- 0x20: lambda ext: complex(*struct.unpack("ff", ext.data)),
++ 0x20: lambda ext: complex(*struct.unpack("<ff", ext.data)),
+ 0x30: lambda ext: CustomType(*umsgpack.unpackb(ext.data)),
+ }
+
+--
+2.14.1
+
diff --git a/dev-python/u-msgpack/metadata.xml b/dev-python/u-msgpack/metadata.xml
new file mode 100644
index 000000000000..ba39f6df75aa
--- /dev/null
+++ b/dev-python/u-msgpack/metadata.xml
@@ -0,0 +1,28 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>dolsen@gentoo.org</email>
+ <description>Primary maintainer</description>
+ </maintainer>
+ <maintainer type="project">
+ <email>python@gentoo.org</email>
+ <name>Python</name>
+ </maintainer>
+ <upstream>
+ <maintainer>
+ <email>vsergeev@gmail.com</email>
+ <name>Vanya Sergeev</name>
+ </maintainer>
+ <remote-id type="pypi">u-msgpack-python</remote-id>
+ <remote-id type="github">vsergeev/u-msgpack-python</remote-id>
+ </upstream>
+ <longdescription>
+ u-msgpack-python is a lightweight MessagePack serializer and
+ deserializer module written in pure Python, compatible with both Python
+ 2 and Python 3, as well as CPython and PyPy implementations of Python.
+ u-msgpack-python is fully compliant with the latest MessagePack
+ specification. In particular, it supports the new binary, UTF-8 string,
+ and application-defined ext types
+ </longdescription>
+</pkgmetadata>
diff --git a/dev-python/u-msgpack/u-msgpack-2.3.0.ebuild b/dev-python/u-msgpack/u-msgpack-2.3.0.ebuild
new file mode 100644
index 000000000000..3c209c324b35
--- /dev/null
+++ b/dev-python/u-msgpack/u-msgpack-2.3.0.ebuild
@@ -0,0 +1,24 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+PYTHON_COMPAT=( python2_7 python3_{4,5,6} pypy)
+
+inherit distutils-r1
+
+MY_PN="${PN}-python"
+MY_P="${MY_PN}-${PV}"
+
+DESCRIPTION="A portable, lightweight MessagePack serializer and deserializer"
+HOMEPAGE="https://github.com/vsergeev/u-msgpack-python https://pypi.python.org/pypi/u-msgpack-python"
+SRC_URI="mirror://pypi/${MY_P:0:1}/${MY_PN}/${MY_P}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE=""
+
+DEPEND=""
+RDEPEND="${DEPEND}"
+
+S=${WORKDIR}/${MY_P}
diff --git a/dev-python/u-msgpack/u-msgpack-2.4.1.ebuild b/dev-python/u-msgpack/u-msgpack-2.4.1.ebuild
new file mode 100644
index 000000000000..697ed0e5c003
--- /dev/null
+++ b/dev-python/u-msgpack/u-msgpack-2.4.1.ebuild
@@ -0,0 +1,31 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+PYTHON_COMPAT=( python2_7 python3_{4,5,6} pypy pypy3 )
+
+inherit distutils-r1
+
+MY_PN="${PN}-python"
+MY_P="${MY_PN}-${PV}"
+
+DESCRIPTION="A portable, lightweight MessagePack serializer and deserializer"
+HOMEPAGE="https://github.com/vsergeev/u-msgpack-python https://pypi.python.org/pypi/u-msgpack-python"
+SRC_URI="mirror://pypi/${MY_P:0:1}/${MY_PN}/${MY_P}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="amd64 arm arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 x86"
+IUSE="test"
+
+RDEPEND=""
+DEPEND="${RDEPEND}
+ test? ( dev-python/pytest[${PYTHON_USEDEP}] )"
+
+S=${WORKDIR}/${MY_P}
+
+PATCHES=("${FILESDIR}"/${P}-little-endian.patch)
+
+python_test() {
+ py.test -v || die "Tests fail with ${EPYTHON}"
+}