summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick McLean <patrick.mclean@sony.com>2020-10-30 17:47:09 -0700
committerPatrick McLean <chutzpah@gentoo.org>2020-10-30 18:36:43 -0700
commit95563b148779afd817bc4a2814224790d0089c55 (patch)
treee18129c82b5fa650f47d26a7b5f85630a1ad7fda /dev-python/libnacl
parentdev-python/ioflo-2.0.2: Version bump, add py39 (diff)
downloadgentoo-95563b148779afd817bc4a2814224790d0089c55.tar.gz
gentoo-95563b148779afd817bc4a2814224790d0089c55.tar.bz2
gentoo-95563b148779afd817bc4a2814224790d0089c55.zip
dev-python/libnacl-1.7.1: Version bump, add py39
Copyright: Sony Interactive Entertainment Inc. Package-Manager: Portage-3.0.8, Repoman-3.0.2 Signed-off-by: Patrick McLean <chutzpah@gentoo.org>
Diffstat (limited to 'dev-python/libnacl')
-rw-r--r--dev-python/libnacl/Manifest1
-rw-r--r--dev-python/libnacl/files/libnacl-1.7.1-py39.patch35
-rw-r--r--dev-python/libnacl/libnacl-1.7.1.ebuild25
3 files changed, 61 insertions, 0 deletions
diff --git a/dev-python/libnacl/Manifest b/dev-python/libnacl/Manifest
index 5a13ab7a786..8ac4bfadb5b 100644
--- a/dev-python/libnacl/Manifest
+++ b/dev-python/libnacl/Manifest
@@ -1 +1,2 @@
DIST libnacl-1.6.1.tar.gz 39789 BLAKE2B 7c73f67d4faec8d6e53df21eb3c394d4f36754cd9ad1dfa63ef45aab43bb1832cace7446688b2b29b9923539e00d59f3a78c719b8b8770b2c6c217db19dd2f6d SHA512 90fd9302cdfbe84acfc7dff0ac95eeb05fd1bb346cd8b220613174d5d1ae5f627be06b4d588fd4a939c49a119ca557d68a06d3cbe1c0d409a253fdca96d944ac
+DIST libnacl-1.7.1.tar.gz 43232 BLAKE2B 4b6d1434280b548740c873ebbf0eec2a85ca67f1fdb5ebfaf27e2ca3673e7d9175f4427e9d3c84b210094e3ad0248d7c1c1db978ae8e977fcebaf20e6e3f719c SHA512 4beb6a5f30688ea72836512f771c566f2c0c03bbdeade4f4135b3068945a3b3e0da826f97a78f495887e852c36629ddb33e876696263404e74fac11e3b7bc9e9
diff --git a/dev-python/libnacl/files/libnacl-1.7.1-py39.patch b/dev-python/libnacl/files/libnacl-1.7.1-py39.patch
new file mode 100644
index 00000000000..62fc1e30258
--- /dev/null
+++ b/dev-python/libnacl/files/libnacl-1.7.1-py39.patch
@@ -0,0 +1,35 @@
+commit 53c1576b21b53156fc30d357b40c88c7eefb50de
+Author: Karthikeyan Singaravelan <tir.karthi@gmail.com>
+Date: Thu Jan 30 22:22:58 2020 +0530
+
+ Remove encoding parameter json.loads for Python 3.9 compatibility.
+
+diff --git a/libnacl/utils.py b/libnacl/utils.py
+index 412d518..e06e078 100644
+--- a/libnacl/utils.py
++++ b/libnacl/utils.py
+@@ -1,6 +1,7 @@
+ # -*- coding: utf-8 -*-
+
+ import struct
++import sys
+ import time
+
+ # Import nacl libs
+@@ -31,7 +32,10 @@ def load_key(path_or_file, serial='json'):
+ key_data = msgpack.load(stream)
+ elif serial == 'json':
+ import json
+- key_data = json.loads(stream.read(), encoding='UTF-8')
++ if sys.version_info[0] >= 3:
++ key_data = json.loads(stream.read())
++ else:
++ key_data = json.loads(stream.read(), encoding='UTF-8')
+ finally:
+ if stream != path_or_file:
+ stream.close()
+@@ -95,4 +99,3 @@ def time_nonce():
+ '''
+ nonce = rand_nonce()
+ return (struct.pack('=d', time.time()) + nonce)[:len(nonce)]
+-
diff --git a/dev-python/libnacl/libnacl-1.7.1.ebuild b/dev-python/libnacl/libnacl-1.7.1.ebuild
new file mode 100644
index 00000000000..4021fa51ab3
--- /dev/null
+++ b/dev-python/libnacl/libnacl-1.7.1.ebuild
@@ -0,0 +1,25 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+PYTHON_COMPAT=(python3_{6..9})
+inherit distutils-r1
+
+DESCRIPTION="Python ctypes wrapper for libsodium"
+HOMEPAGE="https://libnacl.readthedocs.org/"
+SRC_URI="https://github.com/saltstack/libnacl/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+
+RDEPEND="dev-libs/libsodium"
+BDEPEND="${RDEPEND}"
+
+PATCHES=(
+ "${FILESDIR}/libnacl-1.7.1-py39.patch"
+)
+
+python_test() {
+ "${EPYTHON}" -m unittest discover -v -p 'test_*.py' tests/ || die "Tests failed with ${EPYTHON}"
+}