commit:     fcde99ccaa5d4dc30a1e21f0438fb57d8f886759
Author:     Z. Liu <zhixu.liu <AT> gmail <DOT> com>
AuthorDate: Fri May  2 15:28:23 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun May 11 00:37:06 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fcde99cc

net-fs/cifs-utils: fix build in musl

basename() is defined in <libgen.h> in standard

Closes: https://bugs.gentoo.org/936928
Signed-off-by: Z. Liu <zhixu.liu <AT> gmail.com>
Part-of: https://github.com/gentoo/gentoo/pull/41903
Closes: https://github.com/gentoo/gentoo/pull/41903
Signed-off-by: Sam James <sam <AT> gentoo.org>

 net-fs/cifs-utils/cifs-utils-7.0-r1.ebuild        |  3 +-
 net-fs/cifs-utils/cifs-utils-7.3.ebuild           |  1 +
 net-fs/cifs-utils/files/cifs-utils-7.0-musl.patch | 39 +++++++++++++++++++++++
 3 files changed, 42 insertions(+), 1 deletion(-)

diff --git a/net-fs/cifs-utils/cifs-utils-7.0-r1.ebuild 
b/net-fs/cifs-utils/cifs-utils-7.0-r1.ebuild
index 6c722804a3b5..427fc00cfa1f 100644
--- a/net-fs/cifs-utils/cifs-utils-7.0-r1.ebuild
+++ b/net-fs/cifs-utils/cifs-utils-7.0-r1.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
@@ -46,6 +46,7 @@ PATCHES=(
        "${FILESDIR}/${PN}-6.12-ln_in_destdir.patch" #766594
        "${FILESDIR}/${PN}-6.15-musl.patch"
        "${FILESDIR}/${PN}-7.0-no-clobber-fortify-source.patch"
+       "${FILESDIR}/${PN}-7.0-musl.patch"
 )
 
 pkg_setup() {

diff --git a/net-fs/cifs-utils/cifs-utils-7.3.ebuild 
b/net-fs/cifs-utils/cifs-utils-7.3.ebuild
index 53562db93824..c46b5251d347 100644
--- a/net-fs/cifs-utils/cifs-utils-7.3.ebuild
+++ b/net-fs/cifs-utils/cifs-utils-7.3.ebuild
@@ -44,6 +44,7 @@ DOCS="doc/linux-cifs-client-guide.odt"
 
 PATCHES=(
        "${FILESDIR}/${PN}-7.3-no-clobber-fortify-source.patch"
+       "${FILESDIR}/${PN}-7.0-musl.patch"
 )
 
 pkg_setup() {

diff --git a/net-fs/cifs-utils/files/cifs-utils-7.0-musl.patch 
b/net-fs/cifs-utils/files/cifs-utils-7.0-musl.patch
new file mode 100644
index 000000000000..e7c707ab14f7
--- /dev/null
+++ b/net-fs/cifs-utils/files/cifs-utils-7.0-musl.patch
@@ -0,0 +1,39 @@
+https://lore.kernel.org/linux-cifs/CALMA0xaVdk3qwkb-92QqF2+6z+=oxbbwdr1hyeoe2wuc7jv...@mail.gmail.com/T/#u
+
+From abd3d9a2d4f8a5dc4d90daddc7cf0c62d954f03a Mon Sep 17 00:00:00 2001
+From: "Z. Liu" <[email protected]>
+Date: Fri, 2 May 2025 23:08:41 +0800
+Subject: [PATCH] getcifsacl, setcifsacl: use <libgen.h> for basename
+
+basename() is defined in <libgen.h> only in musl, while glibc defines it
+in <string.h> too, which is not standard behavior.
+
+Signed-off-by: Z. Liu <[email protected]>
+
+diff --git a/getcifsacl.c b/getcifsacl.c
+index 97471e9..6c6356f 100644
+--- a/getcifsacl.c
++++ b/getcifsacl.c
+@@ -33,6 +33,7 @@
+ #include <stdlib.h>
+ #include <stddef.h>
+ #include <errno.h>
++#include <libgen.h>
+ #include <limits.h>
+ #include <ctype.h>
+ #include <linux/limits.h>
+diff --git a/setcifsacl.c b/setcifsacl.c
+index b199118..3cb603c 100644
+--- a/setcifsacl.c
++++ b/setcifsacl.c
+@@ -47,6 +47,7 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <errno.h>
++#include <libgen.h>
+ #include <limits.h>
+ #include <ctype.h>
+ #include <linux/limits.h>
+-- 
+2.45.2
+

Reply via email to