Wed Oct 19 14:11:01 2022 UTC ()
fighting a losing battle against the py-cryptography rustification, part 3

Re-import the last version of py-OpenSSL without a hard unnecessary
dependency on rustified py-cryptography


(nia)
diff -r0 -r1.1 pkgsrc/security/py27-OpenSSL/DESCR
diff -r0 -r1.1 pkgsrc/security/py27-OpenSSL/Makefile
diff -r0 -r1.1 pkgsrc/security/py27-OpenSSL/PLIST
diff -r0 -r1.1 pkgsrc/security/py27-OpenSSL/distinfo
diff -r0 -r1.1 pkgsrc/security/py27-OpenSSL/patches/patch-tests_memdbg.py

File Added: pkgsrc/security/py27-OpenSSL/DESCR
pyOpenSSL is a Python module that is a rather thin wrapper around (a
subset of) the OpenSSL library.  A lot of the object methods do
nothing more than call a corresponding function in the OpenSSL
library.

This legacy version is the last version supporting non-Rust
platforms (as well as, coincidentally, Python 2.7).

File Added: pkgsrc/security/py27-OpenSSL/Makefile
# $NetBSD: Makefile,v 1.1 2022/10/19 14:11:01 nia Exp $

DISTNAME=	pyOpenSSL-21.0.0
PKGNAME=	${PYPKGPREFIX}-${DISTNAME:S/py//}
CATEGORIES=	security python
MASTER_SITES=	${MASTER_SITE_PYPI:=p/pyOpenSSL/}

MAINTAINER=	pkgsrc-users@NetBSD.org
HOMEPAGE=	https://pyopenssl.org/
COMMENT=	Python interface to the OpenSSL library
LICENSE=	apache-2.0

DEPENDS+=	${PYPKGPREFIX}-six>=1.5.2:../../lang/py-six
TEST_DEPENDS+=	${PYPKGPREFIX}-flaky-[0-9]*:../../devel/py-flaky
TEST_DEPENDS+=	${PYPKGPREFIX}-pretend-[0-9]*:../../devel/py-pretend
TEST_DEPENDS+=	${PYPKGPREFIX}-test-runner-[0-9]*:../../devel/py-test-runner

# https://github.com/pyca/pyopenssl/issues/656
PYSETUPTESTTARGET=	pytest

PYTHON_VERSIONED_DEPENDENCIES=	cryptography

.include "../../lang/python/egg.mk"
.include "../../lang/python/versioned_dependencies.mk"
.include "../../security/openssl/buildlink3.mk"
.include "../../mk/bsd.pkg.mk"

File Added: pkgsrc/security/py27-OpenSSL/PLIST
@comment $NetBSD: PLIST,v 1.1 2022/10/19 14:11:01 nia Exp $
${PYSITELIB}/OpenSSL/SSL.py
${PYSITELIB}/OpenSSL/SSL.pyc
${PYSITELIB}/OpenSSL/SSL.pyo
${PYSITELIB}/OpenSSL/__init__.py
${PYSITELIB}/OpenSSL/__init__.pyc
${PYSITELIB}/OpenSSL/__init__.pyo
${PYSITELIB}/OpenSSL/_util.py
${PYSITELIB}/OpenSSL/_util.pyc
${PYSITELIB}/OpenSSL/_util.pyo
${PYSITELIB}/OpenSSL/crypto.py
${PYSITELIB}/OpenSSL/crypto.pyc
${PYSITELIB}/OpenSSL/crypto.pyo
${PYSITELIB}/OpenSSL/debug.py
${PYSITELIB}/OpenSSL/debug.pyc
${PYSITELIB}/OpenSSL/debug.pyo
${PYSITELIB}/OpenSSL/rand.py
${PYSITELIB}/OpenSSL/rand.pyc
${PYSITELIB}/OpenSSL/rand.pyo
${PYSITELIB}/OpenSSL/version.py
${PYSITELIB}/OpenSSL/version.pyc
${PYSITELIB}/OpenSSL/version.pyo
${PYSITELIB}/${EGG_INFODIR}/PKG-INFO
${PYSITELIB}/${EGG_INFODIR}/SOURCES.txt
${PYSITELIB}/${EGG_INFODIR}/dependency_links.txt
${PYSITELIB}/${EGG_INFODIR}/requires.txt
${PYSITELIB}/${EGG_INFODIR}/top_level.txt

File Added: pkgsrc/security/py27-OpenSSL/distinfo
$NetBSD: distinfo,v 1.1 2022/10/19 14:11:01 nia Exp $

BLAKE2s (pyOpenSSL-21.0.0.tar.gz) = 498287e93820caab4741b4e5222d202fd57913d9edee456a6621bf9ffbb3d00f
SHA512 (pyOpenSSL-21.0.0.tar.gz) = ca772a420b13b1e3c421170baab031d4769d77539eb5ad3eb0fda409aa8692596ce85d21b244b6e49e70fd35609b64190dcbc4fc8d4493292bac19b7856d5175
Size (pyOpenSSL-21.0.0.tar.gz) = 175652 bytes
SHA1 (patch-tests_memdbg.py) = a2d2395a0fe1dd1934a50b065fe68f47907f0b87

File Added: pkgsrc/security/py27-OpenSSL/patches/patch-tests_memdbg.py
$NetBSD: patch-tests_memdbg.py,v 1.1 2022/10/19 14:11:01 nia Exp $

Fix running test on NetBSD.
https://github.com/pyca/pyopenssl/issues/595

--- tests/memdbg.py.orig	2020-12-15 15:30:54.000000000 +0000
+++ tests/memdbg.py
@@ -19,9 +19,9 @@ _ffi.cdef(
     int  CRYPTO_set_mem_functions(
         void *(*m)(size_t),void *(*r)(void *,size_t), void (*f)(void *));
 
-    int backtrace(void **buffer, int size);
-    char **backtrace_symbols(void *const *buffer, int size);
-    void backtrace_symbols_fd(void *const *buffer, int size, int fd);
+    size_t backtrace(void **buffer, size_t size);
+    char **backtrace_symbols(void *const *buffer, size_t size);
+    void backtrace_symbols_fd(void *const *buffer, size_t size, int fd);
     """
 )  # noqa
 _api = _ffi.verify(
@@ -30,7 +30,7 @@ _api = _ffi.verify(
     #include <stdlib.h>
     #include <execinfo.h>
     """,
-    libraries=["crypto"],
+    libraries=["crypto", "execinfo"] if sys.platform.startswith('netbsd') else ["crypto"],
 )
 C = _ffi.dlopen(None)