commit:     7e90ff22e92462720ad2319bb9b23989755d18ec
Author:     Brahmajit Das <brahmajit.xyz <AT> gmail <DOT> com>
AuthorDate: Tue Sep  3 06:17:46 2024 +0000
Commit:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
CommitDate: Sat Mar 29 16:23:44 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7e90ff22

sys-fs/xfsdump: Fix implicit declaration of function basename

[arthurzam]: undo the revbump (since affects only build failures on
musl), and applied also for newer version 3.2.0.

Closes: https://bugs.gentoo.org/937495
Signed-off-by: Brahmajit Das <brahmajit.xyz <AT> gmail.com>
Closes: https://github.com/gentoo/gentoo/pull/38391
Signed-off-by: Arthur Zamarin <arthurzam <AT> gentoo.org>

 ...fsdump-3.1.12-mimic-basename-for-nonglibc.patch | 42 ++++++++++++++++++++++
 sys-fs/xfsdump/xfsdump-3.1.12.ebuild               |  3 +-
 sys-fs/xfsdump/xfsdump-3.2.0.ebuild                |  3 +-
 3 files changed, 46 insertions(+), 2 deletions(-)

diff --git 
a/sys-fs/xfsdump/files/xfsdump-3.1.12-mimic-basename-for-nonglibc.patch 
b/sys-fs/xfsdump/files/xfsdump-3.1.12-mimic-basename-for-nonglibc.patch
new file mode 100644
index 000000000000..16b5a3ab5617
--- /dev/null
+++ b/sys-fs/xfsdump/files/xfsdump-3.1.12-mimic-basename-for-nonglibc.patch
@@ -0,0 +1,42 @@
+https://bugs.gentoo.org/937495
+From: Brahmajit Das <[email protected]>
+Date: Tue, 3 Sep 2024 06:14:54 +0000
+Subject: [PATCH 1/1] xfsdump: Mimic GNU basename() API for non-glibc library
+ e.g. musl
+
+musl only provides POSIX version of basename and it has also removed
+providing it via string.h header [1] which now results in compile errors
+with newer compilers e.g. clang-18
+
+[1] 
https://git.musl-libc.org/cgit/musl/commit/?id=725e17ed6dff4d0cd22487bb64470881e86a92e7
+
+Please also reffer: https://bugs.gentoo.org/937495
+
+Signed-off-by: Brahmajit Das <[email protected]>
+--- a/common/main.c
++++ b/common/main.c
+@@ -77,6 +77,9 @@
+ #define MINSTACKSZ    0x02000000
+ #define MAXSTACKSZ    0x08000000
+ 
++#if !defined(__GLIBC__)
++#define basename(src) (strrchr(src, '/') ? strrchr(src, '/') + 1 : src)
++#endif
+ 
+ /* declarations of externally defined global symbols 
*************************/
+ 
+--- a/invutil/invidx.c
++++ b/invutil/invidx.c
+@@ -41,6 +41,10 @@
+ #include "stobj.h"
+ #include "timeutil.h"
+ 
++#if !defined(__GLIBC__)
++#define basename(src) (strrchr(src, '/') ? strrchr(src, '/') + 1 : src)
++#endif
++
+ invidx_fileinfo_t *invidx_file;
+ int invidx_numfiles;
+ 
+-- 
+2.46.0

diff --git a/sys-fs/xfsdump/xfsdump-3.1.12.ebuild 
b/sys-fs/xfsdump/xfsdump-3.1.12.ebuild
index c9a1d66eba9e..5128c4f85015 100644
--- a/sys-fs/xfsdump/xfsdump-3.1.12.ebuild
+++ b/sys-fs/xfsdump/xfsdump-3.1.12.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2024 Gentoo Authors
+# Copyright 1999-2025 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=8
@@ -37,6 +37,7 @@ PATCHES=(
 
        "${FILESDIR}"/${PN}-3.1.9-fix-docs.patch
        "${FILESDIR}"/${PN}-3.1.9-skip-inventory-debian-subfolder.patch
+       "${FILESDIR}"/${PN}-3.1.12-mimic-basename-for-nonglibc.patch
 )
 
 src_prepare() {

diff --git a/sys-fs/xfsdump/xfsdump-3.2.0.ebuild 
b/sys-fs/xfsdump/xfsdump-3.2.0.ebuild
index 8b5bdb19a696..c19e15d409d1 100644
--- a/sys-fs/xfsdump/xfsdump-3.2.0.ebuild
+++ b/sys-fs/xfsdump/xfsdump-3.2.0.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2024 Gentoo Authors
+# Copyright 1999-2025 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=8
@@ -37,6 +37,7 @@ PATCHES=(
 
        "${FILESDIR}"/${PN}-3.1.9-fix-docs.patch
        "${FILESDIR}"/${PN}-3.1.9-skip-inventory-debian-subfolder.patch
+       "${FILESDIR}"/${PN}-3.1.12-mimic-basename-for-nonglibc.patch
 )
 
 src_prepare() {

Reply via email to