From 0e72ce7ddc613aead7e6c157f6832d8e5dd0ddca Mon Sep 17 00:00:00 2001 From: Michal Vasilek Date: Thu, 6 Jan 2022 16:54:55 +0100 Subject: [PATCH] python3-M2Crypto: update to 0.38.0. * remove python2 version * enable tests --- .../python-M2Crypto/patches/libressl.patch | 140 ------------------ srcpkgs/python-M2Crypto/template | 29 ---- srcpkgs/python3-M2Crypto | 1 - srcpkgs/python3-M2Crypto/template | 20 +++ .../update | 0 5 files changed, 20 insertions(+), 170 deletions(-) delete mode 100644 srcpkgs/python-M2Crypto/patches/libressl.patch delete mode 100644 srcpkgs/python-M2Crypto/template delete mode 120000 srcpkgs/python3-M2Crypto create mode 100644 srcpkgs/python3-M2Crypto/template rename srcpkgs/{python-M2Crypto => python3-M2Crypto}/update (100%) diff --git a/srcpkgs/python-M2Crypto/patches/libressl.patch b/srcpkgs/python-M2Crypto/patches/libressl.patch deleted file mode 100644 index ee2a24ad9f..0000000000 --- a/srcpkgs/python-M2Crypto/patches/libressl.patch +++ /dev/null @@ -1,140 +0,0 @@ ---- a/SWIG/_bio.i -+++ b/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 ) { ---- a/SWIG/_evp.i -+++ b/SWIG/_evp.i -@@ -19,7 +19,7 @@ Copyright (c) 2009-2010 Heikki Toivonen. All rights re - #include - #include - --#if OPENSSL_VERSION_NUMBER < 0x10100000L -+#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER) - - HMAC_CTX *HMAC_CTX_new(void) { - HMAC_CTX *ret = PyMem_Malloc(sizeof(HMAC_CTX)); ---- a/SWIG/_lib11_compat.i -+++ b/SWIG/_lib11_compat.i -@@ -8,7 +8,7 @@ - */ - - %{ --#if OPENSSL_VERSION_NUMBER < 0x10100000L -+#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER) - - #include - #include ---- a/SWIG/_lib.i -+++ b/SWIG/_lib.i -@@ -21,7 +21,7 @@ - - %{ - /* OpenSSL 1.0.2 copmatbility shim */ --#if OPENSSL_VERSION_NUMBER < 0x10002000L -+#if OPENSSL_VERSION_NUMBER < 0x10002000L || defined(LIBRESSL_VERSION_NUMBER) - typedef void (*OPENSSL_sk_freefunc)(void *); - typedef void *(*OPENSSL_sk_copyfunc)(const void *); - typedef struct stack_st OPENSSL_STACK; -@@ -499,7 +499,7 @@ int passphrase_callback(char *buf, int num, int v, voi - %inline %{ - - void lib_init() { --#if OPENSSL_VERSION_NUMBER < 0x10100000L -+#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER) - SSLeay_add_all_algorithms(); - ERR_load_ERR_strings(); - #endif ---- a/SWIG/_ssl.i -+++ b/SWIG/_ssl.i -@@ -275,7 +275,7 @@ const SSL_METHOD *sslv3_method(void) { - #endif - - const SSL_METHOD *tlsv1_method(void) { --#if OPENSSL_VERSION_NUMBER >= 0x10100000L -+#if OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER) - PyErr_WarnEx(PyExc_DeprecationWarning, - "Function TLSv1_method has been deprecated.", 1); - #endif ---- a/SWIG/_threads.i -+++ b/SWIG/_threads.i -@@ -5,7 +5,7 @@ - #include - #include - --#if defined(THREADING) && OPENSSL_VERSION_NUMBER < 0x10100000L -+#if defined(THREADING) && OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER) - #define CRYPTO_num_locks() (CRYPTO_NUM_LOCKS) - static PyThread_type_lock lock_cs[CRYPTO_num_locks()]; - static long lock_count[CRYPTO_num_locks()]; -@@ -13,7 +13,7 @@ static int thread_mode = 0; - #endif - - void threading_locking_callback(int mode, int type, const char *file, int line) { --#if defined(THREADING) && OPENSSL_VERSION_NUMBER < 0x10100000L -+#if defined(THREADING) && OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER) - if (mode & CRYPTO_LOCK) { - PyThread_acquire_lock(lock_cs[type], WAIT_LOCK); - lock_count[type]++; -@@ -25,7 +25,7 @@ void threading_locking_callback(int mode, int type, co - } - - unsigned long threading_id_callback(void) { --#if defined(THREADING) && OPENSSL_VERSION_NUMBER < 0x10100000L -+#if defined(THREADING) && OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER) - return (unsigned long)PyThread_get_thread_ident(); - #else - return (unsigned long)0; -@@ -35,7 +35,7 @@ unsigned long threading_id_callback(void) { - - %inline %{ - void threading_init(void) { --#if defined(THREADING) && OPENSSL_VERSION_NUMBER < 0x10100000L -+#if defined(THREADING) && OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER) - int i; - if (!thread_mode) { - for (i=0; i - #include diff --git a/srcpkgs/python-M2Crypto/template b/srcpkgs/python-M2Crypto/template deleted file mode 100644 index 55f5130596..0000000000 --- a/srcpkgs/python-M2Crypto/template +++ /dev/null @@ -1,29 +0,0 @@ -# Template file for 'python-M2Crypto' -pkgname=python-M2Crypto -version=0.35.2 -revision=7 -wrksrc="M2Crypto-${version}" -build_style=python-module -pycompile_module="M2Crypto" -hostmakedepends="python-setuptools python3-setuptools swig openssl-devel" -makedepends="openssl-devel python-devel python3-devel" -depends="python-typing" -short_desc="Python2 crypto and SSL toolkit" -maintainer="Orphaned " -license="MIT" -homepage="https://gitlab.com/m2crypto/m2crypto/" -distfiles="${PYPI_SITE}/M/M2Crypto/M2Crypto-${version}.tar.gz" -checksum=4c6ad45ffb88670c590233683074f2440d96aaccb05b831371869fc387cbd127 - -post_install() { - vlicense LICENCE -} - -python3-M2Crypto_package() { - pycompile_module="M2Crypto" - short_desc="${short_desc/Python2/Python3}" - pkg_install() { - vmove usr/lib/python3* - vlicense LICENCE - } -} diff --git a/srcpkgs/python3-M2Crypto b/srcpkgs/python3-M2Crypto deleted file mode 120000 index b9eea2597a..0000000000 --- a/srcpkgs/python3-M2Crypto +++ /dev/null @@ -1 +0,0 @@ -python-M2Crypto \ No newline at end of file diff --git a/srcpkgs/python3-M2Crypto/template b/srcpkgs/python3-M2Crypto/template new file mode 100644 index 0000000000..999ec2d7cf --- /dev/null +++ b/srcpkgs/python3-M2Crypto/template @@ -0,0 +1,20 @@ +# Template file for 'python3-M2Crypto' +pkgname=python3-M2Crypto +version=0.38.0 +revision=1 +wrksrc="M2Crypto-${version}" +build_style=python3-module +hostmakedepends="python3-setuptools swig openssl-devel" +makedepends="openssl-devel python3-devel" +depends="python3" +checkdepends="ca-certificates python3-pytest python3-parameterized" +short_desc="Python crypto and SSL toolkit" +maintainer="Orphaned " +license="MIT" +homepage="https://gitlab.com/m2crypto/m2crypto/" +distfiles="${PYPI_SITE}/M/M2Crypto/M2Crypto-${version}.tar.gz" +checksum=99f2260a30901c949a8dc6d5f82cd5312ffb8abc92e76633baf231bbbcb2decb + +post_install() { + vlicense LICENCE +} diff --git a/srcpkgs/python-M2Crypto/update b/srcpkgs/python3-M2Crypto/update similarity index 100% rename from srcpkgs/python-M2Crypto/update rename to srcpkgs/python3-M2Crypto/update