git: 314e0d5a8c76 - main - security/py-pyaff4: replace pyblake2 with pynacl

From: Ruslan Makhmatkhanov <rm_at_FreeBSD.org>
Date: Mon, 19 Feb 2024 11:40:24 UTC
The branch main has been updated by rm:

URL: https://cgit.FreeBSD.org/ports/commit/?id=314e0d5a8c766d3b809c20c21235b9a040cbab44

commit 314e0d5a8c766d3b809c20c21235b9a040cbab44
Author:     Ruslan Makhmatkhanov <rm@FreeBSD.org>
AuthorDate: 2024-02-19 11:39:18 +0000
Commit:     Ruslan Makhmatkhanov <rm@FreeBSD.org>
CommitDate: 2024-02-19 11:39:18 +0000

    security/py-pyaff4: replace pyblake2 with pynacl
    
    Import minimal upstream commit to switch from pyblake2 to pynacl.
    This allows us to build run this port with python311:
    
    https://github.com/aff4/pyaff4/commit/af2ce19c5a2ad61d68309a856ded93cee2901ea4
    
    Full-blown update to latest version requires adding missing ports to tree.
    
    PR:             277134
    Approved by:    antoine (maintainer)
---
 security/py-pyaff4/Makefile                     |  5 +++--
 security/py-pyaff4/files/patch-pyaff4_hashes.py | 22 ++++++++++++++++++++++
 2 files changed, 25 insertions(+), 2 deletions(-)

diff --git a/security/py-pyaff4/Makefile b/security/py-pyaff4/Makefile
index b7abeda298a6..1cc98a127567 100644
--- a/security/py-pyaff4/Makefile
+++ b/security/py-pyaff4/Makefile
@@ -1,5 +1,6 @@
 PORTNAME=	pyaff4
 DISTVERSION=	0.26.post6
+PORTREVISION=	1
 CATEGORIES=	security devel python
 MASTER_SITES=	PYPI
 PKGNAMEPREFIX=	${PYTHON_PKGNAMEPREFIX}
@@ -14,10 +15,10 @@ RUN_DEPENDS=	${PYTHON_PKGNAMEPREFIX}future>=0:devel/py-future@${PY_FLAVOR} \
 		${PYTHON_PKGNAMEPREFIX}python-snappy>=0.5.1:archivers/py-python-snappy@${PY_FLAVOR} \
 		${PYTHON_PKGNAMEPREFIX}rdflib>=4.2.2:textproc/py-rdflib@${PY_FLAVOR} \
 		${PYTHON_PKGNAMEPREFIX}intervaltree>=2.1.0:devel/py-intervaltree@${PY_FLAVOR} \
-		${PYTHON_PKGNAMEPREFIX}pyblake2>=0.9.3:security/py-pyblake2@${PY_FLAVOR} \
 		${PYTHON_PKGNAMEPREFIX}expiringdict>=1.1.4:devel/py-expiringdict@${PY_FLAVOR} \
 		${PYTHON_PKGNAMEPREFIX}html5lib>=0:www/py-html5lib@${PY_FLAVOR} \
-		${PYTHON_PKGNAMEPREFIX}yaml>=0:devel/py-yaml@${PY_FLAVOR}
+		${PYTHON_PKGNAMEPREFIX}yaml>=0:devel/py-yaml@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}pynacl>0:security/py-pynacl@${PY_FLAVOR}
 
 NO_ARCH=	yes
 USES=		python zip
diff --git a/security/py-pyaff4/files/patch-pyaff4_hashes.py b/security/py-pyaff4/files/patch-pyaff4_hashes.py
new file mode 100644
index 000000000000..8675e79860e6
--- /dev/null
+++ b/security/py-pyaff4/files/patch-pyaff4_hashes.py
@@ -0,0 +1,22 @@
+https://github.com/aff4/pyaff4/commit/af2ce19c5a2ad61d68309a856ded93cee2901ea4
+
+--- pyaff4/hashes.py.orig	2017-12-05 20:36:26 UTC
++++ pyaff4/hashes.py
+@@ -16,7 +16,7 @@ import hashlib
+ from pyaff4 import lexicon
+ from pyaff4.rdfvalue import *
+ import hashlib
+-import pyblake2
++import nacl.hash
+ 
+ def new(datatype):
+     return map[datatype]()
+@@ -54,7 +54,7 @@ map = {
+     lexicon.HASH_SHA256: hashlib.sha256,
+     lexicon.HASH_SHA512: hashlib.sha512,
+     lexicon.HASH_MD5: hashlib.md5,
+-    lexicon.HASH_BLAKE2B: pyblake2.blake2b
++    lexicon.HASH_BLAKE2B: nacl.hash.blake2b
+ }
+ 
+ nameMap = {