commit:     d1f53d5bae5657db01f6aac127f352e21ccf14eb
Author:     Cristian Othón Martínez Vera <cfuga <AT> cfuga <DOT> mx>
AuthorDate: Fri Jul  4 21:48:04 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Jul  5 04:47:09 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d1f53d5b

sys-process/audit: fix musl build with POSIX basename(3) include

Since musl 1.2.5, ```basename(3)``` is strict-POSIX compliant, and
needs ```#include <libgen.h>```, instead of the GNU version included
with ```<string.h>```

Signed-off-by: Cristian Othón Martínez Vera <cfuga <AT> cfuga.mx>
Part-of: https://github.com/gentoo/gentoo/pull/42873
Closes: https://github.com/gentoo/gentoo/pull/42873
Signed-off-by: Sam James <sam <AT> gentoo.org>

 sys-process/audit/audit-4.0.2-r1.ebuild                 |  4 ++++
 sys-process/audit/files/audit-4.0.1-musl-basename.patch | 14 ++++++++++++++
 2 files changed, 18 insertions(+)

diff --git a/sys-process/audit/audit-4.0.2-r1.ebuild 
b/sys-process/audit/audit-4.0.2-r1.ebuild
index 874b82839ae6..e9627061502f 100644
--- a/sys-process/audit/audit-4.0.2-r1.ebuild
+++ b/sys-process/audit/audit-4.0.2-r1.ebuild
@@ -51,6 +51,10 @@ QA_CONFIG_IMPL_DECL_SKIP=(
        strndupa
 )
 
+PATCHES=(
+       "${FILESDIR}/${PN}-4.0.1-musl-basename.patch"
+)
+
 src_prepare() {
        # audisp-remote moved in multilib_src_install_all
        sed -i \

diff --git a/sys-process/audit/files/audit-4.0.1-musl-basename.patch 
b/sys-process/audit/files/audit-4.0.1-musl-basename.patch
new file mode 100644
index 000000000000..08b74caf8ac2
--- /dev/null
+++ b/sys-process/audit/files/audit-4.0.1-musl-basename.patch
@@ -0,0 +1,14 @@
+Since musl 1.2.5, basename(3) is strict-POSIX compliant, and
+needs #include <libgen.h>, instead of the GNU version included
+with <string.h>
+
+--- a/audisp/plugins/zos-remote/zos-remote-config.c
++++ b/audisp/plugins/zos-remote/zos-remote-config.c
+@@ -32,6 +32,7 @@
+ #include <ctype.h>
+ #include <unistd.h>
+ #include <stdlib.h>
++#include <libgen.h>
+ #include "zos-remote-log.h"
+ 
+ /* Local prototypes */

Reply via email to