Gentoo Archives: gentoo-commits

From: Patrick McLean <chutzpah@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/libnacl/files/, dev-python/libnacl/
Date: Sat, 31 Oct 2020 01:36:59
Message-Id: 1604108203.95563b148779afd817bc4a2814224790d0089c55.chutzpah@gentoo
1 commit: 95563b148779afd817bc4a2814224790d0089c55
2 Author: Patrick McLean <patrick.mclean <AT> sony <DOT> com>
3 AuthorDate: Sat Oct 31 00:47:09 2020 +0000
4 Commit: Patrick McLean <chutzpah <AT> gentoo <DOT> org>
5 CommitDate: Sat Oct 31 01:36:43 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=95563b14
7
8 dev-python/libnacl-1.7.1: Version bump, add py39
9
10 Copyright: Sony Interactive Entertainment Inc.
11 Package-Manager: Portage-3.0.8, Repoman-3.0.2
12 Signed-off-by: Patrick McLean <chutzpah <AT> gentoo.org>
13
14 dev-python/libnacl/Manifest | 1 +
15 dev-python/libnacl/files/libnacl-1.7.1-py39.patch | 35 +++++++++++++++++++++++
16 dev-python/libnacl/libnacl-1.7.1.ebuild | 25 ++++++++++++++++
17 3 files changed, 61 insertions(+)
18
19 diff --git a/dev-python/libnacl/Manifest b/dev-python/libnacl/Manifest
20 index 5a13ab7a786..8ac4bfadb5b 100644
21 --- a/dev-python/libnacl/Manifest
22 +++ b/dev-python/libnacl/Manifest
23 @@ -1 +1,2 @@
24 DIST libnacl-1.6.1.tar.gz 39789 BLAKE2B 7c73f67d4faec8d6e53df21eb3c394d4f36754cd9ad1dfa63ef45aab43bb1832cace7446688b2b29b9923539e00d59f3a78c719b8b8770b2c6c217db19dd2f6d SHA512 90fd9302cdfbe84acfc7dff0ac95eeb05fd1bb346cd8b220613174d5d1ae5f627be06b4d588fd4a939c49a119ca557d68a06d3cbe1c0d409a253fdca96d944ac
25 +DIST libnacl-1.7.1.tar.gz 43232 BLAKE2B 4b6d1434280b548740c873ebbf0eec2a85ca67f1fdb5ebfaf27e2ca3673e7d9175f4427e9d3c84b210094e3ad0248d7c1c1db978ae8e977fcebaf20e6e3f719c SHA512 4beb6a5f30688ea72836512f771c566f2c0c03bbdeade4f4135b3068945a3b3e0da826f97a78f495887e852c36629ddb33e876696263404e74fac11e3b7bc9e9
26
27 diff --git a/dev-python/libnacl/files/libnacl-1.7.1-py39.patch b/dev-python/libnacl/files/libnacl-1.7.1-py39.patch
28 new file mode 100644
29 index 00000000000..62fc1e30258
30 --- /dev/null
31 +++ b/dev-python/libnacl/files/libnacl-1.7.1-py39.patch
32 @@ -0,0 +1,35 @@
33 +commit 53c1576b21b53156fc30d357b40c88c7eefb50de
34 +Author: Karthikeyan Singaravelan <tir.karthi@×××××.com>
35 +Date: Thu Jan 30 22:22:58 2020 +0530
36 +
37 + Remove encoding parameter json.loads for Python 3.9 compatibility.
38 +
39 +diff --git a/libnacl/utils.py b/libnacl/utils.py
40 +index 412d518..e06e078 100644
41 +--- a/libnacl/utils.py
42 ++++ b/libnacl/utils.py
43 +@@ -1,6 +1,7 @@
44 + # -*- coding: utf-8 -*-
45 +
46 + import struct
47 ++import sys
48 + import time
49 +
50 + # Import nacl libs
51 +@@ -31,7 +32,10 @@ def load_key(path_or_file, serial='json'):
52 + key_data = msgpack.load(stream)
53 + elif serial == 'json':
54 + import json
55 +- key_data = json.loads(stream.read(), encoding='UTF-8')
56 ++ if sys.version_info[0] >= 3:
57 ++ key_data = json.loads(stream.read())
58 ++ else:
59 ++ key_data = json.loads(stream.read(), encoding='UTF-8')
60 + finally:
61 + if stream != path_or_file:
62 + stream.close()
63 +@@ -95,4 +99,3 @@ def time_nonce():
64 + '''
65 + nonce = rand_nonce()
66 + return (struct.pack('=d', time.time()) + nonce)[:len(nonce)]
67 +-
68
69 diff --git a/dev-python/libnacl/libnacl-1.7.1.ebuild b/dev-python/libnacl/libnacl-1.7.1.ebuild
70 new file mode 100644
71 index 00000000000..4021fa51ab3
72 --- /dev/null
73 +++ b/dev-python/libnacl/libnacl-1.7.1.ebuild
74 @@ -0,0 +1,25 @@
75 +# Copyright 1999-2020 Gentoo Authors
76 +# Distributed under the terms of the GNU General Public License v2
77 +
78 +EAPI=7
79 +PYTHON_COMPAT=(python3_{6..9})
80 +inherit distutils-r1
81 +
82 +DESCRIPTION="Python ctypes wrapper for libsodium"
83 +HOMEPAGE="https://libnacl.readthedocs.org/"
84 +SRC_URI="https://github.com/saltstack/libnacl/archive/v${PV}.tar.gz -> ${P}.tar.gz"
85 +
86 +LICENSE="Apache-2.0"
87 +SLOT="0"
88 +KEYWORDS="~amd64 ~x86"
89 +
90 +RDEPEND="dev-libs/libsodium"
91 +BDEPEND="${RDEPEND}"
92 +
93 +PATCHES=(
94 + "${FILESDIR}/libnacl-1.7.1-py39.patch"
95 +)
96 +
97 +python_test() {
98 + "${EPYTHON}" -m unittest discover -v -p 'test_*.py' tests/ || die "Tests failed with ${EPYTHON}"
99 +}