commit:     e7366c7358e43e26c1558324b252620c4cdc0dfb
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Fri Apr 14 03:55:24 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Apr 14 03:59:57 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e7366c73

dev-db/mariadb: fix configure w/ clang 16

Bug: https://bugs.gentoo.org/899772
Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../files/mariadb-10.6.11-configure-clang16.patch  | 26 ++++++++++++++++++++++
 ...10.6.11-r3.ebuild => mariadb-10.6.11-r4.ebuild} |  7 ++++++
 dev-db/mariadb/mariadb-10.6.12-r1.ebuild           |  7 ++++++
 3 files changed, 40 insertions(+)

diff --git a/dev-db/mariadb/files/mariadb-10.6.11-configure-clang16.patch 
b/dev-db/mariadb/files/mariadb-10.6.11-configure-clang16.patch
new file mode 100644
index 000000000000..cc97319f4bc1
--- /dev/null
+++ b/dev-db/mariadb/files/mariadb-10.6.11-configure-clang16.patch
@@ -0,0 +1,26 @@
+https://github.com/MariaDB/server/pull/2593
+
+From 50c034d6de4fa508186cb8f75cb6073f5d0ced2f Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fwei...@redhat.com>
+Date: Tue, 11 Apr 2023 09:39:40 +0200
+Subject: [PATCH] rocksdb: Define _GNU_SOURCE during fallocate CMake probe
+
+The glibc headers declare fallocate only if _GNU_SOURCE is defined.
+Without this change, the probe fails with C compilers which do not
+support implicit function declarations even if the system does in
+fact support the fallocate function.
+
+Upstream rocksdb does not need this because the probe is run with the
+C++ compiler, and current g++ versions define _GNU_SOURCE
+automatically.
+--- a/storage/rocksdb/build_rocksdb.cmake
++++ b/storage/rocksdb/build_rocksdb.cmake
+@@ -134,6 +134,7 @@ option(WITH_FALLOCATE "build with fallocate" ON)
+ if(WITH_FALLOCATE AND UNIX)
+   include(CheckCSourceCompiles)
+   CHECK_C_SOURCE_COMPILES("
++#define _GNU_SOURCE
+ #include <fcntl.h>
+ #include <linux/falloc.h>
+ int main() {
+

diff --git a/dev-db/mariadb/mariadb-10.6.11-r3.ebuild 
b/dev-db/mariadb/mariadb-10.6.11-r4.ebuild
similarity index 99%
rename from dev-db/mariadb/mariadb-10.6.11-r3.ebuild
rename to dev-db/mariadb/mariadb-10.6.11-r4.ebuild
index 10e0da46a123..a9cf9c365dc7 100644
--- a/dev-db/mariadb/mariadb-10.6.11-r3.ebuild
+++ b/dev-db/mariadb/mariadb-10.6.11-r4.ebuild
@@ -128,6 +128,12 @@ RDEPEND="${COMMON_DEPEND}
 # dev-perl/DBD-mysql is needed by some scripts installed by MySQL
 PDEPEND="perl? ( >=dev-perl/DBD-mysql-2.9004 )"
 
+QA_CONFIG_IMPL_DECL_SKIP=(
+       # These don't exist on Linux
+       pthread_threadid_np
+       getthrid
+)
+
 mysql_init_vars() {
        MY_SHAREDSTATEDIR=${MY_SHAREDSTATEDIR="${EPREFIX}/usr/share/mariadb"}
        MY_SYSCONFDIR=${MY_SYSCONFDIR="${EPREFIX}/etc/mysql"}
@@ -211,6 +217,7 @@ src_prepare() {
        eapply "${FILESDIR}"/${PN}-10.6.11-gssapi.patch
        eapply "${FILESDIR}"/${PN}-10.6.11-include.patch
        eapply "${FILESDIR}"/${PN}-10.6.11-gcc-13.patch
+       eapply "${FILESDIR}"/${PN}-10.6.11-configure-clang16.patch
 
        eapply_user
 

diff --git a/dev-db/mariadb/mariadb-10.6.12-r1.ebuild 
b/dev-db/mariadb/mariadb-10.6.12-r1.ebuild
index a79aca4cedf2..9fe113c8b843 100644
--- a/dev-db/mariadb/mariadb-10.6.12-r1.ebuild
+++ b/dev-db/mariadb/mariadb-10.6.12-r1.ebuild
@@ -129,6 +129,12 @@ RDEPEND="${COMMON_DEPEND}
 # dev-perl/DBD-mysql is needed by some scripts installed by MySQL
 PDEPEND="perl? ( >=dev-perl/DBD-mysql-2.9004 )"
 
+QA_CONFIG_IMPL_DECL_SKIP=(
+       # These don't exist on Linux
+       pthread_threadid_np
+       getthrid
+)
+
 mysql_init_vars() {
        MY_SHAREDSTATEDIR=${MY_SHAREDSTATEDIR="${EPREFIX}/usr/share/mariadb"}
        MY_SYSCONFDIR=${MY_SYSCONFDIR="${EPREFIX}/etc/mysql"}
@@ -212,6 +218,7 @@ src_prepare() {
        eapply "${FILESDIR}"/${PN}-10.6.11-gssapi.patch
        eapply "${FILESDIR}"/${PN}-10.6.11-include.patch
        eapply "${FILESDIR}"/${PN}-10.6.12-gcc-13.patch
+       eapply "${FILESDIR}"/${PN}-10.6.11-configure-clang16.patch
 
        eapply_user
 

Reply via email to