diff options
Diffstat (limited to 'meta-python')
-rw-r--r-- | meta-python/recipes-devtools/python/python3-m2crypto/0001-setup.py-Make-the-cmd-available.patch | 25 | ||||
-rw-r--r-- | meta-python/recipes-devtools/python/python3-m2crypto/0001-timeout.py-use-qq-format-when-time_t-is-64bit-on-32b.patch | 80 | ||||
-rw-r--r-- | meta-python/recipes-devtools/python/python3-m2crypto_0.46.2.bb (renamed from meta-python/recipes-devtools/python/python3-m2crypto_0.45.1.bb) | 9 |
3 files changed, 20 insertions, 94 deletions
diff --git a/meta-python/recipes-devtools/python/python3-m2crypto/0001-setup.py-Make-the-cmd-available.patch b/meta-python/recipes-devtools/python/python3-m2crypto/0001-setup.py-Make-the-cmd-available.patch index c4262985ba..12216ce46a 100644 --- a/meta-python/recipes-devtools/python/python3-m2crypto/0001-setup.py-Make-the-cmd-available.patch +++ b/meta-python/recipes-devtools/python/python3-m2crypto/0001-setup.py-Make-the-cmd-available.patch | |||
@@ -1,4 +1,4 @@ | |||
1 | From eaeb95ec64762a58dde7cf368fc17188382e7df6 Mon Sep 17 00:00:00 2001 | 1 | From 6262f49de177a79bc17f8d583aa5a7acaf48bf9c Mon Sep 17 00:00:00 2001 |
2 | From: Mingli Yu <mingli.yu@windriver.com> | 2 | From: Mingli Yu <mingli.yu@windriver.com> |
3 | Date: Fri, 28 Mar 2025 12:13:26 +0800 | 3 | Date: Fri, 28 Mar 2025 12:13:26 +0800 |
4 | Subject: [PATCH] setup.py: Make the cmd available | 4 | Subject: [PATCH] setup.py: Make the cmd available |
@@ -19,19 +19,26 @@ Upstream-Status: Inappropriate [oe specific] | |||
19 | 19 | ||
20 | Signed-off-by: Mingli Yu <mingli.yu@windriver.com> | 20 | Signed-off-by: Mingli Yu <mingli.yu@windriver.com> |
21 | --- | 21 | --- |
22 | setup.py | 2 +- | 22 | setup.py | 6 ++++-- |
23 | 1 file changed, 1 insertion(+), 1 deletion(-) | 23 | 1 file changed, 4 insertions(+), 2 deletions(-) |
24 | 24 | ||
25 | diff --git a/setup.py b/setup.py | 25 | diff --git a/setup.py b/setup.py |
26 | index 9938e67..21e2346 100644 | 26 | index 792d7365b6ed..5b8a5d791793 100644 |
27 | --- a/setup.py | 27 | --- a/setup.py |
28 | +++ b/setup.py | 28 | +++ b/setup.py |
29 | @@ -230,7 +230,7 @@ class _M2CryptoBuildExt(build_ext.build_ext): | 29 | @@ -208,8 +208,10 @@ class _M2CryptoBuildExt(build_ext.build_ext): |
30 | with open( | 30 | if sys.platform != "win32": |
31 | "src/SWIG/x509_v_flag.h", "w", encoding="utf-8" | 31 | # generate src/SWIG/x509_v_flag.h to overcome weaknesses of swig |
32 | ) as x509_v_h: | 32 | # https://todo.sr.ht/~mcepl/m2crypto/298 |
33 | - cmd = [shutil.which(os.environ.get('CC', 'gcc'))] | 33 | - with open("src/SWIG/x509_v_flag.h", "w", encoding="utf-8") as x509_v_h: |
34 | - cmd = [shutil.which(os.environ.get("CC", "gcc"))] | ||
35 | + with open( | ||
36 | + "src/SWIG/x509_v_flag.h", "w", encoding="utf-8" | ||
37 | + ) as x509_v_h: | ||
34 | + cmd = os.environ.get('CC', 'gcc').split() | 38 | + cmd = os.environ.get('CC', 'gcc').split() |
35 | cflags = os.environ.get("CFLAGS") | 39 | cflags = os.environ.get("CFLAGS") |
36 | if cflags is not None: | 40 | if cflags is not None: |
37 | cmd += cflags.split() | 41 | cmd += cflags.split() |
42 | -- | ||
43 | 2.34.1 | ||
44 | |||
diff --git a/meta-python/recipes-devtools/python/python3-m2crypto/0001-timeout.py-use-qq-format-when-time_t-is-64bit-on-32b.patch b/meta-python/recipes-devtools/python/python3-m2crypto/0001-timeout.py-use-qq-format-when-time_t-is-64bit-on-32b.patch deleted file mode 100644 index 120a67b6a2..0000000000 --- a/meta-python/recipes-devtools/python/python3-m2crypto/0001-timeout.py-use-qq-format-when-time_t-is-64bit-on-32b.patch +++ /dev/null | |||
@@ -1,80 +0,0 @@ | |||
1 | From 7fa4f17cc183e04b10684b28219cf15780910206 Mon Sep 17 00:00:00 2001 | ||
2 | From: Mingli Yu <mingli.yu@windriver.com> | ||
3 | Date: Mon, 30 Jun 2025 16:11:16 +0800 | ||
4 | Subject: [PATCH] timeout.py: use qq format when time_t is 64bit on 32bit | ||
5 | platform | ||
6 | |||
7 | Fixes: | ||
8 | # python3 | ||
9 | Python 3.13.2 (main, Feb 4 2025, 14:51:09) [GCC 14.2.0] on linux | ||
10 | Type "help", "copyright", "credits" or "license" for more information. | ||
11 | >>> import socket | ||
12 | >>> import struct | ||
13 | >>> s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | ||
14 | >>> seconds = 5 | ||
15 | >>> microseconds = 0 | ||
16 | >>> timeval_packed = struct.pack('ll', seconds, microseconds) | ||
17 | >>> s.setsockopt(socket.SOL_SOCKET, socket.SO_RCVTIMEO, timeval_packed) | ||
18 | Traceback (most recent call last): | ||
19 | File "<python-input-6>", line 1, in <module> | ||
20 | s.setsockopt(socket.SOL_SOCKET, socket.SO_RCVTIMEO, timeval_packed) | ||
21 | ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
22 | OSError: [Errno 22] Invalid argument | ||
23 | |||
24 | Upstream-Status: Submitted [https://lists.sr.ht/~mcepl/m2crypto/patches/60463] | ||
25 | |||
26 | Signed-off-by: Mingli Yu <mingli.yu@windriver.com> | ||
27 | --- | ||
28 | src/M2Crypto/SSL/timeout.py | 18 ++++++++++++++---- | ||
29 | 1 file changed, 14 insertions(+), 4 deletions(-) | ||
30 | |||
31 | diff --git a/src/M2Crypto/SSL/timeout.py b/src/M2Crypto/SSL/timeout.py | ||
32 | index 298a9ca..0b38329 100644 | ||
33 | --- a/src/M2Crypto/SSL/timeout.py | ||
34 | +++ b/src/M2Crypto/SSL/timeout.py | ||
35 | @@ -15,7 +15,7 @@ __all__ = [ | ||
36 | import sys | ||
37 | import struct | ||
38 | |||
39 | -from M2Crypto import m2 | ||
40 | +from M2Crypto import m2, util | ||
41 | |||
42 | DEFAULT_TIMEOUT: int = 600 | ||
43 | |||
44 | @@ -40,7 +40,10 @@ class timeout(object): | ||
45 | if m2.time_t_bits() == 32: | ||
46 | binstr = struct.pack('ii', self.sec, self.microsec) | ||
47 | else: | ||
48 | - binstr = struct.pack('ll', self.sec, self.microsec) | ||
49 | + if util.is_32bit(): | ||
50 | + binstr = struct.pack('qq', self.sec, self.microsec) | ||
51 | + else: | ||
52 | + binstr = struct.pack('ll', self.sec, self.microsec) | ||
53 | return binstr | ||
54 | |||
55 | |||
56 | @@ -52,7 +55,10 @@ def struct_to_timeout(binstr: bytes) -> timeout: | ||
57 | sec = int(millisec / 1000) | ||
58 | microsec = (millisec % 1000) * 1000 | ||
59 | else: | ||
60 | - (sec, microsec) = struct.unpack('ll', binstr) | ||
61 | + if sys.platform == 'linux' and util.is_32bit() and m2.time_t_bits() == 64: | ||
62 | + (sec, microsec) = struct.unpack('qq', binstr) | ||
63 | + else: | ||
64 | + (sec, microsec) = struct.unpack('ll', binstr) | ||
65 | return timeout(sec, microsec) | ||
66 | |||
67 | |||
68 | @@ -60,4 +66,8 @@ def struct_size() -> int: | ||
69 | if sys.platform == 'win32': | ||
70 | return struct.calcsize('l') | ||
71 | else: | ||
72 | - return struct.calcsize('ll') | ||
73 | + if sys.platform == 'linux' and util.is_32bit() and m2.time_t_bits() == 64: | ||
74 | + return struct.calcsize('qq') | ||
75 | + else: | ||
76 | + return struct.calcsize('ll') | ||
77 | + | ||
78 | -- | ||
79 | 2.34.1 | ||
80 | |||
diff --git a/meta-python/recipes-devtools/python/python3-m2crypto_0.45.1.bb b/meta-python/recipes-devtools/python/python3-m2crypto_0.46.2.bb index e0e9fdb2bb..0a631c7a07 100644 --- a/meta-python/recipes-devtools/python/python3-m2crypto_0.45.1.bb +++ b/meta-python/recipes-devtools/python/python3-m2crypto_0.46.2.bb | |||
@@ -1,14 +1,13 @@ | |||
1 | SUMMARY = "A Python crypto and SSL toolkit" | 1 | SUMMARY = "A Python crypto and SSL toolkit" |
2 | HOMEPAGE = "https://gitlab.com/m2crypto/m2crypto" | 2 | HOMEPAGE = "https://gitlab.com/m2crypto/m2crypto" |
3 | 3 | ||
4 | LICENSE = "MIT" | 4 | LICENSE = "BSD-2-Clause" |
5 | LIC_FILES_CHKSUM = "file://LICENCE;md5=b0e1f0b7d0ce8a62c18b1287b991800e" | 5 | LIC_FILES_CHKSUM = "file://LICENSES/BSD-2-Clause.txt;md5=8099b0e569f862ece05740aef06c82a2" |
6 | 6 | ||
7 | SRC_URI[sha256sum] = "d0fc81a8828edbf4308432b3040bf06bb26bad95abb9e7d4690b6118551e76ec" | 7 | SRC_URI[sha256sum] = "13c2fa89562f7b8af40cc74b55f490be5e2ab8ccfb739f11c16d3ce6221a61ba" |
8 | 8 | ||
9 | SRC_URI += " \ | 9 | SRC_URI += " \ |
10 | file://0001-setup.py-Make-the-cmd-available.patch \ | 10 | file://0001-setup.py-Make-the-cmd-available.patch \ |
11 | file://0001-timeout.py-use-qq-format-when-time_t-is-64bit-on-32b.patch \ | ||
12 | " | 11 | " |
13 | 12 | ||
14 | inherit pypi siteinfo python_setuptools_build_meta | 13 | inherit pypi siteinfo python_setuptools_build_meta |