meta-openembedded/meta-python/recipes-devtools/python/python3-m2crypto/0001-setup.py-Make-the-cmd-available.patch
Haixiao Yan 97a9a1b93b
python3-m2crypto: upgrade 0.45.1 -> 0.46.2
python3-m2crypto/0001-setup.py-Make-the-cmd-available.patch
refreshed for 0.46.2
python3-m2crypto/0001-timeout.py-use-qq-format-when-time_t-is-64bit-on-32b.patch
removed, this patch doesn't work for 0.45.1 and 0.46.2.

Fix the following test hang:

test_IP_call (tests.test_ssl.HttpslibSSLSNIClientTestCase.test_IP_call)
...

Changelog:
===========
0.46.2 - 2025-10-02
-------------------

- fix[m2xmlrpclib]: make the module compatible with Python 3.6

0.46.1 - 2025-10-02
-------------------

- Correct license to BSD-2-Clause and update references
- Specify in setup.cfg that we require Python >= 3.6

0.46.0 - 2025-10-01
-------------------

(Tested on Pythons between 3.6 and 3.14.0~rc3)

- M2Crypto closes SSL connection on closing HTTPS Connection, and
  some other related issues (#203, #278)
- Modernize C API by eliminating use of deprecated
  PyBytes_AsStringAndSize and related functions with Python
  Buffer Protocol (#375)
- Whole project is completely covered with type hints and is
  checked by mypy (also while doing that, the whole project was
  blackened) (#344)
- Add logging support to C extension code sending messages to the
  Python logging
- Introducing first efforts to support Engine object (#229)
- Reworked and fixed M2Crypto.m2xmlrpclib module (#163)
- Reverted removal of demo/ subdirectory
- Improve SMIME documentation (#377)
- Some other minor bugs, improvements, and removal of dead code

Signed-off-by: Haixiao Yan <haixiao.yan.cn@windriver.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2025-10-16 08:48:34 -07:00

45 lines
1.7 KiB
Diff

From 6262f49de177a79bc17f8d583aa5a7acaf48bf9c Mon Sep 17 00:00:00 2001
From: Mingli Yu <mingli.yu@windriver.com>
Date: Fri, 28 Mar 2025 12:13:26 +0800
Subject: [PATCH] setup.py: Make the cmd available
The cmd will be None in OE environment as below.
>>> import os
>>> os.environ.get('CC', 'gcc')
'x86_64-wrs-linux-gcc -m64 -march=nehalem -mtune=generic -mfpmath=sse -msse4.2 -fstack-protector-strong -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=/buildarea/tmp/work/corei7-64-wrs-linux/python3-m2crypto/0.44.0/recipe-sysroot'
>>> import shutil
>>> shutil.which(os.environ.get('CC', 'gcc'))
>>> cmd = [shutil.which(os.environ.get('CC', 'gcc'))]
>>> print(cmd)
[None]
So change the check logic to get the expected cmd.
Upstream-Status: Inappropriate [oe specific]
Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
---
setup.py | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/setup.py b/setup.py
index 792d7365b6ed..5b8a5d791793 100644
--- a/setup.py
+++ b/setup.py
@@ -208,8 +208,10 @@ class _M2CryptoBuildExt(build_ext.build_ext):
if sys.platform != "win32":
# generate src/SWIG/x509_v_flag.h to overcome weaknesses of swig
# https://todo.sr.ht/~mcepl/m2crypto/298
- with open("src/SWIG/x509_v_flag.h", "w", encoding="utf-8") as x509_v_h:
- cmd = [shutil.which(os.environ.get("CC", "gcc"))]
+ with open(
+ "src/SWIG/x509_v_flag.h", "w", encoding="utf-8"
+ ) as x509_v_h:
+ cmd = os.environ.get('CC', 'gcc').split()
cflags = os.environ.get("CFLAGS")
if cflags is not None:
cmd += cflags.split()
--
2.34.1