commit:     4a5a1d52e9a5ebdd5e8011ea933765bda0c838b6
Author:     brahmajit das <listout <AT> protonmail <DOT> com>
AuthorDate: Sat Jan 21 16:35:05 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Tue Jan 31 05:55:20 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4a5a1d52

net-wireless/bluez: fix 'MAX_INPUT' undeclared in musl

musl does provide _POSIX_MAX_INPUT, but no MAX_INPUT out of the box.
This commit assigns _POSIX_MAX_INPUT to MAX_INPUT.

Closes: https://bugs.gentoo.org/888467
Signed-off-by: brahmajit das <listout <AT> protonmail.com>
Closes: https://github.com/gentoo/gentoo/pull/29209
Signed-off-by: Sam James <sam <AT> gentoo.org>

 net-wireless/bluez/bluez-5.66-r1.ebuild               |  4 ++++
 .../bluez/files/bluez-5.66-musl-max-input.patch       | 19 +++++++++++++++++++
 2 files changed, 23 insertions(+)

diff --git a/net-wireless/bluez/bluez-5.66-r1.ebuild 
b/net-wireless/bluez/bluez-5.66-r1.ebuild
index 4278549b3ee0..639e234d67c2 100644
--- a/net-wireless/bluez/bluez-5.66-r1.ebuild
+++ b/net-wireless/bluez/bluez-5.66-r1.ebuild
@@ -77,6 +77,10 @@ PATCHES=(
 
        # Fixed in next release
        "${FILESDIR}"/${P}-transient-hostname-fix.patch
+
+       # 
https://github.com/nilfs-dev/nilfs-utils/commit/115fe4b976858c487cf83065f513d8626089579a
+       # https://bugs.gentoo.org/888467
+       "${FILESDIR}"/${PN}-5.66-musl-max-input.patch
 )
 
 pkg_setup() {

diff --git a/net-wireless/bluez/files/bluez-5.66-musl-max-input.patch 
b/net-wireless/bluez/files/bluez-5.66-musl-max-input.patch
new file mode 100644
index 000000000000..d8bdb3316e49
--- /dev/null
+++ b/net-wireless/bluez/files/bluez-5.66-musl-max-input.patch
@@ -0,0 +1,19 @@
+# 
https://lore.kernel.org/linux-bluetooth/20230131055258.3311810-1-...@gentoo.org/T/#u
+# musl does provide _POSIX_MAX_INPUT, but no MAX_INPUT out of the box.
+# This patch assigns _POSIX_MAX_INPUT to MAX_INPUT.
+# Please refer: 
https://github.com/nilfs-dev/nilfs-utils/commit/115fe4b976858c487cf83065f513d8626089579a
+# https://bugs.gentoo.org/888467
+--- a/src/shared/util.c
++++ b/src/shared/util.c
+@@ -28,6 +28,11 @@
+ #include <sys/random.h>
+ #endif
+
++/* define MAX_INPUT for musl */
++#ifndef MAX_INPUT
++#define MAX_INPUT _POSIX_MAX_INPUT
++#endif
++
+ #include "src/shared/util.h"
+
+ void *util_malloc(size_t size)

Reply via email to