From 0b3f4ed292c4b494a83f912184ad284edc72c2e3 Mon Sep 17 00:00:00 2001 From: Alexander Kanavin Date: Wed, 16 Oct 2024 21:35:03 +0200 Subject: python3-m2crypto: update 0.40.1 -> 0.42.0 This addresses python 3.13 issues. Use build_meta instead of classic setuptools. Drop all setup.py patches as no longer necessary. Signed-off-by: Alexander Kanavin Signed-off-by: Khem Raj --- ...-setup.py-address-openssl-3.x-build-issue.patch | 28 ------------ ...y-link-in-sysroot-not-in-host-directories.patch | 33 -------------- .../avoid-host-contamination.patch | 23 ---------- .../python3-m2crypto/cross-compile-platform.patch | 33 -------------- .../python/python3-m2crypto_0.40.1.bb | 51 ---------------------- .../python/python3-m2crypto_0.42.0.bb | 45 +++++++++++++++++++ 6 files changed, 45 insertions(+), 168 deletions(-) delete mode 100644 meta-python/recipes-devtools/python/python3-m2crypto/0001-setup.py-address-openssl-3.x-build-issue.patch delete mode 100644 meta-python/recipes-devtools/python/python3-m2crypto/0001-setup.py-link-in-sysroot-not-in-host-directories.patch delete mode 100644 meta-python/recipes-devtools/python/python3-m2crypto/avoid-host-contamination.patch delete mode 100644 meta-python/recipes-devtools/python/python3-m2crypto/cross-compile-platform.patch delete mode 100644 meta-python/recipes-devtools/python/python3-m2crypto_0.40.1.bb create mode 100644 meta-python/recipes-devtools/python/python3-m2crypto_0.42.0.bb (limited to 'meta-python/recipes-devtools/python') diff --git a/meta-python/recipes-devtools/python/python3-m2crypto/0001-setup.py-address-openssl-3.x-build-issue.patch b/meta-python/recipes-devtools/python/python3-m2crypto/0001-setup.py-address-openssl-3.x-build-issue.patch deleted file mode 100644 index c67e50803b..0000000000 --- a/meta-python/recipes-devtools/python/python3-m2crypto/0001-setup.py-address-openssl-3.x-build-issue.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 0d824e5c2ab13e761ffaeabdccf9513d5b8f280d Mon Sep 17 00:00:00 2001 -From: Alexander Kanavin -Date: Fri, 8 Oct 2021 11:18:35 +0200 -Subject: [PATCH] setup.py: address openssl 3.x build issue - -swig throws: -| /home/alex/development/poky/build-metaoe/tmp/work/x86_64-linux/python3-m2crypto-native/0.38.0-r0/recipe-sysroot-native/usr/include/openssl/macros.h:155: Error: CPP #error ""OPENSSL_API_COMPAT expresses an impossible API compatibility level"". Use the -cpperraswarn option to continue swig processing. - -I'm not sure why; upstream should take a look. - -Upstream-Status: Inappropriate [workaround] -Signed-off-by: Alexander Kanavin ---- - setup.py | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/setup.py b/setup.py -index 2c65404..74704bc 100644 ---- a/setup.py -+++ b/setup.py -@@ -192,6 +192,7 @@ class _M2CryptoBuildExt(build_ext.build_ext): - - self.swig_opts.append('-includeall') - self.swig_opts.append('-modern') -+ self.swig_opts.append('-cpperraswarn') - self.swig_opts.append('-builtin') - - # These two lines are a workaround for diff --git a/meta-python/recipes-devtools/python/python3-m2crypto/0001-setup.py-link-in-sysroot-not-in-host-directories.patch b/meta-python/recipes-devtools/python/python3-m2crypto/0001-setup.py-link-in-sysroot-not-in-host-directories.patch deleted file mode 100644 index 0baadfcaa5..0000000000 --- a/meta-python/recipes-devtools/python/python3-m2crypto/0001-setup.py-link-in-sysroot-not-in-host-directories.patch +++ /dev/null @@ -1,33 +0,0 @@ -From dfb83a41aaeae326e9b6f02b233af375bc7b8815 Mon Sep 17 00:00:00 2001 -From: Koen Kooi -Date: Fri, 29 Mar 2013 15:17:17 +0100 -Subject: [PATCH] setup.py: link in sysroot, not in host directories - -Signed-off-by: Koen Kooi - -Upstream-Status: Pending [Unknown] ---- - setup.py | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - ---- a/setup.py -+++ b/setup.py -@@ -135,6 +135,7 @@ class _M2CryptoBuildExt(build_ext.build_ - self.set_undefined_options('build', ('bundledlls', 'bundledlls')) - - self.libraries = ['ssl', 'crypto'] -+ self.openssl = os.environ.get( "STAGING_DIR" ) - if sys.platform == 'win32': - self.libraries = ['ssleay32', 'libeay32'] - if self.openssl and openssl_version(self.openssl, -@@ -159,8 +160,8 @@ class _M2CryptoBuildExt(build_ext.build_ - - if self.openssl is not None: - log.debug('self.openssl = %s', self.openssl) -- openssl_library_dir = os.path.join(self.openssl, 'lib') -- openssl_include_dir = os.path.join(self.openssl, 'include') -+ openssl_library_dir = os.environ.get( "STAGING_LIBDIR" ) -+ openssl_include_dir = os.environ.get( "STAGING_INCDIR" ) - - self.library_dirs.append(openssl_library_dir) - self.include_dirs.append(openssl_include_dir) diff --git a/meta-python/recipes-devtools/python/python3-m2crypto/avoid-host-contamination.patch b/meta-python/recipes-devtools/python/python3-m2crypto/avoid-host-contamination.patch deleted file mode 100644 index 3cd6f7c276..0000000000 --- a/meta-python/recipes-devtools/python/python3-m2crypto/avoid-host-contamination.patch +++ /dev/null @@ -1,23 +0,0 @@ -Filter out '/usr/include' for swig to avoid host contamination issue. - -Upstream-Status: Inappropriate [cross compile specific] - -Signed-off-by: Kai Kang ---- - setup.py | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/setup.py b/setup.py -index 5a12981..389d49f 100644 ---- a/setup.py -+++ b/setup.py -@@ -153,7 +153,8 @@ class _M2CryptoBuildExt(build_ext.build_ext): - self.swig_opts.append('-py3') - - # swig seems to need the default header file directories -- self.swig_opts.extend(['-I%s' % i for i in _get_additional_includes()]) -+ self.swig_opts.extend(['-I%s' % i for i in _get_additional_includes() -+ if i != '/usr/include']) - - log.debug('self.include_dirs = %s', self.include_dirs) - log.debug('self.library_dirs = %s', self.library_dirs) diff --git a/meta-python/recipes-devtools/python/python3-m2crypto/cross-compile-platform.patch b/meta-python/recipes-devtools/python/python3-m2crypto/cross-compile-platform.patch deleted file mode 100644 index 77ef7e557e..0000000000 --- a/meta-python/recipes-devtools/python/python3-m2crypto/cross-compile-platform.patch +++ /dev/null @@ -1,33 +0,0 @@ -Do not compute platform, this does not work in cross compile environment -since it pokes at the system for getting architecture values - -Upstream-Status: Inappropriate -Signed-off-by: Khem Raj - ---- a/setup.py -+++ b/setup.py -@@ -169,24 +169,6 @@ class _M2CryptoBuildExt(build_ext.build_ - log.debug('self.include_dirs = %s', self.include_dirs) - log.debug('self.library_dirs = %s', self.library_dirs) - -- if platform.system() == "Linux": -- # For RedHat-based distros, the '-D__{arch}__' option for -- # Swig needs to be normalized, particularly on i386. -- mach = platform.machine().lower() -- if mach in ('i386', 'i486', 'i586', 'i686'): -- arch = '__i386__' -- elif mach in ('ppc64', 'powerpc64', 'ppc64le', 'ppc64el'): -- arch = '__powerpc64__' -- elif mach in ('ppc', 'powerpc'): -- arch = '__powerpc__' -- else: -- arch = '__%s__' % mach -- self.swig_opts.append('-D%s' % arch) -- if mach in ('ppc64le', 'ppc64el'): -- self.swig_opts.append('-D_CALL_ELF=2') -- if mach in ('arm64_be'): -- self.swig_opts.append('-D__AARCH64EB__') -- - self.swig_opts.extend(['-I%s' % i for i in self.include_dirs]) - - # Some Linux distributor has added the following line in diff --git a/meta-python/recipes-devtools/python/python3-m2crypto_0.40.1.bb b/meta-python/recipes-devtools/python/python3-m2crypto_0.40.1.bb deleted file mode 100644 index 1d8c22d196..0000000000 --- a/meta-python/recipes-devtools/python/python3-m2crypto_0.40.1.bb +++ /dev/null @@ -1,51 +0,0 @@ -SUMMARY = "A Python crypto and SSL toolkit" -HOMEPAGE = "https://gitlab.com/m2crypto/m2crypto" - -LICENSE = "MIT" -LIC_FILES_CHKSUM = "file://LICENCE;md5=b0e1f0b7d0ce8a62c18b1287b991800e" - -FILESEXTRAPATHS:prepend := "${THISDIR}/python-m2crypto:" - -SRC_URI += "file://0001-setup.py-link-in-sysroot-not-in-host-directories.patch \ - file://cross-compile-platform.patch \ - file://avoid-host-contamination.patch \ - file://0001-setup.py-address-openssl-3.x-build-issue.patch \ - " -SRC_URI[sha256sum] = "bbfd113ec55708c05816252a4f09e4237df4f3bbfc8171cbbc33057d257bbb30" - -PYPI_PACKAGE = "M2Crypto" -inherit pypi siteinfo setuptools3 - -DEPENDS += "openssl swig-native" -RDEPENDS:${PN} += "\ - python3-datetime \ - python3-setuptools \ - python3-logging \ - python3-netclient \ - python3-netserver \ - python3-numbers \ - python3-xmlrpc \ -" - -DISTUTILS_BUILD_ARGS += "build_ext --openssl=${STAGING_EXECPREFIXDIR} -I${STAGING_INCDIR}" -DISTUTILS_INSTALL_ARGS += "build_ext --openssl=${STAGING_EXECPREFIXDIR}" - -SWIG_FEATURES ?= "-D__${HOST_ARCH}__ ${@['-D__ILP32__','-D__LP64__'][d.getVar('SITEINFO_BITS') != '32']} -DOPENSSL_NO_FILENAMES" - -SWIG_FEATURES:append:riscv64 = " -D__SIZEOF_POINTER__=${SITEINFO_BITS}/8 -D__riscv_xlen=${SITEINFO_BITS}" -SWIG_FEATURES:append:riscv32 = " -D__SIZEOF_POINTER__=${SITEINFO_BITS}/8 -D__riscv_xlen=${SITEINFO_BITS}" -SWIG_FEATURES:append:mipsarch = " -D_MIPS_SZPTR=${SITEINFO_BITS}" -SWIG_FEATURES:append:powerpc64le = " -D__powerpc64__" -SWIG_FEATURES:append:x86 = " -D__i386__" -SWIG_FEATURES:append:x32 = " -D__ILP32__" - -export SWIG_FEATURES - -export STAGING_DIR - -do_install:append() { - rm -f ${D}${PYTHON_SITEPACKAGES_DIR}/M2Crypto/SSL/__pycache__/*.cpython-*.pyc - rm -f ${D}${PYTHON_SITEPACKAGES_DIR}/M2Crypto/__pycache__/*.cpython-*.pyc -} - -BBCLASSEXTEND = "native" diff --git a/meta-python/recipes-devtools/python/python3-m2crypto_0.42.0.bb b/meta-python/recipes-devtools/python/python3-m2crypto_0.42.0.bb new file mode 100644 index 0000000000..d5ffdbc40c --- /dev/null +++ b/meta-python/recipes-devtools/python/python3-m2crypto_0.42.0.bb @@ -0,0 +1,45 @@ +SUMMARY = "A Python crypto and SSL toolkit" +HOMEPAGE = "https://gitlab.com/m2crypto/m2crypto" + +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://LICENCE;md5=b0e1f0b7d0ce8a62c18b1287b991800e" + +FILESEXTRAPATHS:prepend := "${THISDIR}/python-m2crypto:" + +SRC_URI[sha256sum] = "42b62df2caf623161b1d643a7235464c2fe2a3105049ebc498a6d47dc08f64b4" + +inherit pypi siteinfo python_setuptools_build_meta + +DEPENDS += "openssl swig-native" +RDEPENDS:${PN} += "\ + python3-datetime \ + python3-setuptools \ + python3-logging \ + python3-netclient \ + python3-netserver \ + python3-numbers \ + python3-xmlrpc \ +" + +DISTUTILS_BUILD_ARGS += "build_ext --openssl=${STAGING_EXECPREFIXDIR} -I${STAGING_INCDIR}" +DISTUTILS_INSTALL_ARGS += "build_ext --openssl=${STAGING_EXECPREFIXDIR}" + +SWIG_FEATURES ?= "-D__${HOST_ARCH}__ ${@['-D__ILP32__','-D__LP64__'][d.getVar('SITEINFO_BITS') != '32']} -DOPENSSL_NO_FILENAMES" + +SWIG_FEATURES:append:riscv64 = " -D__SIZEOF_POINTER__=${SITEINFO_BITS}/8 -D__riscv_xlen=${SITEINFO_BITS}" +SWIG_FEATURES:append:riscv32 = " -D__SIZEOF_POINTER__=${SITEINFO_BITS}/8 -D__riscv_xlen=${SITEINFO_BITS}" +SWIG_FEATURES:append:mipsarch = " -D_MIPS_SZPTR=${SITEINFO_BITS}" +SWIG_FEATURES:append:powerpc64le = " -D__powerpc64__" +SWIG_FEATURES:append:x86 = " -D__i386__" +SWIG_FEATURES:append:x32 = " -D__ILP32__" + +export SWIG_FEATURES + +export STAGING_DIR + +do_install:append() { + rm -f ${D}${PYTHON_SITEPACKAGES_DIR}/M2Crypto/SSL/__pycache__/*.cpython-*.pyc + rm -f ${D}${PYTHON_SITEPACKAGES_DIR}/M2Crypto/__pycache__/*.cpython-*.pyc +} + +BBCLASSEXTEND = "native" -- cgit v1.2.3-54-g00ecf