summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2021-04-12 15:11:49 +0200
committerMichał Górny <mgorny@gentoo.org>2021-04-12 15:20:28 +0200
commit5a09551361bd28e2e8f248104a4656608800af61 (patch)
treee7732c19b78d5262e00929baea159111bffe69e9 /dev-python/libnacl
parentnet-libs/srt: stable 1.4.2 on arm (bug 761547) (diff)
downloadgentoo-5a09551361bd28e2e8f248104a4656608800af61.tar.gz
gentoo-5a09551361bd28e2e8f248104a4656608800af61.tar.bz2
gentoo-5a09551361bd28e2e8f248104a4656608800af61.zip
dev-python/libnacl: Fix on 32-bit arches
Closes: https://bugs.gentoo.org/768492 Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'dev-python/libnacl')
-rw-r--r--dev-python/libnacl/files/libnacl-1.7.2-32bit.patch25
-rw-r--r--dev-python/libnacl/libnacl-1.7.2-r1.ebuild (renamed from dev-python/libnacl/libnacl-1.7.2.ebuild)4
2 files changed, 29 insertions, 0 deletions
diff --git a/dev-python/libnacl/files/libnacl-1.7.2-32bit.patch b/dev-python/libnacl/files/libnacl-1.7.2-32bit.patch
new file mode 100644
index 000000000000..f8a06d27949a
--- /dev/null
+++ b/dev-python/libnacl/files/libnacl-1.7.2-32bit.patch
@@ -0,0 +1,25 @@
+From f1567460f2d07822f2125778a55bf90b74ef807f Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
+Date: Mon, 12 Apr 2021 15:10:09 +0200
+Subject: [PATCH] Fix crypto_kdf_derive_from_key() on 32-bit platforms
+
+---
+ libnacl/__init__.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/libnacl/__init__.py b/libnacl/__init__.py
+index 1aa722a..7649013 100644
+--- a/libnacl/__init__.py
++++ b/libnacl/__init__.py
+@@ -1180,7 +1180,7 @@ def crypto_kdf_derive_from_key(subkey_size, subkey_id, context, master_key):
+ '''
+ size = int(subkey_size)
+ buf = ctypes.create_string_buffer(size)
+- nacl.crypto_kdf_derive_from_key(buf, subkey_size, subkey_id, context, master_key)
++ nacl.crypto_kdf_derive_from_key(buf, subkey_size, ctypes.c_ulonglong(subkey_id), context, master_key)
+ return buf.raw
+
+ # Key Exchange API
+--
+2.31.1
+
diff --git a/dev-python/libnacl/libnacl-1.7.2.ebuild b/dev-python/libnacl/libnacl-1.7.2-r1.ebuild
index 52fd6f2d3c6e..614f90975ef6 100644
--- a/dev-python/libnacl/libnacl-1.7.2.ebuild
+++ b/dev-python/libnacl/libnacl-1.7.2-r1.ebuild
@@ -17,6 +17,10 @@ KEYWORDS="amd64 ~arm ~x86"
RDEPEND="dev-libs/libsodium"
BDEPEND="${RDEPEND}"
+PATCHES=(
+ "${FILESDIR}"/libnacl-1.7.2-32bit.patch
+)
+
python_test() {
"${EPYTHON}" -m unittest discover -v -p 'test_*.py' tests/ || die "Tests failed with ${EPYTHON}"
}