Skip to contentSkip to conversation

python{, 3}-m2crypto: update from 0.26.4 -> 0.30.1

PATCH In review Khem Raj 1 participant 3 messages Aug 28, 2018 – Sep 1, 2018

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH v2 1/2 python{, 3}-m2crypto: update from 0.26.4 -> 0.30.1

From: Jens Rehsack <[email protected]>

Updating recipe for crypto and SSL toolkit for python and support python3 infrastructure of Yocto as well as the already supported python2 line.

Refresh patches to fix devtool warnings

---

V2: Fix the m2crypto-0.26.4-gcc_macros.patch to not drop %import "gcc_macros.h"

 ...m2crypto_0.26.4.bb => python-m2crypto.inc} | 10 +++--
 ...k-in-sysroot-not-in-host-directories.patch | 44 +++++++++----------
 .../cross-compile-platform.patch              | 21 +++++----
 .../m2crypto-0.26.4-gcc_macros.patch          | 17 ++++---
 .../python/python-m2crypto_0.30.1.bb          |  2 +
 .../python/python3-m2crypto_0.30.1.bb         |  2 +
 6 files changed, 52 insertions(+), 44 deletions(-)
 rename meta-python/recipes-devtools/python/{python-m2crypto_0.26.4.bb => python-m2crypto.inc} (87%)
 create mode 100644 meta-python/recipes-devtools/python/python-m2crypto_0.30.1.bb
 create mode 100644 meta-python/recipes-devtools/python/python3-m2crypto_0.30.1.bb
meta-python/recipes-devtools/python/python-m2crypto.inc renamed from meta-python/recipes-devtools/python/python-m2crypto_0.26.4.bb +6 -4
similarity index 87%
rename from meta-python/recipes-devtools/python/python-m2crypto_0.26.4.bb
rename to meta-python/recipes-devtools/python/python-m2crypto.inc
index 0da4274d96..d0eaa819b1 100644
@@ -1,18 +1,20 @@
 SUMMARY = "A Python crypto and SSL toolkit"
 HOMEPAGE = "https://gitlab.com/m2crypto/m2crypto"
 
-LICENSE = "BSD"
+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://m2crypto-0.26.4-gcc_macros.patch \
            "
-SRC_URI[md5sum] = "5c74c25ba8b45122318a165a3a2059ad"
-SRC_URI[sha256sum] = "5cae7acc0b34821f8c0ddf6665e482893fe1f198ad6379e61ffa9d8e65f5c199"
+SRC_URI[md5sum] = "7fce3cbf85eb84a669682892b935746b"
+SRC_URI[sha256sum] = "a1b2751cdadc6afac3df8a5799676b7b7c67a6ad144bb62d38563062e7cd3fc6"
 
 PYPI_PACKAGE = "M2Crypto"
-inherit pypi setuptools siteinfo
+inherit pypi siteinfo
 
 DEPENDS += "openssl swig-native"
 RDEPENDS_${PN} += "python-typing"
meta-python/recipes-devtools/python/python-m2crypto/0001-setup.py-link-in-sysroot-not-in-host-directories.patch +20 -24

50 lines not on this page · raw message

meta-python/recipes-devtools/python/python-m2crypto/cross-compile-platform.patch +12 -9
index c6654e5402..4b64f4613c 100644
@@ -4,27 +4,30 @@ since it pokes at the system for getting architecture values
 Upstream-Status: Inappropriate
 Signed-off-by: Khem Raj <[email protected]>
 
-Index: M2Crypto-0.26.0/setup.py
+Index: M2Crypto-0.30.1/setup.py
 ===================================================================
---- M2Crypto-0.26.0.orig/setup.py
-+++ M2Crypto-0.26.0/setup.py
-@@ -141,19 +141,6 @@ class _M2CryptoBuildExt(build_ext.build_
-                 self.include_dirs.append(
-                     os.path.join(self.openssl, 'include', 'openssl'))
+--- M2Crypto-0.30.1.orig/setup.py
++++ M2Crypto-0.30.1/setup.py
+@@ -160,22 +160,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'):
+-            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')
 -
          self.swig_opts.extend(['-I%s' % i for i in self.include_dirs])
-         self.swig_opts.append('-includeall')
-         self.swig_opts.append('-modern')
+ 
+         # Some Linux distributor has added the following line in
meta-python/recipes-devtools/python/python-m2crypto/m2crypto-0.26.4-gcc_macros.patch +10 -7
index 2d738cc94e..931c25c8ee 100644
@@ -1,16 +1,19 @@
 Imported from Fedora
 
---- M2Crypto/SWIG/_m2crypto.i	2017-09-26 11:26:33.000000000 +0200
-+++ M2Crypto-0.26.4/SWIG/_m2crypto.i	2017-09-26 21:04:14.080330741 +0200
-@@ -7,6 +7,7 @@
+Index: M2Crypto-0.30.1/SWIG/_m2crypto.i
+===================================================================
+--- M2Crypto-0.30.1.orig/SWIG/_m2crypto.i
++++ M2Crypto-0.30.1/SWIG/_m2crypto.i
+@@ -7,7 +7,7 @@
   * Copyright (c) 2009-2010 Heikki Toivonen. All rights reserved.
   *
   */
+-
 +%import "gcc_macros.h"
- 
  %module(threads=1) m2crypto
  /* We really don't need threadblock (PyGILState_Ensure() etc.) anywhere.
-@@ -15,11 +16,6 @@
+    Disable threadallow as well, only enable it for operations likely to
+@@ -15,11 +15,6 @@
  %nothreadblock;
  %nothreadallow;
  
@@ -20,5 +23,5 @@ Imported from Fedora
 -#endif
 -
  %{
- #if __GNUC__ < 5
- #pragma GCC diagnostic ignored "-Wunused-label"
+ #ifdef _WIN32
+ #define _WINSOCKAPI_
meta-python/recipes-devtools/python/python-m2crypto_0.30.1.bb new file +2 -0
new file mode 100644
index 0000000000..c612fcdc58
@@ -0,0 +1,2 @@
+inherit setuptools
+require python-m2crypto.inc
meta-python/recipes-devtools/python/python3-m2crypto_0.30.1.bb new file +2 -0
new file mode 100644
index 0000000000..4d63d4bd3a
@@ -0,0 +1,2 @@
+inherit setuptools3
+require python-m2crypto.inc
Signature · 1 line
2.18.0
author
#1 lore raw

PATCH 2/2 kernel-selftest: Fix the COPYING checksum variablity

COPYING coming from kernel sources but the md5 is static value saved in recipe does not scale to all kind of machines which may have different kernel providers filling in, therefore keep a static copy of COPYING file as well, additionally copy LICENSES directory ( if it exists) into sources where all the real license texts are living

Document need for clang

---
 .../kernel-selftest/kernel-selftest.bb        |  26 +-
 .../kernel-selftest/kernel-selftest/COPYING   | 358 +-----------------
 2 files changed, 26 insertions(+), 358 deletions(-)
meta-oe/recipes-kernel/kernel-selftest/kernel-selftest.bb +16 -10
index 0d0aa6c5df..2a53419c22 100644
@@ -2,16 +2,18 @@ SUMMARY = "Kernel selftest for Linux"
 DESCRIPTION = "Kernel selftest for Linux"
 LICENSE = "GPLv2"
 
-LIC_FILES_CHKSUM = "file://COPYING;md5=d7810fab7487fb0aad327b76f1be7cd7"
+LIC_FILES_CHKSUM = "file://../COPYING;md5=bbea815ee2795b2f4230826c0c6b8814"
 
 DEPENDS = "rsync-native"
 
 # for musl libc
-SRC_URI_libc-musl += "file://userfaultfd.patch \
+SRC_URI_append_libc-musl = "\
+                      file://userfaultfd.patch \
                       file://0001-bpf-test_progs.c-add-support-for-musllibc.patch \
-"
+                      "
 SRC_URI += "file://run-ptest \
-"
+            file://COPYING \
+            "
 
 # now we just test bpf and vm
 # we will append other kernel selftest in the future
@@ -26,11 +28,9 @@ do_patch[depends] += "virtual/kernel:do_shared_workdir"
 
 inherit linux-kernel-base kernel-arch ptest
 
-do_populate_lic[depends] += "virtual/kernel:do_patch"
-
 S = "${WORKDIR}/${BP}"
 
-TEST_LIST = " \
+TEST_LIST = "\
     ${@bb.utils.filter('PACKAGECONFIG', 'bpf vm', d)} \
 "
 
@@ -48,7 +48,7 @@ KERNEL_SELFTEST_SRC ?= "Makefile \
                         tools \
                         scripts \
                         arch \
-			COPYING \
+                        LICENSES \
 "
 
 python __anonymous () {
@@ -62,6 +62,9 @@ python __anonymous () {
 }
 
 do_compile() {
+    bbwarn "clang with bpf support is needed with kernel 4.18+ so \
+either install it and add it to HOSTTOOLS, or add \
+clang-native from meta-clang to dependency"
     for i in ${TEST_LIST}
     do
         oe_runmake -C ${S}/tools/testing/selftests/${i}
@@ -78,7 +81,7 @@ do_install() {
 }
 
 do_configure() {
-    :
+    install -D -m 0644 ${WORKDIR}/COPYING ${S}/COPYING
 }
 
 do_patch[prefuncs] += "copy_kselftest_source_from_kernel remove_unrelated"
@@ -99,7 +102,10 @@ python copy_kselftest_source_from_kernel() {
 remove_unrelated() {
     if ${@bb.utils.contains('PACKAGECONFIG','bpf','true','false',d)} ; then
         test -f ${S}/tools/testing/selftests/bpf/Makefile && \
-            sed -i -e '/test_pkt_access/d' -e '/test_pkt_md_access/d' -e '/sockmap_verdict_prog/d' -e '/llc/d' ${S}/tools/testing/selftests/bpf/Makefile || \
+            sed -i -e 's/test_pkt_access.*$/\\/' \
+                   -e 's/test_pkt_md_access.*$/\\/' \
+                   -e 's/sockmap_verdict_prog.*$/\\/' \
+                   ${S}/tools/testing/selftests/bpf/Makefile || \
             bberror "Your kernel is probably older than 4.10 and doesn't have tools/testing/selftests/bpf/Makefile file from https://github.com/torvalds/linux/commit/5aa5bd14c5f8660c64ceedf14a549781be47e53d, disable bpf PACKAGECONFIG"
     fi
 }
meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/COPYING +10 -348

366 lines not on this page · raw message

Signature · 1 line
2.18.0
author
#2 lore raw
In reply to Khem Raj

Hi Jens

Native version of this is failing on ubuntu 14.04 hosts, it could be generic issue too,

http://errors.yoctoproject.org/Errors/Details/188936/

Can you check ?

Quoted 213 lines · Khem Raj

From: Jens Rehsack <[email protected]>

Updating recipe for crypto and SSL toolkit for python and support python3 infrastructure of Yocto as well as the already supported python2 line.

Refresh patches to fix devtool warnings

---

V2: Fix the m2crypto-0.26.4-gcc_macros.patch to not drop %import "gcc_macros.h"

 ...m2crypto_0.26.4.bb => python-m2crypto.inc} | 10 +++--
 ...k-in-sysroot-not-in-host-directories.patch | 44 +++++++++----------
 .../cross-compile-platform.patch              | 21 +++++----
 .../m2crypto-0.26.4-gcc_macros.patch          | 17 ++++---
 .../python/python-m2crypto_0.30.1.bb          |  2 +
 .../python/python3-m2crypto_0.30.1.bb         |  2 +
 6 files changed, 52 insertions(+), 44 deletions(-)
 rename meta-python/recipes-devtools/python/{python-m2crypto_0.26.4.bb => python-m2crypto.inc} (87%)
 create mode 100644 meta-python/recipes-devtools/python/python-m2crypto_0.30.1.bb
 create mode 100644 meta-python/recipes-devtools/python/python3-m2crypto_0.30.1.bb
meta-python/recipes-devtools/python/python-m2crypto.inc renamed from meta-python/recipes-devtools/python/python-m2crypto_0.26.4.bb +6 -4
similarity index 87%
rename from meta-python/recipes-devtools/python/python-m2crypto_0.26.4.bb
rename to meta-python/recipes-devtools/python/python-m2crypto.inc
index 0da4274d96..d0eaa819b1 100644
@@ -1,18 +1,20 @@
 SUMMARY = "A Python crypto and SSL toolkit"
 HOMEPAGE = "https://gitlab.com/m2crypto/m2crypto"
 
-LICENSE = "BSD"
+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://m2crypto-0.26.4-gcc_macros.patch \
            "
-SRC_URI[md5sum] = "5c74c25ba8b45122318a165a3a2059ad"
-SRC_URI[sha256sum] = "5cae7acc0b34821f8c0ddf6665e482893fe1f198ad6379e61ffa9d8e65f5c199"
+SRC_URI[md5sum] = "7fce3cbf85eb84a669682892b935746b"
+SRC_URI[sha256sum] = "a1b2751cdadc6afac3df8a5799676b7b7c67a6ad144bb62d38563062e7cd3fc6"
 
 PYPI_PACKAGE = "M2Crypto"
-inherit pypi setuptools siteinfo
+inherit pypi siteinfo
 
 DEPENDS += "openssl swig-native"
 RDEPENDS_${PN} += "python-typing"
meta-python/recipes-devtools/python/python-m2crypto/0001-setup.py-link-in-sysroot-not-in-host-directories.patch +20 -24
index c71b16fece..b339d93f75 100644
@@ -10,30 +10,26 @@ Upstream-status: Unknown
  setup.py | 6 +++---
  1 file changed, 3 insertions(+), 3 deletions(-)
 
-diff --git a/setup.py b/setup.py
-index 3407c82..15ed7cd 100644
---- a/setup.py
-+++ b/setup.py
-@@ -127,7 +127,7 @@ class _M2CryptoBuildExt(build_ext.build_ext):
-                 self.openssl = os.path.join(self.openssl, 'OpenSSL')
-         else:
-             self.libraries = ['ssl', 'crypto']
--            self.openssl = '/usr'
-+            self.openssl = os.environ.get( "STAGING_DIR" )
+Index: M2Crypto-0.30.1/setup.py
+===================================================================
+--- M2Crypto-0.30.1.orig/setup.py
++++ M2Crypto-0.30.1/setup.py
+@@ -130,6 +130,7 @@ class _M2CryptoBuildExt(build_ext.build_
+         self.set_undefined_options('build', ('bundledlls', 'bundledlls'))
 
-     def finalize_options(self):
-         '''Overloaded build_ext implementation to append custom openssl
-@@ -143,8 +143,8 @@ class _M2CryptoBuildExt(build_ext.build_ext):
-         if _openssl and os.path.isdir(_openssl):
-             self.openssl = _openssl
+         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, 0x10100000, True):
+@@ -150,8 +151,8 @@ class _M2CryptoBuildExt(build_ext.build_
 
--        self.include_dirs.append(os.path.join(self.openssl, 'include'))
--        openssl_library_dir = os.path.join(self.openssl, 'lib')
-+        self.include_dirs.append(os.environ.get( "STAGING_INCDIR" ))
-+        openssl_library_dir = os.environ.get( "STAGING_LIBDIR" )
+         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" )
 
-         if platform.system() == "Linux":
-             if _multiarch:  # on Fedora/RHEL it is an empty string
---
-2.7.4
-
+             self.library_dirs.append(openssl_library_dir)
+             self.include_dirs.append(openssl_include_dir)
meta-python/recipes-devtools/python/python-m2crypto/cross-compile-platform.patch +12 -9
index c6654e5402..4b64f4613c 100644
@@ -4,27 +4,30 @@ since it pokes at the system for getting architecture values
 Upstream-Status: Inappropriate
 Signed-off-by: Khem Raj <[email protected]>
 
-Index: M2Crypto-0.26.0/setup.py
+Index: M2Crypto-0.30.1/setup.py
 ===================================================================
---- M2Crypto-0.26.0.orig/setup.py
-+++ M2Crypto-0.26.0/setup.py
-@@ -141,19 +141,6 @@ class _M2CryptoBuildExt(build_ext.build_
-                 self.include_dirs.append(
-                     os.path.join(self.openssl, 'include', 'openssl'))
+--- M2Crypto-0.30.1.orig/setup.py
++++ M2Crypto-0.30.1/setup.py
+@@ -160,22 +160,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'):
+-            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')
 -
          self.swig_opts.extend(['-I%s' % i for i in self.include_dirs])
-         self.swig_opts.append('-includeall')
-         self.swig_opts.append('-modern')
+
+         # Some Linux distributor has added the following line in
meta-python/recipes-devtools/python/python-m2crypto/m2crypto-0.26.4-gcc_macros.patch +10 -7
index 2d738cc94e..931c25c8ee 100644
@@ -1,16 +1,19 @@
 Imported from Fedora
 
---- M2Crypto/SWIG/_m2crypto.i  2017-09-26 11:26:33.000000000 +0200
-+++ M2Crypto-0.26.4/SWIG/_m2crypto.i   2017-09-26 21:04:14.080330741 +0200
-@@ -7,6 +7,7 @@
+Index: M2Crypto-0.30.1/SWIG/_m2crypto.i
+===================================================================
+--- M2Crypto-0.30.1.orig/SWIG/_m2crypto.i
++++ M2Crypto-0.30.1/SWIG/_m2crypto.i
+@@ -7,7 +7,7 @@
   * Copyright (c) 2009-2010 Heikki Toivonen. All rights reserved.
   *
   */
+-
 +%import "gcc_macros.h"
-
  %module(threads=1) m2crypto
  /* We really don't need threadblock (PyGILState_Ensure() etc.) anywhere.
-@@ -15,11 +16,6 @@
+    Disable threadallow as well, only enable it for operations likely to
+@@ -15,11 +15,6 @@
  %nothreadblock;
  %nothreadallow;
 
@@ -20,5 +23,5 @@ Imported from Fedora
 -#endif
 -
  %{
- #if __GNUC__ < 5
- #pragma GCC diagnostic ignored "-Wunused-label"
+ #ifdef _WIN32
+ #define _WINSOCKAPI_
meta-python/recipes-devtools/python/python-m2crypto_0.30.1.bb new file +2 -0
new file mode 100644
index 0000000000..c612fcdc58
@@ -0,0 +1,2 @@
+inherit setuptools
+require python-m2crypto.inc
meta-python/recipes-devtools/python/python3-m2crypto_0.30.1.bb new file +2 -1
new file mode 100644
index 0000000000..4d63d4bd3a
@@ -0,0 +1,2 @@
+inherit setuptools3
+require python-m2crypto.inc
--

2.18.0