Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] crda: add a patch for python3
@ 2022-01-06 17:54 paper42
  2022-01-06 18:01 ` [PR PATCH] [Updated] " paper42
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: paper42 @ 2022-01-06 17:54 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1214 bytes --]

There is a new pull request by paper42 against master on the void-packages repository

https://github.com/paper42/void-packages crda-py3
https://github.com/void-linux/void-packages/pull/34908

crda: add a patch for python3
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **NO**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!-- 
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/34908.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-crda-py3-34908.patch --]
[-- Type: text/x-diff, Size: 13536 bytes --]

From afb453478bf41437056b69ac3948ec346d0aef9a Mon Sep 17 00:00:00 2001
From: Michal Vasilek <michal@vasilek.cz>
Date: Thu, 6 Jan 2022 16:55:15 +0100
Subject: [PATCH 1/3] crda: add a patch for python3

---
 srcpkgs/crda/patches/python3.patch | 96 ++++++++++++++++++++++++++++++
 srcpkgs/crda/template              |  4 +-
 2 files changed, 98 insertions(+), 2 deletions(-)
 create mode 100644 srcpkgs/crda/patches/python3.patch

diff --git a/srcpkgs/crda/patches/python3.patch b/srcpkgs/crda/patches/python3.patch
new file mode 100644
index 000000000000..986acbfbcc24
--- /dev/null
+++ b/srcpkgs/crda/patches/python3.patch
@@ -0,0 +1,96 @@
+https://raw.githubusercontent.com/archlinux/svntogit-packages/packages/crda/trunk/crda-4.14-python-3.patch
+diff --git a/utils/key2pub.py b/utils/key2pub.py
+index 9bb04cd..632e6a6 100755
+--- a/utils/key2pub.py
++++ b/utils/key2pub.py
+@@ -3,20 +3,20 @@
+ import sys
+ try:
+        from M2Crypto import RSA
+-except ImportError, e:
++except ImportError as e:
+        sys.stderr.write('ERROR: Failed to import the "M2Crypto" module: %s\n' % e.message)
+        sys.stderr.write('Please install the "M2Crypto" Python module.\n')
+        sys.stderr.write('On Debian GNU/Linux the package is called "python-m2crypto".\n')
+        sys.exit(1)
+ 
+ def print_ssl_64(output, name, val):
+-    while val[0] == '\0':
++    while val[0:1] == b'\0':
+         val = val[1:]
+     while len(val) % 8:
+-        val = '\0' + val
++        val = b'\0' + val
+     vnew = []
+     while len(val):
+-        vnew.append((val[0], val[1], val[2], val[3], val[4], val[5], val[6], val[7]))
++        vnew.append((val[0:1], val[1:2], val[2:3], val[3:4], val[4:5], val[5:6], val[6:7], val[7:8]))
+         val = val[8:]
+     vnew.reverse()
+     output.write('static BN_ULONG %s[%d] = {\n' % (name, len(vnew)))
+@@ -34,13 +34,13 @@ def print_ssl_64(output, name, val):
+     output.write('};\n\n')
+ 
+ def print_ssl_32(output, name, val):
+-    while val[0] == '\0':
++    while val[0:1] == b'\0':
+         val = val[1:]
+     while len(val) % 4:
+-        val = '\0' + val
++        val = b'\0' + val
+     vnew = []
+     while len(val):
+-        vnew.append((val[0], val[1], val[2], val[3], ))
++        vnew.append((val[0:1], val[1:2], val[2:3], val[3:4]))
+         val = val[4:]
+     vnew.reverse()
+     output.write('static BN_ULONG %s[%d] = {\n' % (name, len(vnew)))
+@@ -80,21 +80,21 @@ struct pubkey {
+ 
+ static struct pubkey keys[] = {
+ ''')
+-    for n in xrange(n + 1):
++    for n in range(n + 1):
+         output.write('	KEYS(e_%d, n_%d),\n' % (n, n))
+     output.write('};\n')
+     pass
+ 
+ def print_gcrypt(output, name, val):
+     output.write('#include <stdint.h>\n')
+-    while val[0] == '\0':
++    while val[0:1] == b'\0':
+         val = val[1:]
+     output.write('static const uint8_t %s[%d] = {\n' % (name, len(val)))
+     idx = 0
+     for v in val:
+         if not idx:
+             output.write('\t')
+-        output.write('0x%.2x, ' % ord(v))
++        output.write('0x%.2x, ' % (v if sys.version_info[0] >=3 else ord(v)))
+         idx += 1
+         if idx == 8:
+             idx = 0
+@@ -117,7 +117,7 @@ struct key_params {
+ 
+ static const struct key_params __attribute__ ((unused)) keys[] = {
+ ''')
+-    for n in xrange(n + 1):
++    for n in range(n + 1):
+         output.write('	KEYS(e_%d, n_%d),\n' % (n, n))
+     output.write('};\n')
+     
+@@ -135,7 +135,7 @@ except IndexError:
+     mode = None
+ 
+ if not mode in modes:
+-    print 'Usage: %s [%s] input-file... output-file' % (sys.argv[0], '|'.join(modes.keys()))
++    print('Usage: %s [%s] input-file... output-file' % (sys.argv[0], '|'.join(modes.keys())))
+     sys.exit(2)
+ 
+ output = open(outfile, 'w')
+@@ -153,3 +153,5 @@ for f in files:
+     idx += 1
+ 
+ modes[mode][1](output, idx - 1)
++
++output.close()
diff --git a/srcpkgs/crda/template b/srcpkgs/crda/template
index e8082064f764..4c5183f23c64 100644
--- a/srcpkgs/crda/template
+++ b/srcpkgs/crda/template
@@ -1,11 +1,11 @@
 # Template file for 'crda'
 pkgname=crda
 version=4.14
-revision=1
+revision=2
 _dbname=wireless-regdb
 _dbversion=2020.11.20
 _dbsrc="${XBPS_BUILDDIR}/${_dbname}-${_dbversion}/"
-hostmakedepends="openssl python python-M2Crypto pkg-config"
+hostmakedepends="openssl python3-M2Crypto pkg-config"
 makedepends="libnl-devel libgcrypt-devel"
 depends="iw"
 short_desc="Central Regulatory Domain Agent for wireless networks"

From f8445e1143965ca0a7b24e3ef6699d98a7c5ff74 Mon Sep 17 00:00:00 2001
From: Michal Vasilek <michal@vasilek.cz>
Date: Thu, 6 Jan 2022 16:54:55 +0100
Subject: [PATCH 2/3] python-M2Crypto: drop package

---
 .../python-M2Crypto/patches/libressl.patch    | 140 ------------------
 srcpkgs/python-M2Crypto/template              |  29 ----
 srcpkgs/python3-M2Crypto                      |   1 -
 srcpkgs/python3-M2Crypto/template             |  19 +++
 .../update                                    |   0
 5 files changed, 19 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 ee2a24ad9f4a..000000000000
--- 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 <openssl/rsa.h>
- #include <openssl/opensslv.h>
- 
--#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 <string.h>
- #include <openssl/engine.h>
---- 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 <pythread.h>
- #include <openssl/crypto.h>
- 
--#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<CRYPTO_num_locks(); i++) {
-@@ -50,7 +50,7 @@ void threading_init(void) {
- }
- 
- void threading_cleanup(void) {
--#if defined(THREADING) && OPENSSL_VERSION_NUMBER < 0x10100000L
-+#if defined(THREADING) && OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
-     int i;
-     if (thread_mode) {
-         CRYPTO_set_locking_callback(NULL);
---- a/SWIG/libcrypto-compat.h
-+++ b/SWIG/libcrypto-compat.h
-@@ -1,7 +1,7 @@
- #ifndef LIBCRYPTO_COMPAT_H
- #define LIBCRYPTO_COMPAT_H
- 
--#if OPENSSL_VERSION_NUMBER < 0x10100000L
-+#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
- 
- #include <openssl/rsa.h>
- #include <openssl/dsa.h>
diff --git a/srcpkgs/python-M2Crypto/template b/srcpkgs/python-M2Crypto/template
deleted file mode 100644
index 55f5130596a4..000000000000
--- 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 <orphan@voidlinux.org>"
-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 b9eea2597a68..000000000000
--- 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 000000000000..6295403b85d5
--- /dev/null
+++ b/srcpkgs/python3-M2Crypto/template
@@ -0,0 +1,19 @@
+# Template file for 'python3-M2Crypto'
+pkgname=python3-M2Crypto
+version=0.35.2
+revision=7
+wrksrc="M2Crypto-${version}"
+build_style=python3-module
+hostmakedepends="python3-setuptools swig openssl-devel"
+makedepends="openssl-devel python3-devel"
+depends="python3-typing"
+short_desc="Python crypto and SSL toolkit"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="MIT"
+homepage="https://gitlab.com/m2crypto/m2crypto/"
+distfiles="${PYPI_SITE}/M/M2Crypto/M2Crypto-${version}.tar.gz"
+checksum=4c6ad45ffb88670c590233683074f2440d96aaccb05b831371869fc387cbd127
+
+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

From 861c9edb18c51dc89f7ed45ef83468e96c132672 Mon Sep 17 00:00:00 2001
From: Michal Vasilek <michal@vasilek.cz>
Date: Thu, 6 Jan 2022 18:52:12 +0100
Subject: [PATCH 3/3] removed-packages: add python-M2Crypto

---
 srcpkgs/removed-packages/template | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/srcpkgs/removed-packages/template b/srcpkgs/removed-packages/template
index 4bab6419b983..7af3e5ccf88a 100644
--- a/srcpkgs/removed-packages/template
+++ b/srcpkgs/removed-packages/template
@@ -1,7 +1,7 @@
 # Template file for 'removed-packages'
 pkgname=removed-packages
 version=0.1
-revision=56
+revision=57
 build_style=meta
 short_desc="Uninstalls packages removed from repository"
 maintainer="Piotr Wójcik <chocimier@tlen.pl>"
@@ -251,6 +251,7 @@ replaces="
  psiconv<=0.9.9_9
  ptii<=0.4_2
  pyside-tools<=0.2.15_2
+ python-M2Crypto<=0.35.2_7
  python-PyQt4<=4.12.1_4
  python-SecretStorage<=2.3.1_4
  python-audit<=2.8.5_2

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PR PATCH] [Updated] crda: add a patch for python3
  2022-01-06 17:54 [PR PATCH] crda: add a patch for python3 paper42
@ 2022-01-06 18:01 ` paper42
  2022-01-06 19:26 ` paper42
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: paper42 @ 2022-01-06 18:01 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1219 bytes --]

There is an updated pull request by paper42 against master on the void-packages repository

https://github.com/paper42/void-packages crda-py3
https://github.com/void-linux/void-packages/pull/34908

crda: add a patch for python3
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **NO**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!-- 
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/34908.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-crda-py3-34908.patch --]
[-- Type: text/x-diff, Size: 13510 bytes --]

From afb453478bf41437056b69ac3948ec346d0aef9a Mon Sep 17 00:00:00 2001
From: Michal Vasilek <michal@vasilek.cz>
Date: Thu, 6 Jan 2022 16:55:15 +0100
Subject: [PATCH 1/3] crda: add a patch for python3

---
 srcpkgs/crda/patches/python3.patch | 96 ++++++++++++++++++++++++++++++
 srcpkgs/crda/template              |  4 +-
 2 files changed, 98 insertions(+), 2 deletions(-)
 create mode 100644 srcpkgs/crda/patches/python3.patch

diff --git a/srcpkgs/crda/patches/python3.patch b/srcpkgs/crda/patches/python3.patch
new file mode 100644
index 000000000000..986acbfbcc24
--- /dev/null
+++ b/srcpkgs/crda/patches/python3.patch
@@ -0,0 +1,96 @@
+https://raw.githubusercontent.com/archlinux/svntogit-packages/packages/crda/trunk/crda-4.14-python-3.patch
+diff --git a/utils/key2pub.py b/utils/key2pub.py
+index 9bb04cd..632e6a6 100755
+--- a/utils/key2pub.py
++++ b/utils/key2pub.py
+@@ -3,20 +3,20 @@
+ import sys
+ try:
+        from M2Crypto import RSA
+-except ImportError, e:
++except ImportError as e:
+        sys.stderr.write('ERROR: Failed to import the "M2Crypto" module: %s\n' % e.message)
+        sys.stderr.write('Please install the "M2Crypto" Python module.\n')
+        sys.stderr.write('On Debian GNU/Linux the package is called "python-m2crypto".\n')
+        sys.exit(1)
+ 
+ def print_ssl_64(output, name, val):
+-    while val[0] == '\0':
++    while val[0:1] == b'\0':
+         val = val[1:]
+     while len(val) % 8:
+-        val = '\0' + val
++        val = b'\0' + val
+     vnew = []
+     while len(val):
+-        vnew.append((val[0], val[1], val[2], val[3], val[4], val[5], val[6], val[7]))
++        vnew.append((val[0:1], val[1:2], val[2:3], val[3:4], val[4:5], val[5:6], val[6:7], val[7:8]))
+         val = val[8:]
+     vnew.reverse()
+     output.write('static BN_ULONG %s[%d] = {\n' % (name, len(vnew)))
+@@ -34,13 +34,13 @@ def print_ssl_64(output, name, val):
+     output.write('};\n\n')
+ 
+ def print_ssl_32(output, name, val):
+-    while val[0] == '\0':
++    while val[0:1] == b'\0':
+         val = val[1:]
+     while len(val) % 4:
+-        val = '\0' + val
++        val = b'\0' + val
+     vnew = []
+     while len(val):
+-        vnew.append((val[0], val[1], val[2], val[3], ))
++        vnew.append((val[0:1], val[1:2], val[2:3], val[3:4]))
+         val = val[4:]
+     vnew.reverse()
+     output.write('static BN_ULONG %s[%d] = {\n' % (name, len(vnew)))
+@@ -80,21 +80,21 @@ struct pubkey {
+ 
+ static struct pubkey keys[] = {
+ ''')
+-    for n in xrange(n + 1):
++    for n in range(n + 1):
+         output.write('	KEYS(e_%d, n_%d),\n' % (n, n))
+     output.write('};\n')
+     pass
+ 
+ def print_gcrypt(output, name, val):
+     output.write('#include <stdint.h>\n')
+-    while val[0] == '\0':
++    while val[0:1] == b'\0':
+         val = val[1:]
+     output.write('static const uint8_t %s[%d] = {\n' % (name, len(val)))
+     idx = 0
+     for v in val:
+         if not idx:
+             output.write('\t')
+-        output.write('0x%.2x, ' % ord(v))
++        output.write('0x%.2x, ' % (v if sys.version_info[0] >=3 else ord(v)))
+         idx += 1
+         if idx == 8:
+             idx = 0
+@@ -117,7 +117,7 @@ struct key_params {
+ 
+ static const struct key_params __attribute__ ((unused)) keys[] = {
+ ''')
+-    for n in xrange(n + 1):
++    for n in range(n + 1):
+         output.write('	KEYS(e_%d, n_%d),\n' % (n, n))
+     output.write('};\n')
+     
+@@ -135,7 +135,7 @@ except IndexError:
+     mode = None
+ 
+ if not mode in modes:
+-    print 'Usage: %s [%s] input-file... output-file' % (sys.argv[0], '|'.join(modes.keys()))
++    print('Usage: %s [%s] input-file... output-file' % (sys.argv[0], '|'.join(modes.keys())))
+     sys.exit(2)
+ 
+ output = open(outfile, 'w')
+@@ -153,3 +153,5 @@ for f in files:
+     idx += 1
+ 
+ modes[mode][1](output, idx - 1)
++
++output.close()
diff --git a/srcpkgs/crda/template b/srcpkgs/crda/template
index e8082064f764..4c5183f23c64 100644
--- a/srcpkgs/crda/template
+++ b/srcpkgs/crda/template
@@ -1,11 +1,11 @@
 # Template file for 'crda'
 pkgname=crda
 version=4.14
-revision=1
+revision=2
 _dbname=wireless-regdb
 _dbversion=2020.11.20
 _dbsrc="${XBPS_BUILDDIR}/${_dbname}-${_dbversion}/"
-hostmakedepends="openssl python python-M2Crypto pkg-config"
+hostmakedepends="openssl python3-M2Crypto pkg-config"
 makedepends="libnl-devel libgcrypt-devel"
 depends="iw"
 short_desc="Central Regulatory Domain Agent for wireless networks"

From c439f68ffaed26307a91c7f480aacc733d9a5f4c Mon Sep 17 00:00:00 2001
From: Michal Vasilek <michal@vasilek.cz>
Date: Thu, 6 Jan 2022 16:54:55 +0100
Subject: [PATCH 2/3] python-M2Crypto: drop package

---
 .../python-M2Crypto/patches/libressl.patch    | 140 ------------------
 srcpkgs/python-M2Crypto/template              |  29 ----
 srcpkgs/python3-M2Crypto                      |   1 -
 srcpkgs/python3-M2Crypto/template             |  18 +++
 .../update                                    |   0
 5 files changed, 18 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 ee2a24ad9f4a..000000000000
--- 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 <openssl/rsa.h>
- #include <openssl/opensslv.h>
- 
--#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 <string.h>
- #include <openssl/engine.h>
---- 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 <pythread.h>
- #include <openssl/crypto.h>
- 
--#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<CRYPTO_num_locks(); i++) {
-@@ -50,7 +50,7 @@ void threading_init(void) {
- }
- 
- void threading_cleanup(void) {
--#if defined(THREADING) && OPENSSL_VERSION_NUMBER < 0x10100000L
-+#if defined(THREADING) && OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
-     int i;
-     if (thread_mode) {
-         CRYPTO_set_locking_callback(NULL);
---- a/SWIG/libcrypto-compat.h
-+++ b/SWIG/libcrypto-compat.h
-@@ -1,7 +1,7 @@
- #ifndef LIBCRYPTO_COMPAT_H
- #define LIBCRYPTO_COMPAT_H
- 
--#if OPENSSL_VERSION_NUMBER < 0x10100000L
-+#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
- 
- #include <openssl/rsa.h>
- #include <openssl/dsa.h>
diff --git a/srcpkgs/python-M2Crypto/template b/srcpkgs/python-M2Crypto/template
deleted file mode 100644
index 55f5130596a4..000000000000
--- 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 <orphan@voidlinux.org>"
-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 b9eea2597a68..000000000000
--- 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 000000000000..72ecae00ee6d
--- /dev/null
+++ b/srcpkgs/python3-M2Crypto/template
@@ -0,0 +1,18 @@
+# Template file for 'python3-M2Crypto'
+pkgname=python3-M2Crypto
+version=0.35.2
+revision=7
+wrksrc="M2Crypto-${version}"
+build_style=python3-module
+hostmakedepends="python3-setuptools swig openssl-devel"
+makedepends="openssl-devel python3-devel"
+short_desc="Python crypto and SSL toolkit"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="MIT"
+homepage="https://gitlab.com/m2crypto/m2crypto/"
+distfiles="${PYPI_SITE}/M/M2Crypto/M2Crypto-${version}.tar.gz"
+checksum=4c6ad45ffb88670c590233683074f2440d96aaccb05b831371869fc387cbd127
+
+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

From bc64e4fb02b143bcb383e1538e881bfa57cc1d4b Mon Sep 17 00:00:00 2001
From: Michal Vasilek <michal@vasilek.cz>
Date: Thu, 6 Jan 2022 18:52:12 +0100
Subject: [PATCH 3/3] removed-packages: add python-M2Crypto

---
 srcpkgs/removed-packages/template | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/srcpkgs/removed-packages/template b/srcpkgs/removed-packages/template
index 4bab6419b983..7af3e5ccf88a 100644
--- a/srcpkgs/removed-packages/template
+++ b/srcpkgs/removed-packages/template
@@ -1,7 +1,7 @@
 # Template file for 'removed-packages'
 pkgname=removed-packages
 version=0.1
-revision=56
+revision=57
 build_style=meta
 short_desc="Uninstalls packages removed from repository"
 maintainer="Piotr Wójcik <chocimier@tlen.pl>"
@@ -251,6 +251,7 @@ replaces="
  psiconv<=0.9.9_9
  ptii<=0.4_2
  pyside-tools<=0.2.15_2
+ python-M2Crypto<=0.35.2_7
  python-PyQt4<=4.12.1_4
  python-SecretStorage<=2.3.1_4
  python-audit<=2.8.5_2

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PR PATCH] [Updated] crda: add a patch for python3
  2022-01-06 17:54 [PR PATCH] crda: add a patch for python3 paper42
  2022-01-06 18:01 ` [PR PATCH] [Updated] " paper42
@ 2022-01-06 19:26 ` paper42
  2022-01-06 19:34 ` paper42
  2022-01-06 19:35 ` [PR PATCH] [Merged]: " paper42
  3 siblings, 0 replies; 5+ messages in thread
From: paper42 @ 2022-01-06 19:26 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1219 bytes --]

There is an updated pull request by paper42 against master on the void-packages repository

https://github.com/paper42/void-packages crda-py3
https://github.com/void-linux/void-packages/pull/34908

crda: add a patch for python3
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **NO**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!-- 
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/34908.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-crda-py3-34908.patch --]
[-- Type: text/x-diff, Size: 13682 bytes --]

From 118addb6ce29ac6bf07fa64c1a0aaa843a258be1 Mon Sep 17 00:00:00 2001
From: Michal Vasilek <michal@vasilek.cz>
Date: Thu, 6 Jan 2022 16:55:15 +0100
Subject: [PATCH 1/3] crda: add a patch for python3

---
 srcpkgs/crda/patches/python3.patch | 101 +++++++++++++++++++++++++++++
 srcpkgs/crda/template              |   4 +-
 2 files changed, 103 insertions(+), 2 deletions(-)
 create mode 100644 srcpkgs/crda/patches/python3.patch

diff --git a/srcpkgs/crda/patches/python3.patch b/srcpkgs/crda/patches/python3.patch
new file mode 100644
index 000000000000..3e1c51ce59c5
--- /dev/null
+++ b/srcpkgs/crda/patches/python3.patch
@@ -0,0 +1,101 @@
+https://raw.githubusercontent.com/archlinux/svntogit-packages/packages/crda/trunk/crda-4.14-python-3.patch
+--- a/utils/key2pub.py
++++ b/utils/key2pub.py
+@@ -1,22 +1,22 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ 
+ import sys
+ try:
+        from M2Crypto import RSA
+-except ImportError, e:
++except ImportError as e:
+        sys.stderr.write('ERROR: Failed to import the "M2Crypto" module: %s\n' % e.message)
+        sys.stderr.write('Please install the "M2Crypto" Python module.\n')
+        sys.stderr.write('On Debian GNU/Linux the package is called "python-m2crypto".\n')
+        sys.exit(1)
+ 
+ def print_ssl_64(output, name, val):
+-    while val[0] == '\0':
++    while val[0:1] == b'\0':
+         val = val[1:]
+     while len(val) % 8:
+-        val = '\0' + val
++        val = b'\0' + val
+     vnew = []
+     while len(val):
+-        vnew.append((val[0], val[1], val[2], val[3], val[4], val[5], val[6], val[7]))
++        vnew.append((val[0:1], val[1:2], val[2:3], val[3:4], val[4:5], val[5:6], val[6:7], val[7:8]))
+         val = val[8:]
+     vnew.reverse()
+     output.write('static BN_ULONG %s[%d] = {\n' % (name, len(vnew)))
+@@ -34,13 +34,13 @@ def print_ssl_64(output, name, val):
+     output.write('};\n\n')
+ 
+ def print_ssl_32(output, name, val):
+-    while val[0] == '\0':
++    while val[0:1] == b'\0':
+         val = val[1:]
+     while len(val) % 4:
+-        val = '\0' + val
++        val = b'\0' + val
+     vnew = []
+     while len(val):
+-        vnew.append((val[0], val[1], val[2], val[3], ))
++        vnew.append((val[0:1], val[1:2], val[2:3], val[3:4]))
+         val = val[4:]
+     vnew.reverse()
+     output.write('static BN_ULONG %s[%d] = {\n' % (name, len(vnew)))
+@@ -80,21 +80,21 @@ struct pubkey {
+ 
+ static struct pubkey keys[] = {
+ ''')
+-    for n in xrange(n + 1):
++    for n in range(n + 1):
+         output.write('	KEYS(e_%d, n_%d),\n' % (n, n))
+     output.write('};\n')
+     pass
+ 
+ def print_gcrypt(output, name, val):
+     output.write('#include <stdint.h>\n')
+-    while val[0] == '\0':
++    while val[0:1] == b'\0':
+         val = val[1:]
+     output.write('static const uint8_t %s[%d] = {\n' % (name, len(val)))
+     idx = 0
+     for v in val:
+         if not idx:
+             output.write('\t')
+-        output.write('0x%.2x, ' % ord(v))
++        output.write('0x%.2x, ' % (v if sys.version_info[0] >=3 else ord(v)))
+         idx += 1
+         if idx == 8:
+             idx = 0
+@@ -117,10 +117,10 @@ struct key_params {
+ 
+ static const struct key_params __attribute__ ((unused)) keys[] = {
+ ''')
+-    for n in xrange(n + 1):
++    for n in range(n + 1):
+         output.write('	KEYS(e_%d, n_%d),\n' % (n, n))
+     output.write('};\n')
+-    
++
+ 
+ modes = {
+     '--ssl': (print_ssl, print_ssl_keys),
+@@ -135,7 +135,7 @@ except IndexError:
+     mode = None
+ 
+ if not mode in modes:
+-    print 'Usage: %s [%s] input-file... output-file' % (sys.argv[0], '|'.join(modes.keys()))
++    print('Usage: %s [%s] input-file... output-file' % (sys.argv[0], '|'.join(modes.keys())))
+     sys.exit(2)
+ 
+ output = open(outfile, 'w')
+@@ -153,3 +153,5 @@ for f in files:
+     idx += 1
+ 
+ modes[mode][1](output, idx - 1)
++
++output.close()
diff --git a/srcpkgs/crda/template b/srcpkgs/crda/template
index e8082064f764..4c5183f23c64 100644
--- a/srcpkgs/crda/template
+++ b/srcpkgs/crda/template
@@ -1,11 +1,11 @@
 # Template file for 'crda'
 pkgname=crda
 version=4.14
-revision=1
+revision=2
 _dbname=wireless-regdb
 _dbversion=2020.11.20
 _dbsrc="${XBPS_BUILDDIR}/${_dbname}-${_dbversion}/"
-hostmakedepends="openssl python python-M2Crypto pkg-config"
+hostmakedepends="openssl python3-M2Crypto pkg-config"
 makedepends="libnl-devel libgcrypt-devel"
 depends="iw"
 short_desc="Central Regulatory Domain Agent for wireless networks"

From 44dc74b9997defa07317c0a303d342bddb0d9035 Mon Sep 17 00:00:00 2001
From: Michal Vasilek <michal@vasilek.cz>
Date: Thu, 6 Jan 2022 16:54:55 +0100
Subject: [PATCH 2/3] 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 ee2a24ad9f4a..000000000000
--- 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 <openssl/rsa.h>
- #include <openssl/opensslv.h>
- 
--#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 <string.h>
- #include <openssl/engine.h>
---- 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 <pythread.h>
- #include <openssl/crypto.h>
- 
--#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<CRYPTO_num_locks(); i++) {
-@@ -50,7 +50,7 @@ void threading_init(void) {
- }
- 
- void threading_cleanup(void) {
--#if defined(THREADING) && OPENSSL_VERSION_NUMBER < 0x10100000L
-+#if defined(THREADING) && OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
-     int i;
-     if (thread_mode) {
-         CRYPTO_set_locking_callback(NULL);
---- a/SWIG/libcrypto-compat.h
-+++ b/SWIG/libcrypto-compat.h
-@@ -1,7 +1,7 @@
- #ifndef LIBCRYPTO_COMPAT_H
- #define LIBCRYPTO_COMPAT_H
- 
--#if OPENSSL_VERSION_NUMBER < 0x10100000L
-+#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
- 
- #include <openssl/rsa.h>
- #include <openssl/dsa.h>
diff --git a/srcpkgs/python-M2Crypto/template b/srcpkgs/python-M2Crypto/template
deleted file mode 100644
index 55f5130596a4..000000000000
--- 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 <orphan@voidlinux.org>"
-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 b9eea2597a68..000000000000
--- 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 000000000000..999ec2d7cf77
--- /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 <orphan@voidlinux.org>"
+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

From f2c5210db53e05140b6059eaeb536ae2cd6b9187 Mon Sep 17 00:00:00 2001
From: Michal Vasilek <michal@vasilek.cz>
Date: Thu, 6 Jan 2022 18:52:12 +0100
Subject: [PATCH 3/3] removed-packages: add python-M2Crypto

---
 srcpkgs/removed-packages/template | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/srcpkgs/removed-packages/template b/srcpkgs/removed-packages/template
index 4bab6419b983..7af3e5ccf88a 100644
--- a/srcpkgs/removed-packages/template
+++ b/srcpkgs/removed-packages/template
@@ -1,7 +1,7 @@
 # Template file for 'removed-packages'
 pkgname=removed-packages
 version=0.1
-revision=56
+revision=57
 build_style=meta
 short_desc="Uninstalls packages removed from repository"
 maintainer="Piotr Wójcik <chocimier@tlen.pl>"
@@ -251,6 +251,7 @@ replaces="
  psiconv<=0.9.9_9
  ptii<=0.4_2
  pyside-tools<=0.2.15_2
+ python-M2Crypto<=0.35.2_7
  python-PyQt4<=4.12.1_4
  python-SecretStorage<=2.3.1_4
  python-audit<=2.8.5_2

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PR PATCH] [Updated] crda: add a patch for python3
  2022-01-06 17:54 [PR PATCH] crda: add a patch for python3 paper42
  2022-01-06 18:01 ` [PR PATCH] [Updated] " paper42
  2022-01-06 19:26 ` paper42
@ 2022-01-06 19:34 ` paper42
  2022-01-06 19:35 ` [PR PATCH] [Merged]: " paper42
  3 siblings, 0 replies; 5+ messages in thread
From: paper42 @ 2022-01-06 19:34 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1219 bytes --]

There is an updated pull request by paper42 against master on the void-packages repository

https://github.com/paper42/void-packages crda-py3
https://github.com/void-linux/void-packages/pull/34908

crda: add a patch for python3
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **NO**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!-- 
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/34908.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-crda-py3-34908.patch --]
[-- Type: text/x-diff, Size: 13682 bytes --]

From 4bb96446855b8958204225d0de0a18193e3d1f1f Mon Sep 17 00:00:00 2001
From: Michal Vasilek <michal@vasilek.cz>
Date: Thu, 6 Jan 2022 16:55:15 +0100
Subject: [PATCH 1/3] crda: add a patch for python3

---
 srcpkgs/crda/patches/python3.patch | 101 +++++++++++++++++++++++++++++
 srcpkgs/crda/template              |   4 +-
 2 files changed, 103 insertions(+), 2 deletions(-)
 create mode 100644 srcpkgs/crda/patches/python3.patch

diff --git a/srcpkgs/crda/patches/python3.patch b/srcpkgs/crda/patches/python3.patch
new file mode 100644
index 000000000000..3e1c51ce59c5
--- /dev/null
+++ b/srcpkgs/crda/patches/python3.patch
@@ -0,0 +1,101 @@
+https://raw.githubusercontent.com/archlinux/svntogit-packages/packages/crda/trunk/crda-4.14-python-3.patch
+--- a/utils/key2pub.py
++++ b/utils/key2pub.py
+@@ -1,22 +1,22 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ 
+ import sys
+ try:
+        from M2Crypto import RSA
+-except ImportError, e:
++except ImportError as e:
+        sys.stderr.write('ERROR: Failed to import the "M2Crypto" module: %s\n' % e.message)
+        sys.stderr.write('Please install the "M2Crypto" Python module.\n')
+        sys.stderr.write('On Debian GNU/Linux the package is called "python-m2crypto".\n')
+        sys.exit(1)
+ 
+ def print_ssl_64(output, name, val):
+-    while val[0] == '\0':
++    while val[0:1] == b'\0':
+         val = val[1:]
+     while len(val) % 8:
+-        val = '\0' + val
++        val = b'\0' + val
+     vnew = []
+     while len(val):
+-        vnew.append((val[0], val[1], val[2], val[3], val[4], val[5], val[6], val[7]))
++        vnew.append((val[0:1], val[1:2], val[2:3], val[3:4], val[4:5], val[5:6], val[6:7], val[7:8]))
+         val = val[8:]
+     vnew.reverse()
+     output.write('static BN_ULONG %s[%d] = {\n' % (name, len(vnew)))
+@@ -34,13 +34,13 @@ def print_ssl_64(output, name, val):
+     output.write('};\n\n')
+ 
+ def print_ssl_32(output, name, val):
+-    while val[0] == '\0':
++    while val[0:1] == b'\0':
+         val = val[1:]
+     while len(val) % 4:
+-        val = '\0' + val
++        val = b'\0' + val
+     vnew = []
+     while len(val):
+-        vnew.append((val[0], val[1], val[2], val[3], ))
++        vnew.append((val[0:1], val[1:2], val[2:3], val[3:4]))
+         val = val[4:]
+     vnew.reverse()
+     output.write('static BN_ULONG %s[%d] = {\n' % (name, len(vnew)))
+@@ -80,21 +80,21 @@ struct pubkey {
+ 
+ static struct pubkey keys[] = {
+ ''')
+-    for n in xrange(n + 1):
++    for n in range(n + 1):
+         output.write('	KEYS(e_%d, n_%d),\n' % (n, n))
+     output.write('};\n')
+     pass
+ 
+ def print_gcrypt(output, name, val):
+     output.write('#include <stdint.h>\n')
+-    while val[0] == '\0':
++    while val[0:1] == b'\0':
+         val = val[1:]
+     output.write('static const uint8_t %s[%d] = {\n' % (name, len(val)))
+     idx = 0
+     for v in val:
+         if not idx:
+             output.write('\t')
+-        output.write('0x%.2x, ' % ord(v))
++        output.write('0x%.2x, ' % (v if sys.version_info[0] >=3 else ord(v)))
+         idx += 1
+         if idx == 8:
+             idx = 0
+@@ -117,10 +117,10 @@ struct key_params {
+ 
+ static const struct key_params __attribute__ ((unused)) keys[] = {
+ ''')
+-    for n in xrange(n + 1):
++    for n in range(n + 1):
+         output.write('	KEYS(e_%d, n_%d),\n' % (n, n))
+     output.write('};\n')
+-    
++
+ 
+ modes = {
+     '--ssl': (print_ssl, print_ssl_keys),
+@@ -135,7 +135,7 @@ except IndexError:
+     mode = None
+ 
+ if not mode in modes:
+-    print 'Usage: %s [%s] input-file... output-file' % (sys.argv[0], '|'.join(modes.keys()))
++    print('Usage: %s [%s] input-file... output-file' % (sys.argv[0], '|'.join(modes.keys())))
+     sys.exit(2)
+ 
+ output = open(outfile, 'w')
+@@ -153,3 +153,5 @@ for f in files:
+     idx += 1
+ 
+ modes[mode][1](output, idx - 1)
++
++output.close()
diff --git a/srcpkgs/crda/template b/srcpkgs/crda/template
index e8082064f764..4c5183f23c64 100644
--- a/srcpkgs/crda/template
+++ b/srcpkgs/crda/template
@@ -1,11 +1,11 @@
 # Template file for 'crda'
 pkgname=crda
 version=4.14
-revision=1
+revision=2
 _dbname=wireless-regdb
 _dbversion=2020.11.20
 _dbsrc="${XBPS_BUILDDIR}/${_dbname}-${_dbversion}/"
-hostmakedepends="openssl python python-M2Crypto pkg-config"
+hostmakedepends="openssl python3-M2Crypto pkg-config"
 makedepends="libnl-devel libgcrypt-devel"
 depends="iw"
 short_desc="Central Regulatory Domain Agent for wireless networks"

From 0e72ce7ddc613aead7e6c157f6832d8e5dd0ddca Mon Sep 17 00:00:00 2001
From: Michal Vasilek <michal@vasilek.cz>
Date: Thu, 6 Jan 2022 16:54:55 +0100
Subject: [PATCH 2/3] 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 ee2a24ad9f4a..000000000000
--- 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 <openssl/rsa.h>
- #include <openssl/opensslv.h>
- 
--#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 <string.h>
- #include <openssl/engine.h>
---- 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 <pythread.h>
- #include <openssl/crypto.h>
- 
--#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<CRYPTO_num_locks(); i++) {
-@@ -50,7 +50,7 @@ void threading_init(void) {
- }
- 
- void threading_cleanup(void) {
--#if defined(THREADING) && OPENSSL_VERSION_NUMBER < 0x10100000L
-+#if defined(THREADING) && OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
-     int i;
-     if (thread_mode) {
-         CRYPTO_set_locking_callback(NULL);
---- a/SWIG/libcrypto-compat.h
-+++ b/SWIG/libcrypto-compat.h
-@@ -1,7 +1,7 @@
- #ifndef LIBCRYPTO_COMPAT_H
- #define LIBCRYPTO_COMPAT_H
- 
--#if OPENSSL_VERSION_NUMBER < 0x10100000L
-+#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
- 
- #include <openssl/rsa.h>
- #include <openssl/dsa.h>
diff --git a/srcpkgs/python-M2Crypto/template b/srcpkgs/python-M2Crypto/template
deleted file mode 100644
index 55f5130596a4..000000000000
--- 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 <orphan@voidlinux.org>"
-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 b9eea2597a68..000000000000
--- 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 000000000000..999ec2d7cf77
--- /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 <orphan@voidlinux.org>"
+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

From e785894802a925b7cdeba0e7dbaf4e5c8d43d2f0 Mon Sep 17 00:00:00 2001
From: Michal Vasilek <michal@vasilek.cz>
Date: Thu, 6 Jan 2022 18:52:12 +0100
Subject: [PATCH 3/3] removed-packages: add python-M2Crypto

---
 srcpkgs/removed-packages/template | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/srcpkgs/removed-packages/template b/srcpkgs/removed-packages/template
index fcedf355babb..0b057f0241bd 100644
--- a/srcpkgs/removed-packages/template
+++ b/srcpkgs/removed-packages/template
@@ -1,7 +1,7 @@
 # Template file for 'removed-packages'
 pkgname=removed-packages
 version=0.1
-revision=56
+revision=57
 build_style=meta
 short_desc="Uninstalls packages removed from repository"
 maintainer="Piotr Wójcik <chocimier@tlen.pl>"
@@ -252,6 +252,7 @@ replaces="
  psiconv<=0.9.9_9
  ptii<=0.4_2
  pyside-tools<=0.2.15_2
+ python-M2Crypto<=0.35.2_7
  python-PyQt4<=4.12.1_4
  python-SecretStorage<=2.3.1_4
  python-audit<=2.8.5_2

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PR PATCH] [Merged]: crda: add a patch for python3
  2022-01-06 17:54 [PR PATCH] crda: add a patch for python3 paper42
                   ` (2 preceding siblings ...)
  2022-01-06 19:34 ` paper42
@ 2022-01-06 19:35 ` paper42
  3 siblings, 0 replies; 5+ messages in thread
From: paper42 @ 2022-01-06 19:35 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1062 bytes --]

There's a merged pull request on the void-packages repository

crda: add a patch for python3
https://github.com/void-linux/void-packages/pull/34908

Description:
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **NO**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!-- 
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-01-06 19:35 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-06 17:54 [PR PATCH] crda: add a patch for python3 paper42
2022-01-06 18:01 ` [PR PATCH] [Updated] " paper42
2022-01-06 19:26 ` paper42
2022-01-06 19:34 ` paper42
2022-01-06 19:35 ` [PR PATCH] [Merged]: " paper42

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).