commit:     5a09551361bd28e2e8f248104a4656608800af61
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Mon Apr 12 13:11:49 2021 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Mon Apr 12 13:20:28 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5a095513

dev-python/libnacl: Fix on 32-bit arches

Closes: https://bugs.gentoo.org/768492
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 dev-python/libnacl/files/libnacl-1.7.2-32bit.patch | 25 ++++++++++++++++++++++
 ...ibnacl-1.7.2.ebuild => libnacl-1.7.2-r1.ebuild} |  4 ++++
 2 files changed, 29 insertions(+)

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 00000000000..f8a06d27949
--- /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?= <[email protected]>
+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
similarity index 91%
rename from dev-python/libnacl/libnacl-1.7.2.ebuild
rename to dev-python/libnacl/libnacl-1.7.2-r1.ebuild
index 52fd6f2d3c6..614f90975ef 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}"
 }

Reply via email to