commit: d02831a4eede99aa68e1ee7dc73e2e5adbb9a143
Author: Dennis Camera <dennis.camera+gentoo <AT> riiengineering <DOT> ch>
AuthorDate: Wed Mar 27 11:02:13 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Tue Apr 30 06:39:07 2024 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d02831a4
sys-libs/tevent: fix redefinition of uintptr_t in bundled cmocka library
Build failed with musl libc:
In file included from ../../third_party/cmocka/cmocka.c:61:
../../third_party/cmocka/cmocka.h:127:28: error: conflicting types for
'uintptr_t'; have 'unsigned int'
127 | typedef unsigned int uintptr_t;
| ^~~~~~~~~
In file included from /usr/include/stdint.h:20,
from /usr/include/inttypes.h:9,
from ../../third_party/cmocka/cmocka.c:27:
/usr/include/bits/alltypes.h:47:24: note: previous declaration of
'uintptr_t' with type 'uintptr_t' {aka 'long unsigned int'}
47 | typedef unsigned _Addr uintptr_t;
| ^~~~~~~~~
Signed-off-by: Dennis Camera <dennis.camera+gentoo <AT> riiengineering.ch>
Signed-off-by: Sam James <sam <AT> gentoo.org>
sys-libs/tevent/files/cmocka-config_h.patch | 23 +++++++++++++++++++++++
sys-libs/tevent/tevent-0.13.0.ebuild | 4 ++++
sys-libs/tevent/tevent-0.14.0.ebuild | 4 ++++
sys-libs/tevent/tevent-0.14.1.ebuild | 4 ++++
sys-libs/tevent/tevent-0.15.0.ebuild | 4 ++++
5 files changed, 39 insertions(+)
diff --git a/sys-libs/tevent/files/cmocka-config_h.patch
b/sys-libs/tevent/files/cmocka-config_h.patch
new file mode 100644
index 000000000000..124928450cd6
--- /dev/null
+++ b/sys-libs/tevent/files/cmocka-config_h.patch
@@ -0,0 +1,23 @@
+--- ./third_party/cmocka/cmocka.h.orig 2024-03-26 10:23:03.378410042 +0100
++++ ./third_party/cmocka/cmocka.h 2024-03-26 10:24:51.526922405 +0100
+@@ -14,6 +14,11 @@
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
++
++#ifdef HAVE_CONFIG_H
++#include "config.h"
++#endif
++
+ #ifndef CMOCKA_H_
+ #define CMOCKA_H_
+
+@@ -111,7 +114,7 @@
+ ((LargestIntegralType)(value))
+
+ /* Smallest integral type capable of holding a pointer. */
+-#if !defined(_UINTPTR_T) && !defined(_UINTPTR_T_DEFINED)
++#if !defined(HAVE_UINTPTR_T) && !defined(_UINTPTR_T) &&
!defined(_UINTPTR_T_DEFINED) && !defined(__DEFINED_uintptr_t)
+ # if defined(_WIN32)
+ /* WIN32 is an ILP32 platform */
+ typedef unsigned int uintptr_t;
diff --git a/sys-libs/tevent/tevent-0.13.0.ebuild
b/sys-libs/tevent/tevent-0.13.0.ebuild
index d13c4c06ea0b..87b2f050f147 100644
--- a/sys-libs/tevent/tevent-0.13.0.ebuild
+++ b/sys-libs/tevent/tevent-0.13.0.ebuild
@@ -42,6 +42,10 @@ BDEPEND="
virtual/pkgconfig
"
+PATCHES=(
+ "${FILESDIR}"/cmocka-config_h.patch
+)
+
WAF_BINARY="${S}/buildtools/bin/waf"
pkg_setup() {
diff --git a/sys-libs/tevent/tevent-0.14.0.ebuild
b/sys-libs/tevent/tevent-0.14.0.ebuild
index c178820999e5..7757e601adbb 100644
--- a/sys-libs/tevent/tevent-0.14.0.ebuild
+++ b/sys-libs/tevent/tevent-0.14.0.ebuild
@@ -42,6 +42,10 @@ BDEPEND="
virtual/pkgconfig
"
+PATCHES=(
+ "${FILESDIR}"/cmocka-config_h.patch
+)
+
WAF_BINARY="${S}/buildtools/bin/waf"
check_samba_dep_versions() {
diff --git a/sys-libs/tevent/tevent-0.14.1.ebuild
b/sys-libs/tevent/tevent-0.14.1.ebuild
index 832834917e1d..59e5993d23c2 100644
--- a/sys-libs/tevent/tevent-0.14.1.ebuild
+++ b/sys-libs/tevent/tevent-0.14.1.ebuild
@@ -41,6 +41,10 @@ BDEPEND="
virtual/pkgconfig
"
+PATCHES=(
+ "${FILESDIR}"/cmocka-config_h.patch
+)
+
WAF_BINARY="${S}/buildtools/bin/waf"
check_samba_dep_versions() {
diff --git a/sys-libs/tevent/tevent-0.15.0.ebuild
b/sys-libs/tevent/tevent-0.15.0.ebuild
index d5297a130f6f..f59c99993edc 100644
--- a/sys-libs/tevent/tevent-0.15.0.ebuild
+++ b/sys-libs/tevent/tevent-0.15.0.ebuild
@@ -41,6 +41,10 @@ BDEPEND="
virtual/pkgconfig
"
+PATCHES=(
+ "${FILESDIR}"/cmocka-config_h.patch
+)
+
WAF_BINARY="${S}/buildtools/bin/waf"
check_samba_dep_versions() {