From 5b010f6358f18bcf05823a5cf30b0b22ac45d377 Mon Sep 17 00:00:00 2001 From: Mingli Yu Date: Fri, 28 Mar 2025 13:11:24 +0800 Subject: [PATCH] python3-m2crypto: Upgrade 0.42.0 -> 0.44.0 Changelog: https://gitlab.com/m2crypto/m2crypto/-/tags The cmd will be None after introduced the commit [1] in the new version and result the below do_compile error. DEBUG: Executing shell function do_compile * Getting build dependencies for wheel... [snip] TypeError: expected str, bytes or os.PathLike object, not NoneType ERROR Backend subprocess exited when trying to invoke get_requires_for_build_wheel So make the cmd available to fix the above issue. [1] https://gitlab.com/m2crypto/m2crypto/-/commit/4d7880b019a67e24458b1c9a50331c18c9eec827 Signed-off-by: Mingli Yu Signed-off-by: Khem Raj --- ...0001-setup.py-Make-the-cmd-available.patch | 40 +++++++++++++++++++ ...o_0.42.0.bb => python3-m2crypto_0.44.0.bb} | 6 ++- 2 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 meta-python/recipes-devtools/python/python3-m2crypto/0001-setup.py-Make-the-cmd-available.patch rename meta-python/recipes-devtools/python/{python3-m2crypto_0.42.0.bb => python3-m2crypto_0.44.0.bb} (90%) 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 new file mode 100644 index 0000000000..819ecabf6c --- /dev/null +++ b/meta-python/recipes-devtools/python/python3-m2crypto/0001-setup.py-Make-the-cmd-available.patch @@ -0,0 +1,40 @@ +From b14664fdab286485c5cbc0fbe5b0ff13f062edd8 Mon Sep 17 00:00:00 2001 +From: Mingli Yu +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 +--- + setup.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/setup.py b/setup.py +index 7e295f3..cc414c9 100644 +--- a/setup.py ++++ b/setup.py +@@ -221,7 +221,7 @@ class _M2CryptoBuildExt(build_ext.build_ext): + with open( + "src/SWIG/x509_v_flag.h", "w", encoding="utf-8" + ) as x509_v_h: +- cmd = [shutil.which(os.environ.get('CC', 'gcc'))] ++ cmd = os.environ.get('CC', 'gcc').split() + cflags = os.environ.get("CFLAGS") + if cflags is not None: + cmd += cflags.split() +-- +2.34.1 + diff --git a/meta-python/recipes-devtools/python/python3-m2crypto_0.42.0.bb b/meta-python/recipes-devtools/python/python3-m2crypto_0.44.0.bb similarity index 90% rename from meta-python/recipes-devtools/python/python3-m2crypto_0.42.0.bb rename to meta-python/recipes-devtools/python/python3-m2crypto_0.44.0.bb index b50ae31e4c..5201e704ea 100644 --- a/meta-python/recipes-devtools/python/python3-m2crypto_0.42.0.bb +++ b/meta-python/recipes-devtools/python/python3-m2crypto_0.44.0.bb @@ -4,7 +4,11 @@ HOMEPAGE = "https://gitlab.com/m2crypto/m2crypto" LICENSE = "MIT" LIC_FILES_CHKSUM = "file://LICENCE;md5=b0e1f0b7d0ce8a62c18b1287b991800e" -SRC_URI[sha256sum] = "42b62df2caf623161b1d643a7235464c2fe2a3105049ebc498a6d47dc08f64b4" +SRC_URI[sha256sum] = "384bb4cbd178ee0e74015311b7b1f9f2c377e3686e03fa070b3ec2f494671c0f" + +SRC_URI += " \ + file://0001-setup.py-Make-the-cmd-available.patch \ +" inherit pypi siteinfo python_setuptools_build_meta