diff options
Diffstat (limited to 'net-wireless/bluez')
-rw-r--r-- | net-wireless/bluez/Manifest | 2 | ||||
-rw-r--r-- | net-wireless/bluez/bluez-5.65-r1.ebuild (renamed from net-wireless/bluez/bluez-5.65.ebuild) | 5 | ||||
-rw-r--r-- | net-wireless/bluez/bluez-5.66-r1.ebuild (renamed from net-wireless/bluez/bluez-5.64.ebuild) | 39 | ||||
-rw-r--r-- | net-wireless/bluez/files/bluez-5.63-musl-limits.patch | 24 | ||||
-rw-r--r-- | net-wireless/bluez/files/bluez-5.66-musl-max-input.patch | 19 | ||||
-rw-r--r-- | net-wireless/bluez/files/bluez-5.66-power-state-adapter-property.patch | 28 | ||||
-rw-r--r-- | net-wireless/bluez/files/bluez-5.66-transient-hostname-fix.patch | 185 |
7 files changed, 260 insertions, 42 deletions
diff --git a/net-wireless/bluez/Manifest b/net-wireless/bluez/Manifest index 710de1c38b6..17edbb3ec39 100644 --- a/net-wireless/bluez/Manifest +++ b/net-wireless/bluez/Manifest @@ -1,3 +1,3 @@ -DIST bluez-5.64.tar.xz 2175148 BLAKE2B 828c620330d1993d5c5c2a865f2d27a29425e3583aac01a1a782290a805ee0fd6456b6832c804ad323dd8714fa9329487b2616ed08f1f491ea29403ee05dba2d SHA512 f11f9974b29c5c6fce3890d7e42425c1cb02e42c1b8f49c5cc4b249234e67b64317d0e5e82721e2fbf1b53269c8569a9c869d59ce42b5e927f6622f0753e53cd DIST bluez-5.65.tar.xz 2208100 BLAKE2B 9d2937e2e14d8d8945183c6436921d9d16a6d3bcb5dbe3e2493554fbc4972bb4c006aabc793c9fb8eae47a7e9f29ae9fdf47551dfc0a238e86f5a76ce7436ae2 SHA512 c20c09a1a75053c77d73b3ce15ac7fd321eb6df5ca1646d57c6848b87c0c9957908bc17dd928da4ef2aacfc8667877cbc7511c1ba43db839bfa9bf1fb8269907 +DIST bluez-5.66.tar.xz 2257288 BLAKE2B af1911cf590461a874daa16bedb8a021a3b2c2af3254360c035d2180e0f355372651bd41da342c26e6d9631d726dd08e0d6a83a22069333b94b6fce6d546718c SHA512 ed0994932687eacf27207867366671b323671f5d5199daf36ea5eff8f254f2bc99ef989ef7df9883b35c06f2af60452be8bad0a06109428a4717cf2b247b4865 DIST power-state-adapter-property.patch 22488 BLAKE2B a46173c0ebe4f4822c67c2f8f2f3e67dab261753f64204f1a61665c3bba1d7a10e0f8511b38ce273d986490ffd262a737bee82694909683df7386b2015301607 SHA512 b039a578454681f291dc3b04079c8d0151b13a84b4b013e290aa3c28aba1538cef2d9e9aadfe88a0dbfb8e4cea1c251cb5043f4175fb32d53526f7b82de0451a diff --git a/net-wireless/bluez/bluez-5.65.ebuild b/net-wireless/bluez/bluez-5.65-r1.ebuild index c24fc51d0bc..688d93d9f93 100644 --- a/net-wireless/bluez/bluez-5.65.ebuild +++ b/net-wireless/bluez/bluez-5.65-r1.ebuild @@ -1,8 +1,8 @@ -# Copyright 1999-2022 Gentoo Authors +# Copyright 1999-2023 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=8 -PYTHON_COMPAT=( python3_{8..10} ) +PYTHON_COMPAT=( python3_{9..10} ) inherit autotools linux-info python-single-r1 readme.gentoo-r1 systemd udev multilib-minimal @@ -55,6 +55,7 @@ DEPEND=" udev? ( >=virtual/udev-172 ) " RDEPEND="${DEPEND} + deprecated? ( !net-wireless/bluez-hcidump ) selinux? ( sec-policy/selinux-bluetooth ) test-programs? ( ${TEST_DEPS} ) " diff --git a/net-wireless/bluez/bluez-5.64.ebuild b/net-wireless/bluez/bluez-5.66-r1.ebuild index d70099f1705..639e234d67c 100644 --- a/net-wireless/bluez/bluez-5.64.ebuild +++ b/net-wireless/bluez/bluez-5.66-r1.ebuild @@ -1,10 +1,10 @@ -# Copyright 1999-2022 Gentoo Authors +# Copyright 1999-2023 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=8 -PYTHON_COMPAT=( python3_{8..10} ) +PYTHON_COMPAT=( python3_{9..11} ) -inherit autotools linux-info python-single-r1 readme.gentoo-r1 systemd udev multilib-minimal +inherit autotools linux-info python-single-r1 systemd udev multilib-minimal #readme.gentoo-r1 DESCRIPTION="Bluetooth Tools and System Daemons for Linux" HOMEPAGE="http://www.bluez.org" @@ -12,7 +12,7 @@ SRC_URI="https://www.kernel.org/pub/linux/bluetooth/${P}.tar.xz" LICENSE="GPL-2+ LGPL-2.1+" SLOT="0/3" -KEYWORDS="amd64 arm arm64 ~hppa ~mips ppc ppc64 ~riscv x86" +KEYWORDS="amd64 arm arm64 ~hppa ~loong ~mips ppc ppc64 ~riscv x86" IUSE="btpclient cups doc debug deprecated extra-tools experimental +mesh midi +obex +readline selinux systemd test test-programs +udev" # Since this release all remaining extra-tools need readline support, but this could @@ -54,6 +54,7 @@ DEPEND=" udev? ( >=virtual/udev-172 ) " RDEPEND="${DEPEND} + deprecated? ( !net-wireless/bluez-hcidump ) selinux? ( sec-policy/selinux-bluetooth ) test-programs? ( ${TEST_DEPS} ) " @@ -67,12 +68,19 @@ PATCHES=( # https://github.com/bluez/bluez/issues/268 "${FILESDIR}"/${PN}-udevadm-path-r1.patch - # https://github.com/bluez/bluez/issues/267 - "${FILESDIR}"/${PN}-5.63-musl-limits.patch - # Fedora patches # http://www.spinics.net/lists/linux-bluetooth/msg40136.html "${FILESDIR}"/0001-obex-Use-GLib-helper-function-to-manipulate-paths.patch + + # https://lore.kernel.org/linux-bluetooth/20220901110719.176944-1-hadess@hadess.net/T/#m9c08d004cd5422783ee1d93154f42303bba9169f + "${FILESDIR}"/${PN}-5.66-power-state-adapter-property.patch + + # 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() { @@ -273,14 +281,15 @@ multilib_src_install_all() { einstalldocs use doc && dodoc doc/*.txt + # Upstream dropped the example files # Install .json files as examples to be used by meshctl - if use mesh; then - dodoc tools/mesh-gatt/*.json - local DOC_CONTENTS="Some example .json files were installed into - /usr/share/doc/${PF} to be used with meshctl. Feel free to - uncompress and copy them to ~/.config/meshctl to use them." - readme.gentoo_create_doc - fi + #if use mesh; then + #dodoc tools/mesh-gatt/*.json + # local DOC_CONTENTS="Some example .json files were installed into + # /usr/share/doc/${PF} to be used with meshctl. Feel free to + # uncompress and copy them to ~/.config/meshctl to use them." + # readme.gentoo_create_doc + #fi } pkg_postinst() { @@ -288,7 +297,7 @@ pkg_postinst() { systemd_reenable bluetooth.service has_version net-dialup/ppp || elog "To use dial up networking you must install net-dialup/ppp" - use mesh && readme.gentoo_print_elog + #use mesh && readme.gentoo_print_elog } pkg_postrm() { diff --git a/net-wireless/bluez/files/bluez-5.63-musl-limits.patch b/net-wireless/bluez/files/bluez-5.63-musl-limits.patch deleted file mode 100644 index ebdffc3270b..00000000000 --- a/net-wireless/bluez/files/bluez-5.63-musl-limits.patch +++ /dev/null @@ -1,24 +0,0 @@ -From e5dcac6abd6129829c4983d6635916cee8f1a627 Mon Sep 17 00:00:00 2001 -From: Jory Pratt <anarchy@gentoo.org> -Date: Sun, 12 Sep 2021 09:46:11 -0500 -Subject: [PATCH] include limits.h for PATH_MAX for musl support - ---- - tools/mesh-cfgtest.c | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/tools/mesh-cfgtest.c b/tools/mesh-cfgtest.c -index fa0474f..bfc8e1b 100644 ---- a/tools/mesh-cfgtest.c -+++ b/tools/mesh-cfgtest.c -@@ -26,6 +26,7 @@ - #include <time.h> - #include <unistd.h> - #include <sys/stat.h> -+#include <limits.h> - - #include <ell/ell.h> - --- -2.32.0 - 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 00000000000..d8bdb3316e4 --- /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-sam@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) diff --git a/net-wireless/bluez/files/bluez-5.66-power-state-adapter-property.patch b/net-wireless/bluez/files/bluez-5.66-power-state-adapter-property.patch new file mode 100644 index 00000000000..566d7c08b59 --- /dev/null +++ b/net-wireless/bluez/files/bluez-5.66-power-state-adapter-property.patch @@ -0,0 +1,28 @@ +From 70309219acd4c81e3a9e2b3652d2d93eb08b0aee Mon Sep 17 00:00:00 2001 +From: Bastien Nocera <hadess@hadess.net> +Date: Wed, 31 Aug 2022 11:16:34 +0200 +Subject: [PATCH 6/6] adapter: Remove experimental flag for PowerState + +Now that the feature has been tested, that the API is deemed adequate +and the reliability sufficient. +--- + src/adapter.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/src/adapter.c b/src/adapter.c +index 8fb2acdc8..841096d7f 100644 +--- a/src/adapter.c ++++ b/src/adapter.c +@@ -3864,8 +3864,7 @@ static const GDBusPropertyTable adapter_properties[] = { + { "Alias", "s", property_get_alias, property_set_alias }, + { "Class", "u", property_get_class }, + { "Powered", "b", property_get_powered, property_set_powered }, +- { "PowerState", "s", property_get_power_state, NULL, NULL, +- G_DBUS_PROPERTY_FLAG_EXPERIMENTAL }, ++ { "PowerState", "s", property_get_power_state }, + { "Discoverable", "b", property_get_discoverable, + property_set_discoverable }, + { "DiscoverableTimeout", "u", property_get_discoverable_timeout, +-- +2.37.2 + diff --git a/net-wireless/bluez/files/bluez-5.66-transient-hostname-fix.patch b/net-wireless/bluez/files/bluez-5.66-transient-hostname-fix.patch new file mode 100644 index 00000000000..fef2776f7a0 --- /dev/null +++ b/net-wireless/bluez/files/bluez-5.66-transient-hostname-fix.patch @@ -0,0 +1,185 @@ +From e515f4b6e25c971c47ab79e9cbdfa17119bbde23 Mon Sep 17 00:00:00 2001 +From: Bastien Nocera <hadess@hadess.net> +Date: Wed, 9 Nov 2022 16:17:55 +0100 +Subject: [PATCH 1/2] hostname: Add '' around printed strings + +Otherwise we can't see whether the string is nul, or empty. +--- + plugins/hostname.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/plugins/hostname.c b/plugins/hostname.c +index 1a9513adb..14b6450b5 100644 +--- a/plugins/hostname.c ++++ b/plugins/hostname.c +@@ -128,7 +128,7 @@ static void property_changed(GDBusProxy *proxy, const char *name, + + dbus_message_iter_get_basic(iter, &str); + +- DBG("pretty hostname: %s", str); ++ DBG("pretty hostname: '%s'", str); + + g_free(pretty_hostname); + pretty_hostname = g_strdup(str); +@@ -146,7 +146,7 @@ static void property_changed(GDBusProxy *proxy, const char *name, + + dbus_message_iter_get_basic(iter, &str); + +- DBG("static hostname: %s", str); ++ DBG("static hostname: '%s'", str); + + g_free(static_hostname); + static_hostname = g_strdup(str); +@@ -165,7 +165,7 @@ static void property_changed(GDBusProxy *proxy, const char *name, + + dbus_message_iter_get_basic(iter, &str); + +- DBG("chassis: %s", str); ++ DBG("chassis: '%s'", str); + + for (i = 0; chassis_table[i].chassis; i++) { + if (strcmp(chassis_table[i].chassis, str)) +-- +2.37.3 + + +From e2b2b1675f310023862319ea10ffd205a75cc0cb Mon Sep 17 00:00:00 2001 +From: Bastien Nocera <hadess@hadess.net> +Date: Wed, 9 Nov 2022 16:17:56 +0100 +Subject: [PATCH 2/2] hostname: Fallback to transient hostname + +After pretty hostname, and static hostname, also support transient +hostname as a last resort before 'BlueZ X.XX'. + +This happens on Fedora's Workstation installation as it calls +"hostnamectl set-hostname" on startup. In Fedora Silverblue, the default +hostname is set as fedora in /etc/os-release. + +In both cases, we should fall back to that transient hostname, as bad as +it could be. + +Note that the transient hostname needs to be monitored through the +kernel directly, as explained in: +https://www.freedesktop.org/software/systemd/man/org.freedesktop.hostname1.html +--- + plugins/hostname.c | 57 ++++++++++++++++++++++++++++++++++++++++++++-- + 1 file changed, 55 insertions(+), 2 deletions(-) + +diff --git a/plugins/hostname.c b/plugins/hostname.c +index 14b6450b5..51707f07d 100644 +--- a/plugins/hostname.c ++++ b/plugins/hostname.c +@@ -16,6 +16,8 @@ + #include <stdint.h> + #include <stdlib.h> + #include <string.h> ++#include <fcntl.h> ++#include <sys/utsname.h> + + #include "lib/bluetooth.h" + #include "lib/sdp.h" +@@ -44,8 +46,10 @@ + static uint8_t major_class = MAJOR_CLASS_MISCELLANEOUS; + static uint8_t minor_class = MINOR_CLASS_UNCATEGORIZED; + +-static char *pretty_hostname = NULL; +-static char *static_hostname = NULL; ++static char *pretty_hostname = NULL; ++static char *static_hostname = NULL; ++static char *transient_hostname = NULL; ++static guint hostname_id = 0; + + /* + * Fallback to static hostname only if empty pretty hostname was already +@@ -60,6 +64,10 @@ static const char *get_hostname(void) + if (static_hostname && + g_str_equal(static_hostname, "") == FALSE) + return static_hostname; ++ ++ if (transient_hostname && ++ g_str_equal(transient_hostname, "") == FALSE) ++ return transient_hostname; + } + + return NULL; +@@ -181,6 +189,32 @@ static void property_changed(GDBusProxy *proxy, const char *name, + } + } + ++static void read_transient_hostname(void) ++{ ++ struct utsname u; ++ ++ if (uname(&u) != 0) { ++ g_free(transient_hostname); ++ transient_hostname = NULL; ++ DBG("failed to read transient hostname"); ++ return; ++ } ++ ++ g_free(transient_hostname); ++ transient_hostname = g_strdup(u.nodename); ++ ++ DBG("read transient hostname: '%s'", transient_hostname); ++} ++ ++static gboolean hostname_cb(GIOChannel *io, GIOCondition cond, ++ gpointer user_data) ++{ ++ DBG("transient hostname changed"); ++ read_transient_hostname(); ++ adapter_foreach(update_class, NULL); ++ return TRUE; ++} ++ + static int hostname_probe(struct btd_adapter *adapter) + { + DBG(""); +@@ -261,9 +295,11 @@ static GDBusProxy *hostname_proxy = NULL; + static int hostname_init(void) + { + DBusConnection *conn = btd_get_dbus_connection(); ++ int fd; + int err; + + read_dmi_fallback(); ++ read_transient_hostname(); + + hostname_client = g_dbus_client_new(conn, "org.freedesktop.hostname1", + "/org/freedesktop/hostname1"); +@@ -289,6 +325,17 @@ static int hostname_init(void) + hostname_client = NULL; + } + ++ fd = open("/proc/sys/kernel/hostname", O_RDONLY); ++ if (fd < 0) { ++ error("open(/proc/sys/kernel/hostname): %s (%d)", ++ strerror(errno), errno); ++ } else { ++ GIOChannel *io = g_io_channel_unix_new(fd); ++ ++ hostname_id = g_io_add_watch(io, G_IO_ERR, hostname_cb, NULL); ++ g_io_channel_unref(io); ++ } ++ + return err; + } + +@@ -306,8 +353,14 @@ static void hostname_exit(void) + hostname_client = NULL; + } + ++ if (hostname_id != 0) { ++ g_source_remove(hostname_id); ++ hostname_id = 0; ++ } ++ + g_free(pretty_hostname); + g_free(static_hostname); ++ g_free(transient_hostname); + } + + BLUETOOTH_PLUGIN_DEFINE(hostname, VERSION, BLUETOOTH_PLUGIN_PRIORITY_DEFAULT, +-- +2.37.3 + |