git: c86cfc131ba7 - main - security/py-python-pkcs11: Update to 0.8.1

From: Po-Chuan Hsieh <sunpoet_at_FreeBSD.org>
Date: Sun, 29 Jun 2025 11:49:50 UTC
The branch main has been updated by sunpoet:

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

commit c86cfc131ba7bb64764f56cd74dad695d182303c
Author:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
AuthorDate: 2025-06-29 11:36:51 +0000
Commit:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
CommitDate: 2025-06-29 11:46:10 +0000

    security/py-python-pkcs11: Update to 0.8.1
    
    - Add GitHub to MASTER_SITES
    - Update WWW
    - Strip shared library
    
    Changes:        https://github.com/pyauth/python-pkcs11/releases
---
 security/py-python-pkcs11/Makefile                 | 19 +++++++----
 security/py-python-pkcs11/distinfo                 |  6 ++--
 .../py-python-pkcs11/files/patch-pyproject.toml    | 39 ++++++++++++++++++++++
 security/py-python-pkcs11/files/patch-setup.py     | 31 +++++++++++++++++
 4 files changed, 85 insertions(+), 10 deletions(-)

diff --git a/security/py-python-pkcs11/Makefile b/security/py-python-pkcs11/Makefile
index de79ce0ba106..b632077457e1 100644
--- a/security/py-python-pkcs11/Makefile
+++ b/security/py-python-pkcs11/Makefile
@@ -1,23 +1,28 @@
 PORTNAME=	python-pkcs11
-PORTVERSION=	0.7.0
-PORTREVISION=	1
+PORTVERSION=	0.8.1
 CATEGORIES=	security python
-MASTER_SITES=	PYPI
+MASTER_SITES=	PYPI \
+		https://github.com/pyauth/python-pkcs11/releases/download/v${PORTVERSION}/
 PKGNAMEPREFIX=	${PYTHON_PKGNAMEPREFIX}
+DISTNAME=	python_pkcs11-${PORTVERSION}
 
 MAINTAINER=	sunpoet@FreeBSD.org
 COMMENT=	PKCS\#11 (Cryptoki) support for Python
-WWW=		https://github.com/danni/python-pkcs11
+WWW=		https://python-pkcs11.readthedocs.io/en/latest/ \
+		https://github.com/danni/python-pkcs11
 
 LICENSE=	MIT
+LICENSE_FILE=	${WRKSRC}/LICENSE
 
 BUILD_DEPENDS=	${PYTHON_PKGNAMEPREFIX}setuptools>=0:devel/py-setuptools@${PY_FLAVOR} \
 		${PYTHON_PKGNAMEPREFIX}setuptools-scm>=0:devel/py-setuptools-scm@${PY_FLAVOR} \
 		${PYTHON_PKGNAMEPREFIX}wheel>=0:devel/py-wheel@${PY_FLAVOR}
-RUN_DEPENDS=	${PYTHON_PKGNAMEPREFIX}asn1crypto>=0:devel/py-asn1crypto@${PY_FLAVOR} \
-		${PYTHON_PKGNAMEPREFIX}cached-property>=0:devel/py-cached-property@${PY_FLAVOR}
+RUN_DEPENDS=	${PYTHON_PKGNAMEPREFIX}asn1crypto>=0:devel/py-asn1crypto@${PY_FLAVOR}
 
 USES=		python
-USE_PYTHON=	autoplist concurrent cython pep517
+USE_PYTHON=	autoplist concurrent cython3 pep517
+
+post-install:
+	${FIND} ${STAGEDIR}${PYTHON_SITELIBDIR} -name '*.so' -exec ${STRIP_CMD} {} +
 
 .include <bsd.port.mk>
diff --git a/security/py-python-pkcs11/distinfo b/security/py-python-pkcs11/distinfo
index 264683b9b975..c0a5f4aad13a 100644
--- a/security/py-python-pkcs11/distinfo
+++ b/security/py-python-pkcs11/distinfo
@@ -1,3 +1,3 @@
-TIMESTAMP = 1607539627
-SHA256 (python-pkcs11-0.7.0.tar.gz) = 9737e0c24cabb8bc9d48bf8c57c3df2a70f8cdd96b70c50290803286f9e46bf7
-SIZE (python-pkcs11-0.7.0.tar.gz) = 106517
+TIMESTAMP = 1750954234
+SHA256 (python_pkcs11-0.8.1.tar.gz) = f9e11df146ce2e6359aeb81fa84c2dd7ab9719f707cdae06ceae22d9e6a10818
+SIZE (python_pkcs11-0.8.1.tar.gz) = 156019
diff --git a/security/py-python-pkcs11/files/patch-pyproject.toml b/security/py-python-pkcs11/files/patch-pyproject.toml
new file mode 100644
index 000000000000..df5030c3b30f
--- /dev/null
+++ b/security/py-python-pkcs11/files/patch-pyproject.toml
@@ -0,0 +1,39 @@
+Revert:		https://github.com/pyauth/python-pkcs11/commit/d45957fd94abfd01b47cbf6a5b96862cf542dfbb
+
+--- pyproject.toml.orig	2025-06-22 05:22:53 UTC
++++ pyproject.toml
+@@ -1,5 +1,5 @@
+ [build-system]
+-requires = ["setuptools>=80.8", "cython", "setuptools-scm>=8.3.1"]
++requires = ["setuptools>=61", "cython", "setuptools-scm>=8"]
+ build-backend = "setuptools.build_meta"
+ 
+ [project]
+@@ -24,7 +24,7 @@ dependencies = ["asn1crypto>=1.5.1"]
+     "Topic :: Security :: Cryptography",
+ ]
+ dependencies = ["asn1crypto>=1.5.1"]
+-license = "MIT"
++license = {text = "MIT"}
+ requires-python = ">=3.9"
+ dynamic = ["version"]
+ 
+@@ -49,11 +49,6 @@ combine-as-imports = true
+ 
+ [tool.ruff.lint.isort]
+ combine-as-imports = true
+-
+-[tool.setuptools]
+-ext-modules = [
+-    {name = "pkcs11._pkcs11", sources = ["pkcs11/_pkcs11.pyx"]}
+-]
+ 
+ [tool.cibuildwheel.linux]
+ archs = ["auto64"]
+@@ -96,4 +91,4 @@ dev = [
+     { include-group = "release" },
+ ]
+ 
+-[tool.setuptools_scm]
+\ No newline at end of file
++[tool.setuptools_scm]
diff --git a/security/py-python-pkcs11/files/patch-setup.py b/security/py-python-pkcs11/files/patch-setup.py
new file mode 100644
index 000000000000..83b827201bbe
--- /dev/null
+++ b/security/py-python-pkcs11/files/patch-setup.py
@@ -0,0 +1,31 @@
+Revert:		https://github.com/pyauth/python-pkcs11/commit/d45957fd94abfd01b47cbf6a5b96862cf542dfbb
+
+--- setup.py.orig	2025-06-27 14:01:42 UTC
++++ setup.py
+@@ -0,0 +1,26 @@
++# Add cython extension module to build configuration.
++#
++# See also: https://setuptools.pypa.io/en/latest/userguide/ext_modules.html
++
++import platform
++
++from setuptools import Extension, setup
++
++libraries = []
++
++# if compiling using MSVC, we need to link against user32 library
++if platform.system() == "Windows":
++    libraries.append("user32")
++
++
++setup(
++    ext_modules=[
++        Extension(
++            name="pkcs11._pkcs11",
++            sources=[
++                "pkcs11/_pkcs11.pyx",
++            ],
++            libraries=libraries,
++        ),
++    ],
++)