diff mbox series

[meta-networking,3/5] libtevent: upgrade 0.10.2 -> 0.13.0

Message ID 20230101072739.75462-3-yi.zhao@windriver.com
State Under Review
Headers show
Series [meta-networking,1/5] libtalloc: upgrade 2.3.3 -> 2.3.4 | expand

Commit Message

Yi Zhao Jan. 1, 2023, 7:27 a.m. UTC
License-Update: Remove trailing whitespace

* Refresh patches
* Add a patch to skip checking PYTHONHASHSEED
* Enable cmocka bundled library to fix build error

Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
---
 ...-Add-configure-options-for-packages.patch} | 16 +++----
 ...ibtevent-fix-musl-libc-compile-error.patch | 32 -------------
 ...pyext_PATTERN-for-cross-compilation.patch} | 10 ++---
 ...wscript-skip-checking-PYTHONHASHSEED.patch | 30 +++++++++++++
 .../libtevent/avoid-attr-unless-wanted.patch  | 12 ++---
 ...ix-musl-libc-conflicting-types-error.patch | 45 +++++++++++++++++++
 ...ibtevent_0.10.2.bb => libtevent_0.13.0.bb} | 23 ++++++----
 7 files changed, 108 insertions(+), 60 deletions(-)
 rename meta-networking/recipes-support/libtevent/libtevent/{options-0.10.0.patch => 0001-Add-configure-options-for-packages.patch} (95%)
 delete mode 100644 meta-networking/recipes-support/libtevent/libtevent/0001-libtevent-fix-musl-libc-compile-error.patch
 rename meta-networking/recipes-support/libtevent/libtevent/{0001-Fix-pyext_PATTERN-for-cross-compilation.patch => 0002-Fix-pyext_PATTERN-for-cross-compilation.patch} (83%)
 create mode 100644 meta-networking/recipes-support/libtevent/libtevent/0003-wscript-skip-checking-PYTHONHASHSEED.patch
 create mode 100644 meta-networking/recipes-support/libtevent/libtevent/cmocka-fix-musl-libc-conflicting-types-error.patch
 rename meta-networking/recipes-support/libtevent/{libtevent_0.10.2.bb => libtevent_0.13.0.bb} (68%)
diff mbox series

Patch

diff --git a/meta-networking/recipes-support/libtevent/libtevent/options-0.10.0.patch b/meta-networking/recipes-support/libtevent/libtevent/0001-Add-configure-options-for-packages.patch
similarity index 95%
rename from meta-networking/recipes-support/libtevent/libtevent/options-0.10.0.patch
rename to meta-networking/recipes-support/libtevent/libtevent/0001-Add-configure-options-for-packages.patch
index 42da2468f..d98559b4e 100644
--- a/meta-networking/recipes-support/libtevent/libtevent/options-0.10.0.patch
+++ b/meta-networking/recipes-support/libtevent/libtevent/0001-Add-configure-options-for-packages.patch
@@ -1,4 +1,4 @@ 
-From c012aa03613e6e74a0598185b222c7b531df1e2d Mon Sep 17 00:00:00 2001
+From d9fd1c52d1646254944bfee37be611e04d4daddb Mon Sep 17 00:00:00 2001
 From: Wang Mingyu <wangmy@cn.fujitsu.com>
 Date: Fri, 25 Dec 2020 15:03:17 +0900
 Subject: [PATCH] Add configure options for packages
@@ -27,7 +27,7 @@  Signed-off-by: Changqing Li <changqing.li@windriver.com>
  2 files changed, 73 insertions(+), 20 deletions(-)
 
 diff --git a/lib/replace/wscript b/lib/replace/wscript
-index a2bc604..e4642e8 100644
+index 4c774d9..21a746a 100644
 --- a/lib/replace/wscript
 +++ b/lib/replace/wscript
 @@ -25,6 +25,41 @@ def options(opt):
@@ -72,7 +72,7 @@  index a2bc604..e4642e8 100644
  @Utils.run_once
  def configure(conf):
      conf.RECURSE('buildtools/wafsamba')
-@@ -34,12 +69,25 @@ def configure(conf):
+@@ -35,12 +70,25 @@ def configure(conf):
      conf.DEFINE('HAVE_LIBREPLACE', 1)
      conf.DEFINE('LIBREPLACE_NETWORK_CHECKS', 1)
  
@@ -86,7 +86,7 @@  index a2bc604..e4642e8 100644
 -    conf.CHECK_HEADERS('sys/attributes.h attr/attributes.h sys/capability.h sys/dir.h sys/epoll.h')
 +    conf.CHECK_HEADERS('shadow.h')
 +    conf.CHECK_HEADERS('sys/attributes.h sys/dir.h sys/epoll.h')
-+    
++
 +    if Options.options.enable_acl:
 +        conf.CHECK_HEADERS('acl/libacl.h sys/acl.h')
 +
@@ -102,7 +102,7 @@  index a2bc604..e4642e8 100644
      conf.CHECK_HEADERS('port.h')
      conf.CHECK_HEADERS('sys/fcntl.h sys/filio.h sys/filsys.h sys/fs/s5param.h')
      conf.CHECK_HEADERS('sys/id.h sys/ioctl.h sys/ipc.h sys/mman.h sys/mode.h sys/ndir.h sys/priv.h')
-@@ -121,8 +169,9 @@ def configure(conf):
+@@ -110,8 +158,9 @@ def configure(conf):
      conf.CHECK_HEADERS('sys/fileio.h sys/filesys.h sys/dustat.h sys/sysmacros.h')
      conf.CHECK_HEADERS('xfs/libxfs.h netgroup.h')
  
@@ -114,7 +114,7 @@  index a2bc604..e4642e8 100644
      conf.CHECK_HEADERS('nss_common.h nsswitch.h ns_api.h')
      conf.CHECK_HEADERS('sys/extattr.h sys/ea.h sys/proplist.h sys/cdefs.h')
      conf.CHECK_HEADERS('utmp.h utmpx.h lastlog.h')
-@@ -418,20 +467,18 @@ def configure(conf):
+@@ -434,20 +483,18 @@ def configure(conf):
  
      strlcpy_in_bsd = False
  
@@ -148,10 +148,10 @@  index a2bc604..e4642e8 100644
      conf.CHECK_CODE('''
                  struct ucred cred;
 diff --git a/wscript b/wscript
-index 93af416..a0898b1 100644
+index 5c6f02c..75eecd4 100644
 --- a/wscript
 +++ b/wscript
-@@ -25,6 +25,12 @@ def options(opt):
+@@ -28,6 +28,12 @@ def options(opt):
      opt.RECURSE('lib/replace')
      opt.RECURSE('lib/talloc')
  
diff --git a/meta-networking/recipes-support/libtevent/libtevent/0001-libtevent-fix-musl-libc-compile-error.patch b/meta-networking/recipes-support/libtevent/libtevent/0001-libtevent-fix-musl-libc-compile-error.patch
deleted file mode 100644
index e3aeda9c3..000000000
--- a/meta-networking/recipes-support/libtevent/libtevent/0001-libtevent-fix-musl-libc-compile-error.patch
+++ /dev/null
@@ -1,32 +0,0 @@ 
-From 7ba1de909c587b6773a39ba9f6f9890987f35b24 Mon Sep 17 00:00:00 2001
-From: Changqing Li <changqing.li@windriver.com>
-Date: Tue, 24 Jul 2018 11:30:53 +0800
-Subject: [PATCH] libtevent: fix musl libc compile error
-
-libldb depend on libtevent,  build libldb with musl libc,
-will report error:
-tevent.h:1440:8: error: unknown type name 'pid_t'; did you mean 'div_t'?
-
-add missing headers to fix it.
-
-Signed-off-by: Changqing Li <changqing.li@windriver.com>
----
- tevent.h | 2 ++
- 1 file changed, 2 insertions(+)
-
-diff --git a/tevent.h b/tevent.h
-index aa6fe0d..2572696 100644
---- a/tevent.h
-+++ b/tevent.h
-@@ -32,6 +32,8 @@
- #include <talloc.h>
- #include <sys/time.h>
- #include <stdbool.h>
-+#include <sys/stat.h>
-+#include <sys/types.h>
- 
- struct tevent_context;
- struct tevent_ops;
--- 
-2.7.4
-
diff --git a/meta-networking/recipes-support/libtevent/libtevent/0001-Fix-pyext_PATTERN-for-cross-compilation.patch b/meta-networking/recipes-support/libtevent/libtevent/0002-Fix-pyext_PATTERN-for-cross-compilation.patch
similarity index 83%
rename from meta-networking/recipes-support/libtevent/libtevent/0001-Fix-pyext_PATTERN-for-cross-compilation.patch
rename to meta-networking/recipes-support/libtevent/libtevent/0002-Fix-pyext_PATTERN-for-cross-compilation.patch
index 81abac83a..ba3f4ca7a 100644
--- a/meta-networking/recipes-support/libtevent/libtevent/0001-Fix-pyext_PATTERN-for-cross-compilation.patch
+++ b/meta-networking/recipes-support/libtevent/libtevent/0002-Fix-pyext_PATTERN-for-cross-compilation.patch
@@ -1,4 +1,4 @@ 
-From 96ddbe6653f87670e4a0bbff229276bbe0aa822a Mon Sep 17 00:00:00 2001
+From da1dc659fd351ff6283f843eeba5e0b3f7b2d584 Mon Sep 17 00:00:00 2001
 From: Yi Zhao <yi.zhao@windriver.com>
 Date: Wed, 24 Nov 2021 13:33:35 +0800
 Subject: [PATCH] Fix pyext_PATTERN for cross compilation
@@ -25,18 +25,18 @@  Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/third_party/waf/waflib/Tools/python.py b/third_party/waf/waflib/Tools/python.py
-index 7c45a76..c9a90f7 100644
+index a23bd01..af202e0 100644
 --- a/third_party/waf/waflib/Tools/python.py
 +++ b/third_party/waf/waflib/Tools/python.py
 @@ -328,7 +328,7 @@ def check_python_headers(conf, features='pyembed pyext'):
  	x = 'MACOSX_DEPLOYMENT_TARGET'
  	if dct[x]:
- 		env[x] = conf.environ[x] = dct[x]
--	env.pyext_PATTERN = '%s' + dct['SO'] # not a mistake
+ 		env[x] = conf.environ[x] = str(dct[x])
+-	env.pyext_PATTERN = '%s' + (dct['EXT_SUFFIX'] or dct['SO']) # SO is deprecated in 3.5 and removed in 3.11
 +	env.pyext_PATTERN = '%s.so'
  
  
  	# Try to get pythonX.Y-config
 -- 
-2.17.1
+2.25.1
 
diff --git a/meta-networking/recipes-support/libtevent/libtevent/0003-wscript-skip-checking-PYTHONHASHSEED.patch b/meta-networking/recipes-support/libtevent/libtevent/0003-wscript-skip-checking-PYTHONHASHSEED.patch
new file mode 100644
index 000000000..b334d51a3
--- /dev/null
+++ b/meta-networking/recipes-support/libtevent/libtevent/0003-wscript-skip-checking-PYTHONHASHSEED.patch
@@ -0,0 +1,30 @@ 
+From 406bb14337c71403c100ad8692e1fe99308030b7 Mon Sep 17 00:00:00 2001
+From: Yi Zhao <yi.zhao@windriver.com>
+Date: Wed, 28 Dec 2022 16:31:05 +0800
+Subject: [PATCH] wscript: skip checking PYTHONHASHSEED
+
+Skip checking PYTHONHASHSEED as it is set to 0 in oe-core by default.
+
+Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
+---
+ buildtools/wafsamba/wscript | 4 ----
+ 1 file changed, 4 deletions(-)
+
+diff --git a/buildtools/wafsamba/wscript b/buildtools/wafsamba/wscript
+index 8729b08..a4d6f3e 100644
+--- a/buildtools/wafsamba/wscript
++++ b/buildtools/wafsamba/wscript
+@@ -8,10 +8,6 @@ import wafsamba
+ from samba_utils import symlink
+ from optparse import SUPPRESS_HELP
+ 
+-phs = os.environ.get("PYTHONHASHSEED", None)
+-if phs != "1":
+-    raise Errors.WafError('''PYTHONHASHSEED=1 missing! Don't use waf directly, use ./configure and make!''')
+-
+ # this forces configure to be re-run if any of the configure
+ # sections of the build scripts change. We have to check
+ # for this in sys.argv as options have not yet been parsed when
+-- 
+2.25.1
+
diff --git a/meta-networking/recipes-support/libtevent/libtevent/avoid-attr-unless-wanted.patch b/meta-networking/recipes-support/libtevent/libtevent/avoid-attr-unless-wanted.patch
index b71192b7d..1e340f369 100644
--- a/meta-networking/recipes-support/libtevent/libtevent/avoid-attr-unless-wanted.patch
+++ b/meta-networking/recipes-support/libtevent/libtevent/avoid-attr-unless-wanted.patch
@@ -1,17 +1,17 @@ 
-From 6c4a634cdf70147f773bb1806692c78bbb95c6f2 Mon Sep 17 00:00:00 2001
+From 82dc31b72e77f263574645092ba1597a8f1152e7 Mon Sep 17 00:00:00 2001
 From: Wang Mingyu <wangmy@cn.fujitsu.com>
 Date: Fri, 25 Dec 2020 15:10:58 +0900
-Subject: [PATCH] test
+Subject: [PATCH] avoid attr unless wanted
 
 ---
  lib/replace/wscript | 4 +---
  1 file changed, 1 insertion(+), 3 deletions(-)
 
 diff --git a/lib/replace/wscript b/lib/replace/wscript
-index e4642e8..163e94d 100644
+index 21a746a..6be3276 100644
 --- a/lib/replace/wscript
 +++ b/lib/replace/wscript
-@@ -945,8 +945,6 @@ def build(bld):
+@@ -968,8 +968,6 @@ def build(bld):
      if not bld.CONFIG_SET('HAVE_INET_ATON'):     REPLACE_SOURCE += ' inet_aton.c'
      if not bld.CONFIG_SET('HAVE_INET_NTOP'):     REPLACE_SOURCE += ' inet_ntop.c'
      if not bld.CONFIG_SET('HAVE_INET_PTON'):     REPLACE_SOURCE += ' inet_pton.c'
@@ -20,10 +20,10 @@  index e4642e8..163e94d 100644
  
      if not bld.CONFIG_SET('HAVE_CLOSEFROM'):
          REPLACE_SOURCE += ' closefrom.c'
-@@ -960,7 +958,7 @@ def build(bld):
-                       # at the moment:
+@@ -984,7 +982,7 @@ def build(bld):
                        # hide_symbols=bld.BUILTIN_LIBRARY('replace'),
                        private_library=True,
+                       provide_builtin_linking=True,
 -                      deps='dl attr' + extra_libs)
 +                      deps='dl' + extra_libs)
  
diff --git a/meta-networking/recipes-support/libtevent/libtevent/cmocka-fix-musl-libc-conflicting-types-error.patch b/meta-networking/recipes-support/libtevent/libtevent/cmocka-fix-musl-libc-conflicting-types-error.patch
new file mode 100644
index 000000000..5795ff3bd
--- /dev/null
+++ b/meta-networking/recipes-support/libtevent/libtevent/cmocka-fix-musl-libc-conflicting-types-error.patch
@@ -0,0 +1,45 @@ 
+From 1d4dedab5039bb671f44566d8573ee3532ba7176 Mon Sep 17 00:00:00 2001
+From: Changqing Li <changqing.li@windriver.com>
+Date: Wed, 25 Jul 2018 09:55:25 +0800
+Subject: [PATCH] cmocka: fix musl libc conflicting types error
+
+/third_party/cmocka/cmocka.h:126:28: error: conflicting types for 'uintptr_t'
+            typedef unsigned int uintptr_t;
+                                 ^~~~~~~~~
+use __DEFINED_uintptr_t in alltypes.h to check if uintptr already defined
+
+Upstream-Status: Pending
+
+Signed-off-by: Changqing Li <changqing.li@windriver.com>
+---
+ third_party/cmocka/cmocka.h | 7 +++----
+ 1 file changed, 3 insertions(+), 4 deletions(-)
+
+diff --git a/third_party/cmocka/cmocka.h b/third_party/cmocka/cmocka.h
+index e6861c8..238201d 100644
+--- a/third_party/cmocka/cmocka.h
++++ b/third_party/cmocka/cmocka.h
+@@ -111,7 +111,7 @@ typedef uintmax_t LargestIntegralType;
+     ((LargestIntegralType)(value))
+ 
+ /* Smallest integral type capable of holding a pointer. */
+-#if !defined(_UINTPTR_T) && !defined(_UINTPTR_T_DEFINED)
++#if !defined(__DEFINED_uintptr_t)
+ # if defined(_WIN32)
+     /* WIN32 is an ILP32 platform */
+     typedef unsigned int uintptr_t;
+@@ -135,9 +135,8 @@ typedef uintmax_t LargestIntegralType;
+ #  endif /* __WORDSIZE */
+ # endif /* _WIN32 */
+ 
+-# define _UINTPTR_T
+-# define _UINTPTR_T_DEFINED
+-#endif /* !defined(_UINTPTR_T) || !defined(_UINTPTR_T_DEFINED) */
++# define __DEFINED_uintptr_t
++#endif /* !defined(__DEFINED_uintptr_t) */
+ 
+ /* Perform an unsigned cast to uintptr_t. */
+ #define cast_to_pointer_integral_type(value) \
+-- 
+2.25.1
+
diff --git a/meta-networking/recipes-support/libtevent/libtevent_0.10.2.bb b/meta-networking/recipes-support/libtevent/libtevent_0.13.0.bb
similarity index 68%
rename from meta-networking/recipes-support/libtevent/libtevent_0.10.2.bb
rename to meta-networking/recipes-support/libtevent/libtevent_0.13.0.bb
index 732880e96..bae200b7a 100644
--- a/meta-networking/recipes-support/libtevent/libtevent_0.10.2.bb
+++ b/meta-networking/recipes-support/libtevent/libtevent_0.13.0.bb
@@ -1,5 +1,5 @@ 
 SUMMARY = "Hierarchical, reference counted memory pool system with destructors"
-HOMEPAGE = "http://tevent.samba.org"
+HOMEPAGE = "https://tevent.samba.org"
 SECTION = "libs"
 LICENSE = "LGPL-3.0-or-later"
 
@@ -7,14 +7,17 @@  DEPENDS += "libtalloc libtirpc"
 RDEPENDS:python3-tevent = "python3"
 
 SRC_URI = "https://samba.org/ftp/tevent/tevent-${PV}.tar.gz \
-           file://options-0.10.0.patch \
-           file://0001-libtevent-fix-musl-libc-compile-error.patch \
-           file://0001-Fix-pyext_PATTERN-for-cross-compilation.patch \
-"
-LIC_FILES_CHKSUM = "file://tevent.h;endline=26;md5=4e458d658cb25e21efc16f720e78b85a"
+           file://0001-Add-configure-options-for-packages.patch \
+           file://0002-Fix-pyext_PATTERN-for-cross-compilation.patch \
+           file://0003-wscript-skip-checking-PYTHONHASHSEED.patch \
+          "
+
+SRC_URI:append:libc-musl = " file://cmocka-fix-musl-libc-conflicting-types-error.patch"
+
+LIC_FILES_CHKSUM = "file://tevent.h;endline=26;md5=47386b7c539bf2706b7ce52dc9341681"
 
-SRC_URI[md5sum] = "105c7a4dbb96f1751eb27dfd05e7fa84"
-SRC_URI[sha256sum] = "f8427822e5b2878fb8b28d6f50d96848734f3f3130612fb574fdd2d2148a6696"
+SRC_URI[md5sum] = "9f413f3184f79a4deecd9444242a5dca"
+SRC_URI[sha256sum] = "b9437a917fa55344361beb64ec9e0042e99cae8879882a62dd38f6abe2371d0c"
 
 inherit pkgconfig waf-samba
 
@@ -38,7 +41,8 @@  S = "${WORKDIR}/tevent-${PV}"
 export WAF_NO_PREFORK="yes"
 
 EXTRA_OECONF += "--disable-rpath \
-                 --bundled-libraries=NONE \
+                 --disable-rpath-install \
+                 --bundled-libraries=cmocka \
                  --builtin-libraries=replace \
                  --with-libiconv=${STAGING_DIR_HOST}${prefix}\
                  --without-gettext \
@@ -48,6 +52,7 @@  PACKAGES += "python3-tevent"
 
 RPROVIDES:${PN}-dbg += "python3-tevent-dbg"
 
+FILES:${PN} += "${libdir}/tevent/*"
 FILES:python3-tevent = "${libdir}/python${PYTHON_BASEVERSION}/site-packages/*"
 
 INSANE_SKIP:${MLPREFIX}python3-tevent = "dev-so"