commit:     9923d7331d1189316726fcab47ba89a2623f82ab
Author:     brahmajit das <brahmajit.xyz <AT> gmail <DOT> com>
AuthorDate: Tue Jun 21 05:48:08 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Jun 24 05:26:09 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9923d733

net-fs/samba: Apply the netdb defines patch

NETDB_INTERNAL and NETDB_INTERNAL are not defined in musl as a result
the build is failing.

Acked-by: David Seifert <soap <AT> gentoo.org>
Closes: https://bugs.gentoo.org/835017
Closes: https://bugs.gentoo.org/832629
Signed-off-by: brahmajit das <brahmajit.xyz <AT> gmail.com>
Closes: https://github.com/gentoo/gentoo/pull/26016
Signed-off-by: Sam James <sam <AT> gentoo.org>

 net-fs/samba/files/samba-4.16.1-netdb-defines.patch | 21 +++++++++++++++++++++
 net-fs/samba/samba-4.16.1.ebuild                    |  1 +
 2 files changed, 22 insertions(+)

diff --git a/net-fs/samba/files/samba-4.16.1-netdb-defines.patch 
b/net-fs/samba/files/samba-4.16.1-netdb-defines.patch
new file mode 100644
index 000000000000..40aeaa22bfae
--- /dev/null
+++ b/net-fs/samba/files/samba-4.16.1-netdb-defines.patch
@@ -0,0 +1,21 @@
+# Define NETDB_INTERNAL and NETDB_SUCCESS if they are not defined
+#
+# Gentoo bug 832629 and 835017
+
+--- a/nsswitch/wins.c
++++ b/nsswitch/wins.c
+@@ -40,6 +40,14 @@ static pthread_mutex_t wins_nss_mutex = 
PTHREAD_MUTEX_INITIALIZER;
+ #define INADDRSZ 4
+ #endif
+
++#ifndef NETDB_INTERNAL
++#define NETDB_INTERNAL -1
++#endif
++
++#ifndef NETDB_SUCCESS
++#define NETDB_SUCCESS 0
++#endif
++
+ _PUBLIC_ON_LINUX_
+ NSS_STATUS _nss_wins_gethostbyname_r(const char *hostname,
+                                    struct hostent *he,

diff --git a/net-fs/samba/samba-4.16.1.ebuild b/net-fs/samba/samba-4.16.1.ebuild
index a7d3fa8bb5d3..8b16a80d66cb 100644
--- a/net-fs/samba/samba-4.16.1.ebuild
+++ b/net-fs/samba/samba-4.16.1.ebuild
@@ -141,6 +141,7 @@ BDEPEND="${PYTHON_DEPS}
 
 PATCHES=(
        "${FILESDIR}/${PN}-4.4.0-pam.patch"
+       "${FILESDIR}/${PN}-4.16.1-netdb-defines.patch"
 )
 
 #CONFDIR="${FILESDIR}/$(get_version_component_range 1-2)"

Reply via email to