update to py-M2Crypto-0.38.0, tweak/ok tb@

This commit is contained in:
sthen 2021-07-24 20:02:04 +00:00
parent 66ff0692ae
commit 6637f64866
12 changed files with 54 additions and 69 deletions

View File

@ -1,8 +1,8 @@
# $OpenBSD: Makefile,v 1.31 2021/05/03 11:47:33 jasper Exp $
# $OpenBSD: Makefile,v 1.32 2021/07/24 20:02:04 sthen Exp $
COMMENT = crypto and ssl toolkit for python
MODPY_EGG_VERSION = 0.37.1
MODPY_EGG_VERSION = 0.38.0
DISTNAME = M2Crypto-${MODPY_EGG_VERSION}
PKGNAME = py-${DISTNAME}
@ -27,4 +27,6 @@ MAKE_ENV = SWIG_FEATURES=-I/usr/include
BUILD_DEPENDS = devel/swig
# XXX tests need "parameterized", dep was added in 0.37.0
.include <bsd.port.mk>

View File

@ -1,2 +1,2 @@
SHA256 (M2Crypto-0.37.1.tar.gz) = 5OQvBot4zL8RPl0Kcq5fSA9sOs5JQLkeT/9VmM//b7M=
SIZE (M2Crypto-0.37.1.tar.gz) = 1247031
SHA256 (M2Crypto-0.38.0.tar.gz) = mfImCjCQHJSajcbV+CzVMS/7iryS52YzuvIxu7yy3ss=
SIZE (M2Crypto-0.38.0.tar.gz) = 1241269

View File

@ -1,34 +0,0 @@
$OpenBSD: patch-SWIG__bio_i,v 1.4 2018/04/25 16:51:05 jasper Exp $
BIO_meth_new() and BIO_meth_free() are non-static in LibreSSL
Index: SWIG/_bio.i
--- SWIG/_bio.i.orig
+++ SWIG/_bio.i
@@ -293,8 +293,12 @@ int bio_should_write(BIO* a) {
}
/* Macros for things not defined before 1.1.0 */
-#if OPENSSL_VERSION_NUMBER < 0x10100000L
-static BIO_METHOD *
+#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
+
+#if !defined(LIBRESSL_VERSION_NUMBER)
+static
+#endif
+BIO_METHOD *
BIO_meth_new( int type, const char *name )
{
BIO_METHOD *method = malloc( sizeof(BIO_METHOD) );
@@ -306,7 +310,10 @@ BIO_meth_new( int type, const char *name )
return method;
}
-static void
+#if !defined(LIBRESSL_VERSION_NUMBER)
+static
+#endif
+void
BIO_meth_free( BIO_METHOD *meth )
{
if ( meth == NULL ) {

View File

@ -1,4 +1,4 @@
$OpenBSD: patch-M2Crypto_BIO_py,v 1.2 2018/04/25 16:49:20 jasper Exp $
$OpenBSD: patch-src_M2Crypto_BIO_py,v 1.1 2021/07/24 20:02:04 sthen Exp $
Partially revert https://gitlab.com/m2crypto/m2crypto/commit/738cd0bf3dc2ee619f598290d5bf4c2190987f16:
@ -19,9 +19,9 @@ IOError: [Errno 9] Bad file descriptor
https://gitlab.com/m2crypto/m2crypto/issues/211
Index: M2Crypto/BIO.py
--- M2Crypto/BIO.py.orig
+++ M2Crypto/BIO.py
Index: src/M2Crypto/BIO.py
--- src/M2Crypto/BIO.py.orig
+++ src/M2Crypto/BIO.py
@@ -235,8 +235,9 @@ class File(BIO):
#
# https://docs.python.org/3.3/c-api/file.html

View File

@ -0,0 +1,17 @@
$OpenBSD: patch-src_SWIG__bio_i,v 1.1 2021/07/24 20:02:04 sthen Exp $
LibreSSL doesn't have BIO_get_init()
Index: src/SWIG/_bio.i
--- src/SWIG/_bio.i.orig
+++ src/SWIG/_bio.i
@@ -330,6 +330,9 @@ BIO_meth_free( BIO_METHOD *meth )
#define BIO_clear_flags(b, x) b->flags &= ~(x)
#define BIO_get_data(b) b->ptr
#endif
+#if defined(LIBRESSL_VERSION_NUMBER)
+#define BIO_get_init(b) (b)->init
+#endif
/* implment custom BIO_s_pyfd */

View File

@ -1,10 +1,10 @@
$OpenBSD: patch-SWIG__evp_i,v 1.1 2017/10/09 05:57:38 ajacoutot Exp $
$OpenBSD: patch-src_SWIG__evp_i,v 1.1 2021/07/24 20:02:04 sthen Exp $
Fix build with LibreSSL
Index: SWIG/_evp.i
--- SWIG/_evp.i.orig
+++ SWIG/_evp.i
Index: src/SWIG/_evp.i
--- src/SWIG/_evp.i.orig
+++ src/SWIG/_evp.i
@@ -19,7 +19,7 @@ Copyright (c) 2009-2010 Heikki Toivonen. All rights re
#include <openssl/rsa.h>
#include <openssl/opensslv.h>

View File

@ -1,10 +1,10 @@
$OpenBSD: patch-SWIG__lib11_compat_i,v 1.1 2017/10/09 05:57:38 ajacoutot Exp $
$OpenBSD: patch-src_SWIG__lib11_compat_i,v 1.1 2021/07/24 20:02:04 sthen Exp $
Fix build with LibreSSL
Index: SWIG/_lib11_compat.i
--- SWIG/_lib11_compat.i.orig
+++ SWIG/_lib11_compat.i
Index: src/SWIG/_lib11_compat.i
--- src/SWIG/_lib11_compat.i.orig
+++ src/SWIG/_lib11_compat.i
@@ -8,7 +8,7 @@
*/

View File

@ -1,10 +1,10 @@
$OpenBSD: patch-SWIG__lib_i,v 1.5 2021/05/03 11:47:34 jasper Exp $
$OpenBSD: patch-src_SWIG__lib_i,v 1.1 2021/07/24 20:02:04 sthen Exp $
Fix build with LibreSSL
Index: SWIG/_lib.i
--- SWIG/_lib.i.orig
+++ SWIG/_lib.i
Index: src/SWIG/_lib.i
--- src/SWIG/_lib.i.orig
+++ src/SWIG/_lib.i
@@ -21,7 +21,7 @@
%{
@ -14,7 +14,7 @@ Index: SWIG/_lib.i
typedef void (*OPENSSL_sk_freefunc)(void *);
typedef void *(*OPENSSL_sk_copyfunc)(const void *);
typedef struct stack_st OPENSSL_STACK;
@@ -536,7 +536,7 @@ int passphrase_callback(char *buf, int num, int v, voi
@@ -532,7 +532,7 @@ int passphrase_callback(char *buf, int num, int v, voi
%inline %{
void lib_init() {

View File

@ -1,10 +1,10 @@
$OpenBSD: patch-SWIG__ssl_i,v 1.10 2020/07/17 17:47:30 jasper Exp $
$OpenBSD: patch-src_SWIG__ssl_i,v 1.1 2021/07/24 20:02:04 sthen Exp $
Fix build with LibreSSL
Index: SWIG/_ssl.i
--- SWIG/_ssl.i.orig
+++ SWIG/_ssl.i
Index: src/SWIG/_ssl.i
--- src/SWIG/_ssl.i.orig
+++ src/SWIG/_ssl.i
@@ -265,7 +265,7 @@ void ssl_init(PyObject *ssl_err, PyObject *ssl_timeout
}

View File

@ -1,10 +1,10 @@
$OpenBSD: patch-SWIG__threads_i,v 1.1 2017/10/09 05:57:38 ajacoutot Exp $
$OpenBSD: patch-src_SWIG__threads_i,v 1.1 2021/07/24 20:02:04 sthen Exp $
Fix build with LibreSSL
Index: SWIG/_threads.i
--- SWIG/_threads.i.orig
+++ SWIG/_threads.i
Index: src/SWIG/_threads.i
--- src/SWIG/_threads.i.orig
+++ src/SWIG/_threads.i
@@ -5,7 +5,7 @@
#include <pythread.h>
#include <openssl/crypto.h>

View File

@ -1,10 +1,10 @@
$OpenBSD: patch-SWIG_libcrypto-compat_h,v 1.1 2017/10/09 05:57:38 ajacoutot Exp $
$OpenBSD: patch-src_SWIG_libcrypto-compat_h,v 1.1 2021/07/24 20:02:04 sthen Exp $
Fix build with LibreSSL
Index: SWIG/libcrypto-compat.h
--- SWIG/libcrypto-compat.h.orig
+++ SWIG/libcrypto-compat.h
Index: src/SWIG/libcrypto-compat.h
--- src/SWIG/libcrypto-compat.h.orig
+++ src/SWIG/libcrypto-compat.h
@@ -1,7 +1,7 @@
#ifndef LIBCRYPTO_COMPAT_H
#define LIBCRYPTO_COMPAT_H

View File

@ -1,11 +1,11 @@
@comment $OpenBSD: PLIST,v 1.10 2021/05/03 11:47:34 jasper Exp $
@comment $OpenBSD: PLIST,v 1.11 2021/07/24 20:02:04 sthen Exp $
@pkgpath security/py-M2Crypto
lib/python${MODPY_VERSION}/site-packages/M2Crypto/
lib/python${MODPY_VERSION}/site-packages/M2Crypto-${MODPY_EGG_VERSION}-py${MODPY_VERSION}.egg-info/
lib/python${MODPY_VERSION}/site-packages/M2Crypto-${MODPY_EGG_VERSION}-py${MODPY_VERSION}.egg-info/PKG-INFO
lib/python${MODPY_VERSION}/site-packages/M2Crypto-${MODPY_EGG_VERSION}-py${MODPY_VERSION}.egg-info/SOURCES.txt
lib/python${MODPY_VERSION}/site-packages/M2Crypto-${MODPY_EGG_VERSION}-py${MODPY_VERSION}.egg-info/dependency_links.txt
lib/python${MODPY_VERSION}/site-packages/M2Crypto-${MODPY_EGG_VERSION}-py${MODPY_VERSION}.egg-info/requires.txt
lib/python${MODPY_VERSION}/site-packages/M2Crypto-${MODPY_EGG_VERSION}-py${MODPY_VERSION}.egg-info/not-zip-safe
lib/python${MODPY_VERSION}/site-packages/M2Crypto-${MODPY_EGG_VERSION}-py${MODPY_VERSION}.egg-info/top_level.txt
lib/python${MODPY_VERSION}/site-packages/M2Crypto/ASN1.py
lib/python${MODPY_VERSION}/site-packages/M2Crypto/AuthCookie.py