commit:     45599c2be55766dd3b748308d22cf3e4378d4890
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Wed Jan  4 04:17:01 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed Jan  4 04:32:00 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=45599c2b

app-crypt/p11-kit: fix configure w/ clang 16

Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../files/p11-kit-0.24.1-configure-clang16.patch   | 35 ++++++++++++++++++++++
 ...-kit-0.24.1.ebuild => p11-kit-0.24.1-r1.ebuild} | 11 +++++--
 2 files changed, 44 insertions(+), 2 deletions(-)

diff --git a/app-crypt/p11-kit/files/p11-kit-0.24.1-configure-clang16.patch 
b/app-crypt/p11-kit/files/p11-kit-0.24.1-configure-clang16.patch
new file mode 100644
index 000000000000..3af5da6c68ac
--- /dev/null
+++ b/app-crypt/p11-kit/files/p11-kit-0.24.1-configure-clang16.patch
@@ -0,0 +1,35 @@
+https://github.com/p11-glue/p11-kit/commit/d39043f7c6e44247b5b1a237888e80b2a4d9c2b2
+
+From d39043f7c6e44247b5b1a237888e80b2a4d9c2b2 Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fwei...@redhat.com>
+Date: Mon, 12 Dec 2022 19:40:25 +0100
+Subject: [PATCH] Fix meson/configure _Thread_local checks for C99
+ compatibility
+
+The type was missing from the definition, which happens to work
+in current compilers for historic reasons.  Implicit ints were
+actually removed from C in 1999.
+--- a/configure.ac
++++ b/configure.ac
+@@ -148,7 +148,7 @@ if test "$os_unix" = "yes"; then
+               [ac_cv_tls_keyword=
+               for keyword in _Thread_local __thread; do
+               AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stdlib.h>]],
+-                      [[static ]$keyword[ foo;]])],
++                      [[static ]$keyword[ int foo;]])],
+                       [ac_cv_tls_keyword=$keyword])
+               done])
+       if test -n "$ac_cv_tls_keyword"; then
+--- a/meson.build
++++ b/meson.build
+@@ -200,7 +200,7 @@ if host_system != 'windows'
+   tls_test_code_template = '''
+ #include <stdlib.h>
+ int main (void) {
+-static @0@ foo;
++static @0@ int foo;
+ return 0;
+ }
+ '''
+
+

diff --git a/app-crypt/p11-kit/p11-kit-0.24.1.ebuild 
b/app-crypt/p11-kit/p11-kit-0.24.1-r1.ebuild
similarity index 89%
rename from app-crypt/p11-kit/p11-kit-0.24.1.ebuild
rename to app-crypt/p11-kit/p11-kit-0.24.1-r1.ebuild
index 91ee0171c43a..e5ecd181f2ff 100644
--- a/app-crypt/p11-kit/p11-kit-0.24.1.ebuild
+++ b/app-crypt/p11-kit/p11-kit-0.24.1-r1.ebuild
@@ -1,9 +1,9 @@
-# Copyright 1999-2022 Gentoo Authors
+# Copyright 1999-2023 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=8
 
-inherit multilib-minimal
+inherit autotools multilib-minimal
 
 DESCRIPTION="Provides a standard configuration setup for installing PKCS#11"
 HOMEPAGE="https://p11-glue.github.io/p11-glue/p11-kit.html";
@@ -22,6 +22,10 @@ RDEPEND="asn1? ( 
>=dev-libs/libtasn1-3.4:=[${MULTILIB_USEDEP}] )
 DEPEND="${RDEPEND}"
 BDEPEND="virtual/pkgconfig"
 
+PATCHES=(
+       "${FILESDIR}"/${P}-configure-clang16.patch
+)
+
 pkg_setup() {
        # disable unsafe tests, bug#502088
        export FAKED_MODE=1
@@ -38,7 +42,10 @@ src_prepare() {
                sed -i -e 's/SUN_LEN \(([^)]\+)\)/strlen (\1->sun_path)/' \
                        p11-kit/server.c || die
        fi
+
        default
+       # TODO: drop in next release (after 0.24.1), 
p11-kit-0.24.1-configure-clang16.patch is emrged
+       eautoreconf
 }
 
 multilib_src_configure() {

Reply via email to