public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: net-wireless/bluez/, net-wireless/bluez/files/
@ 2016-04-09 10:49 Pacho Ramos
  0 siblings, 0 replies; 22+ messages in thread
From: Pacho Ramos @ 2016-04-09 10:49 UTC (permalink / raw
  To: gentoo-commits

commit:     309c67f3528e62d65500d96ff47b4e110ba50c69
Author:     Pacho Ramos <pacho <AT> gentoo <DOT> org>
AuthorDate: Sat Apr  9 10:48:15 2016 +0000
Commit:     Pacho Ramos <pacho <AT> gentoo <DOT> org>
CommitDate: Sat Apr  9 10:49:32 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=309c67f3

net-wireless/bluez: Version bump (#579276 by Lars Wendler (Polynomial-C) and Aidan Thornton), fix systemd macro bogus expansion (#527432 by Mike Gilbert)

Package-Manager: portage-2.2.28

 net-wireless/bluez/Manifest                       |   1 +
 net-wireless/bluez/bluez-5.39.ebuild              | 235 ++++++++++++++++++++++
 net-wireless/bluez/files/bluez-udevadm-path.patch |   4 +-
 net-wireless/bluez/metadata.xml                   |   1 +
 4 files changed, 239 insertions(+), 2 deletions(-)

diff --git a/net-wireless/bluez/Manifest b/net-wireless/bluez/Manifest
index e9f3a01..2a66298 100644
--- a/net-wireless/bluez/Manifest
+++ b/net-wireless/bluez/Manifest
@@ -2,3 +2,4 @@ DIST bluez-4.101-patches.tar.xz 12380 SHA256 ea4b837245080ebe904fe4f338cd3c8c137
 DIST bluez-4.101.tar.xz 887236 SHA256 41f9578bef39b8c94a2d6ddeaa556afd22d136936d0f03100e422fe970a45a7d SHA512 c8a88fa6948e43c81687047856806c9dc576d3223371947b496f228dec2b2614d1c5a8ff587e9f26eec44843a50503c55861f9fa736fdba43b2364f663f0cb0d WHIRLPOOL 0c4f163e4f4d0ba8f7928f5330ac3fd5f204c299346c59e73b64ebb331b0887a2b01e8ed6f4e6ae91f826a0431df4f97fe3a0900fa6013ae66fd755aaa136196
 DIST bluez-5.35.tar.xz 1643068 SHA256 1afee054644a8b1753ac98d7ad5cd95681a38f5c4cbb1b4bb3ceaa078bf8f0e2 SHA512 33850a01e135f14015295f0eb9b578c515d180d24441b89dff545ec7c0ce8dad5fa321e20918ed6285edaa386375b4ed5688cb17bbfaf4db0742f6d6a72eec6d WHIRLPOOL e334e0e9b37f823eb348cf1679e010567893a73941533a5dc12b598f3b3c845d82f15b3b79e106a7fc4c4344a204a2205fa96509e61d7e61b6ec9f413d650356
 DIST bluez-5.37.tar.xz 1657760 SHA256 c14ba9ddcb0055522073477b8fd8bf1ddf5d219e75fdfd4699b7e0ce5350d6b0 SHA512 e9af3b1dd079185425db10630fefbb66c26f398f21edb0c213baba9599f73715ca36f405a3f9d9572e6c55b7d3d25a4cdc18668c6eb439422f637e64798a28e9 WHIRLPOOL 1697a379d944978193db51a50c19a10fb27aa4e57ee9793563ba59b25de6388dfb4847c1a851fe1467d2521f14b2b9655208b8cef0cd5e44604bc0b26beb0c2b
+DIST bluez-5.39.tar.xz 1659576 SHA256 21d1bc9150d3576296595217efb98a746b592389d25d5637e8bee5da7272593b SHA512 a0c43d0de4dcbfa20bbfe34e805a60703f4b94d0aa6c1d128a0917dfaa490593b26eb555b0a343ff44d1f94349b61776189438039e489ddcf8fe107354740230 WHIRLPOOL da299f8556418cf38d5a05b91079fdb6ff85761127d4708783bcd97fa4502e208187c013b1d8622688b438308506fbb06732426c35f6fedc2fe25cfd68a93486

diff --git a/net-wireless/bluez/bluez-5.39.ebuild b/net-wireless/bluez/bluez-5.39.ebuild
new file mode 100644
index 0000000..c379ceb
--- /dev/null
+++ b/net-wireless/bluez/bluez-5.39.ebuild
@@ -0,0 +1,235 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=6
+PYTHON_COMPAT=( python3_{4,5} )
+
+inherit autotools eutils multilib python-single-r1 readme.gentoo-r1 systemd udev user multilib-minimal
+
+DESCRIPTION="Bluetooth Tools and System Daemons for Linux"
+HOMEPAGE="http://www.bluez.org"
+SRC_URI="mirror://kernel/linux/bluetooth/${P}.tar.xz"
+
+LICENSE="GPL-2+ LGPL-2.1+"
+SLOT="0/3"
+KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~mips ~ppc ~ppc64 ~x86"
+
+IUSE="cups doc debug deprecated extra-tools experimental +obex +readline selinux systemd test test-programs +udev"
+REQUIRED_USE="
+	test? ( ${PYTHON_REQUIRED_USE} )
+	test-programs? ( ${PYTHON_REQUIRED_USE} )
+"
+
+CDEPEND="
+	>=dev-libs/glib-2.28:2
+	>=sys-apps/dbus-1.6:=
+	>=sys-apps/hwids-20121202.2
+	cups? ( net-print/cups:= )
+	obex? ( dev-libs/libical:= )
+	readline? ( sys-libs/readline:= )
+	systemd? ( sys-apps/systemd )
+	udev? ( >=virtual/udev-172 )
+"
+TEST_DEPS="${PYTHON_DEPS}
+	>=dev-python/dbus-python-1[${PYTHON_USEDEP}]
+	dev-python/pygobject:3[${PYTHON_USEDEP}]
+"
+
+DEPEND="${CDEPEND}
+	virtual/pkgconfig
+	test? (	${TEST_DEPS} )
+"
+RDEPEND="${CDEPEND}
+	selinux? ( sec-policy/selinux-bluetooth )
+	test-programs? ( ${TEST_DEPS} )
+"
+DOC_CONTENTS="
+	If you want to use rfcomm as a normal user, you need to add the user
+	to the uucp group.
+"
+
+PATCHES=(
+	# Use static group "plugdev" if there is no ConsoleKit (or systemd logind)
+	"${FILESDIR}"/bluez-plugdev.patch
+
+	# Try both udevadm paths to cover udev/systemd vs. eudev locations (#539844)
+	# http://www.spinics.net/lists/linux-bluetooth/msg58739.html
+	"${FILESDIR}"/bluez-udevadm-path.patch
+
+	# build: Quote systemd variable names, bug #527432
+	"${FILESDIR}"/bluez-5.39-systemd-quote.patch
+
+	# http://article.gmane.org/gmane.linux.bluez.kernel/67230
+	# Fedora patches
+	# http://www.spinics.net/lists/linux-bluetooth/msg38490.html
+	"${FILESDIR}"/0001-Allow-using-obexd-without-systemd-in-the-user-sessio.patch
+
+	# http://www.spinics.net/lists/linux-bluetooth/msg40136.html
+	"${FILESDIR}"/0001-obex-Use-GLib-helper-function-to-manipulate-paths.patch
+
+	# http://www.spinics.net/lists/linux-bluetooth/msg41264.html
+	"${FILESDIR}"/0002-autopair-Don-t-handle-the-iCade.patch
+
+	# ???
+	"${FILESDIR}"/0004-agent-Assert-possible-infinite-loop.patch
+)
+
+pkg_setup() {
+	enewgroup plugdev
+
+	if use test || use test-programs; then
+		python-single-r1_pkg_setup
+	fi
+
+	if ! use udev; then
+		ewarn
+		ewarn "You are installing ${PN} with USE=-udev. This means various bluetooth"
+		ewarn "devices and adapters from Apple, Dell, Logitech etc. will not work,"
+		ewarn "and hid2hci will not be available."
+		ewarn
+	fi
+}
+
+src_prepare() {
+	default
+
+	if use cups; then
+		sed -i \
+			-e "s:cupsdir = \$(libdir)/cups:cupsdir = $(cups-config --serverbin):" \
+			Makefile.{in,tools} || die
+	fi
+
+	eautoreconf
+
+	multilib_copy_sources
+}
+
+multilib_src_configure() {
+	local myconf=(
+		# readline is automagic when client is enabled
+		# --enable-client always needs readline, bug #504038
+		ac_cv_header_readline_readline_h=$(multilib_native_usex readline)
+	)
+
+	if ! multilib_is_native_abi; then
+		myconf+=(
+			# deps not used for the library
+			{DBUS,GLIB}_{CFLAGS,LIBS}=' '
+		)
+	fi
+
+	econf \
+		--localstatedir=/var \
+		--disable-android \
+		--enable-datafiles \
+		--enable-experimental \
+		--enable-optimization \
+		$(use_enable debug) \
+		--enable-pie \
+		--enable-threads \
+		--enable-library \
+		--enable-tools \
+		--enable-manpages \
+		--enable-monitor \
+		--with-systemdsystemunitdir="$(systemd_get_systemunitdir)" \
+		$(multilib_native_use_enable cups) \
+		$(multilib_native_use_enable deprecated) \
+		$(multilib_native_use_enable experimental) \
+		$(multilib_native_use_enable obex) \
+		$(multilib_native_use_enable readline client) \
+		$(multilib_native_use_enable systemd) \
+		$(multilib_native_use_enable test-programs test) \
+		$(multilib_native_use_enable udev) \
+		$(multilib_native_use_enable udev sixaxis)
+}
+
+multilib_src_compile() {
+	if multilib_is_native_abi; then
+		default
+	else
+		emake -f Makefile -f - libs \
+			<<<'libs: $(lib_LTLIBRARIES)'
+	fi
+}
+
+multilib_src_test() {
+	multilib_is_native_abi && default
+}
+
+multilib_src_install() {
+	if multilib_is_native_abi; then
+		emake DESTDIR="${D}" install
+
+		# Only install extra-tools when relevant USE flag is enabled
+		if use extra-tools; then
+			ewarn "Upstream doesn't support using this tools and their bugs are"
+			ewarn "likely to be ignored forever, also that tools can break"
+			ewarn "without previous announcement."
+			ewarn "Upstream also states all this tools are not really needed,"
+			ewarn "then, if you still need to rely on them, you must ask them"
+			ewarn "to either install that tool by default or add the needed"
+			ewarn "functionality to the existing 'official' tools."
+			ewarn "Please report this issues to:"
+			ewarn "http://www.bluez.org/development/lists/"
+
+			# Upstream doesn't install this, bug #524640
+			# http://permalink.gmane.org/gmane.linux.bluez.kernel/53115
+			# http://comments.gmane.org/gmane.linux.bluez.kernel/54564
+			# gatttool is only built with readline, bug #530776
+			if use readline; then
+				dobin attrib/gatttool
+				dobin tools/btmgmt
+			fi
+			dobin tools/hex2hcd
+		fi
+
+		# Unittests are not that useful once installed, so make them optional
+		if use test-programs; then
+			python_fix_shebang "${ED}"/usr/$(get_libdir)/bluez/test
+			for i in $(find "${ED}"/usr/$(get_libdir)/bluez/test -maxdepth 1 -type f ! -name "*.*"); do
+				dosym "${i}" /usr/bin/bluez-"${i##*/}"
+			done
+		fi
+	else
+		emake DESTDIR="${D}" \
+			install-includeHEADERS \
+			install-libLTLIBRARIES \
+			install-pkgconfigDATA
+	fi
+}
+
+multilib_src_install_all() {
+	prune_libtool_files --modules
+
+	keepdir /var/lib/bluetooth
+
+	# Upstream don't want people to play with them
+	# But we keep installing them due to 'historical' reasons
+	insinto /etc/bluetooth
+	local d
+	for d in input network proximity; do
+		doins profiles/${d}/${d}.conf
+	done
+	doins src/main.conf
+
+	newinitd "${FILESDIR}"/bluetooth-init.d-r3 bluetooth
+	newinitd "${FILESDIR}"/rfcomm-init.d-r2 rfcomm
+
+	einstalldocs
+	use doc && dodoc doc/*.txt
+	readme.gentoo_create_doc
+}
+
+pkg_postinst() {
+	readme.gentoo_print_elog
+
+	use udev && udev_reload
+
+	has_version net-dialup/ppp || elog "To use dial up networking you must install net-dialup/ppp."
+
+	if ! has_version sys-auth/consolekit && ! has_version sys-apps/systemd; then
+		elog "Since you don't have sys-auth/consolekit neither sys-apps/systemd, you will"
+		elog "need to add the user to the plugdev group."
+	fi
+}

diff --git a/net-wireless/bluez/files/bluez-udevadm-path.patch b/net-wireless/bluez/files/bluez-udevadm-path.patch
index a29193e..f9bbac5 100644
--- a/net-wireless/bluez/files/bluez-udevadm-path.patch
+++ b/net-wireless/bluez/files/bluez-udevadm-path.patch
@@ -1,5 +1,5 @@
---- tools/hid2hci.rules~	2012-12-24 18:46:55.000000000 +0100
-+++ tools/hid2hci.rules	2015-04-04 13:13:29.360300000 +0200
+--- a/tools/hid2hci.rules
++++ b/tools/hid2hci.rules
 @@ -20,6 +20,7 @@
  # Unfortunately the only event seen is the BT device disappearing, so the mouse
  # device needs to be chased down on the USB bus.

diff --git a/net-wireless/bluez/metadata.xml b/net-wireless/bluez/metadata.xml
index ea1c574..7d7038e 100644
--- a/net-wireless/bluez/metadata.xml
+++ b/net-wireless/bluez/metadata.xml
@@ -6,6 +6,7 @@
     <name>Pacho Ramos</name>
   </maintainer>
   <use>
+    <flag name="deprecated">Build deprecated plugins</flag>
     <flag name="experimental">Build experimental plugins</flag>
     <flag name="extra-tools">Install tools that upstream doesn't install on
     purpose by default. All this tools shouldn't be used. Then, please


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-wireless/bluez/, net-wireless/bluez/files/
@ 2019-04-29 12:22 Pacho Ramos
  0 siblings, 0 replies; 22+ messages in thread
From: Pacho Ramos @ 2019-04-29 12:22 UTC (permalink / raw
  To: gentoo-commits

commit:     f66ab1b3d4ec80a8fdaed2b5cc91f5d870448d12
Author:     Pacho Ramos <pacho <AT> gentoo <DOT> org>
AuthorDate: Mon Apr 29 12:21:08 2019 +0000
Commit:     Pacho Ramos <pacho <AT> gentoo <DOT> org>
CommitDate: Mon Apr 29 12:21:08 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f66ab1b3

net-wireless/bluez: Drop old

Package-Manager: Portage-2.3.64, Repoman-2.3.12
Signed-off-by: Pacho Ramos <pacho <AT> gentoo.org>

 net-wireless/bluez/Manifest                        |   1 -
 net-wireless/bluez/bluez-5.49-r1.ebuild            | 263 --------------------
 net-wireless/bluez/bluez-5.50-r1.ebuild            | 265 ---------------------
 .../bluez/files/bluez-5.49-crash-non-LE.patch      |  51 ----
 4 files changed, 580 deletions(-)

diff --git a/net-wireless/bluez/Manifest b/net-wireless/bluez/Manifest
index 4bc18c8a6b1..0574b3c3473 100644
--- a/net-wireless/bluez/Manifest
+++ b/net-wireless/bluez/Manifest
@@ -1,2 +1 @@
-DIST bluez-5.49.tar.xz 1744860 BLAKE2B 25b350debb016f93d23a2ecf14183197a3b8e8c0496b82b22a51ccc00ccf0241fb43d7d8d9ed04bdfcc0a1111078b8394e8b9ff23963854e51b6a19cf769811f SHA512 bc2988649420232b92e2c6836857027369f05ace005972f575ed0601c02cc97a07a3b7a0707a8bad72be73df7e8096c8bf023530443556e87c2ccb667981b37d
 DIST bluez-5.50.tar.xz 1755384 BLAKE2B d70763a80fa233cd31fbefc44f73ffceb54c2d7b64ee83df0d2dafb039771d2b18e69dd44b35b2cdf8eee97553c02deca2281f7ec54e958218cf6c4b364a8516 SHA512 64a680e4b3c270bc2439610c91ad2aef36131d84401e4bbdf6c2b7ec8708a19dfc942b31b9189c38a97ca072c761c669ae1aace5f4ff5d06de3ccbf33184be45

diff --git a/net-wireless/bluez/bluez-5.49-r1.ebuild b/net-wireless/bluez/bluez-5.49-r1.ebuild
deleted file mode 100644
index 26cea7716cd..00000000000
--- a/net-wireless/bluez/bluez-5.49-r1.ebuild
+++ /dev/null
@@ -1,263 +0,0 @@
-# Copyright 1999-2018 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=6
-PYTHON_COMPAT=( python2_7 )
-
-inherit autotools multilib python-single-r1 readme.gentoo-r1 systemd udev user multilib-minimal
-
-DESCRIPTION="Bluetooth Tools and System Daemons for Linux"
-HOMEPAGE="http://www.bluez.org"
-SRC_URI="mirror://kernel/linux/bluetooth/${P}.tar.xz"
-
-LICENSE="GPL-2+ LGPL-2.1+"
-SLOT="0/3"
-KEYWORDS="amd64 arm ~arm64 ~hppa ~mips ppc ppc64 x86"
-IUSE="alsa cups doc debug deprecated extra-tools experimental +mesh +obex +readline selinux systemd test test-programs +udev user-session"
-
-# Since this release all remaining extra-tools need readline support, but this could
-# change in the future, hence, this REQUIRED_USE constraint could be dropped
-# again in the future.
-REQUIRED_USE="
-	extra-tools? ( deprecated readline )
-	test? ( ${PYTHON_REQUIRED_USE} )
-	test-programs? ( ${PYTHON_REQUIRED_USE} )
-	user-session? ( systemd )
-"
-
-CDEPEND="
-	>=dev-libs/glib-2.28:2[${MULTILIB_USEDEP}]
-	>=sys-apps/dbus-1.6:=[user-session=]
-	>=sys-apps/hwids-20121202.2
-	alsa? ( media-libs/alsa-lib )
-	cups? ( net-print/cups:= )
-	mesh? (
-		dev-libs/json-c:=
-		sys-libs/readline:0= )
-	obex? ( dev-libs/libical:= )
-	readline? ( sys-libs/readline:0= )
-	systemd? ( sys-apps/systemd )
-	udev? ( >=virtual/udev-172 )
-"
-TEST_DEPS="${PYTHON_DEPS}
-	>=dev-python/dbus-python-1[${PYTHON_USEDEP}]
-	dev-python/pygobject:3[${PYTHON_USEDEP}]
-"
-
-DEPEND="${CDEPEND}
-	virtual/pkgconfig
-	test? (	${TEST_DEPS} )
-"
-RDEPEND="${CDEPEND}
-	selinux? ( sec-policy/selinux-bluetooth )
-	test-programs? ( ${TEST_DEPS} )
-"
-DOC_CONTENTS="
-	If you want to control your bluetooth devices as a non-root user,
-	please remember to add you to plugdev group.
-"
-
-PATCHES=(
-	# Use static group "plugdev" to not force people to become root for
-	# controlling the devices.
-	"${FILESDIR}"/${PN}-plugdev.patch
-
-	# Try both udevadm paths to cover udev/systemd vs. eudev locations (#539844)
-	# http://www.spinics.net/lists/linux-bluetooth/msg58739.html
-	"${FILESDIR}"/${PN}-udevadm-path.patch
-
-	# build: Quote systemd variable names, bug #527432
-	# http://article.gmane.org/gmane.linux.bluez.kernel/67230
-	"${FILESDIR}"/${PN}-5.39-systemd-quote.patch
-
-	# Fedora patches
-	# http://www.spinics.net/lists/linux-bluetooth/msg40136.html
-	"${FILESDIR}"/0001-obex-Use-GLib-helper-function-to-manipulate-paths.patch
-
-	# ???
-	"${FILESDIR}"/0004-agent-Assert-possible-infinite-loop.patch
-
-	# https://git.kernel.org/pub/scm/bluetooth/bluez.git/commit/?id=2c3bba7b38be03834162e34069156f1fd49f0528
-	# Fixed in next version
-	"${FILESDIR}"/${P}-crash-non-LE.patch
-)
-
-pkg_setup() {
-	enewgroup plugdev
-
-	if use test || use test-programs; then
-		python-single-r1_pkg_setup
-	fi
-
-	if ! use udev; then
-		ewarn
-		ewarn "You are installing ${PN} with USE=-udev. This means various bluetooth"
-		ewarn "devices and adapters from Apple, Dell, Logitech etc. will not work,"
-		ewarn "and hid2hci will not be available."
-		ewarn
-	fi
-}
-
-src_prepare() {
-	default
-
-	# http://www.spinics.net/lists/linux-bluetooth/msg38490.html
-	! use user-session && eapply "${FILESDIR}"/0001-Allow-using-obexd-without-systemd-in-the-user-sessio.patch
-
-	if use cups; then
-		sed -i \
-			-e "s:cupsdir = \$(libdir)/cups:cupsdir = $(cups-config --serverbin):" \
-			Makefile.{in,tools} || die
-	fi
-
-	# Broken test https://bugzilla.kernel.org/show_bug.cgi?id=196621
-	sed -i -e '/unit_tests += unit\/test-gatt\b/d' Makefile.am || die
-
-	eautoreconf
-
-	multilib_copy_sources
-}
-
-multilib_src_configure() {
-	local myconf=(
-		# readline is automagic when client is enabled
-		# --enable-client always needs readline, bug #504038
-		# --enable-mesh is handled in the same way
-		ac_cv_header_readline_readline_h=$(multilib_native_usex readline)
-		ac_cv_header_readline_readline_h=$(multilib_native_usex mesh)
-	)
-
-	if ! multilib_is_native_abi; then
-		myconf+=(
-			# deps not used for the library
-			{DBUS,GLIB}_{CFLAGS,LIBS}=' '
-		)
-	fi
-
-	# btpclient disabled because we don't have ell library in the tree
-	econf \
-		--localstatedir=/var \
-		--disable-android \
-		--disable-btpclient \
-		--enable-datafiles \
-		--enable-experimental \
-		--enable-optimization \
-		$(use_enable debug) \
-		--enable-pie \
-		--enable-threads \
-		--enable-library \
-		--enable-tools \
-		--enable-manpages \
-		--enable-monitor \
-		--with-systemdsystemunitdir="$(systemd_get_systemunitdir)" \
-		--with-systemduserunitdir="$(systemd_get_userunitdir)" \
-		$(multilib_native_use_enable alsa midi) \
-		$(multilib_native_use_enable cups) \
-		$(multilib_native_use_enable deprecated) \
-		$(multilib_native_use_enable experimental) \
-		$(multilib_native_use_enable mesh) \
-		$(multilib_native_use_enable obex) \
-		$(multilib_native_use_enable readline client) \
-		$(multilib_native_use_enable systemd) \
-		$(multilib_native_use_enable test-programs test) \
-		$(multilib_native_use_enable udev) \
-		$(multilib_native_use_enable udev sixaxis)
-}
-
-multilib_src_compile() {
-	if multilib_is_native_abi; then
-		default
-	else
-		emake -f Makefile -f - libs \
-			<<<'libs: $(lib_LTLIBRARIES)'
-	fi
-}
-
-multilib_src_test() {
-	multilib_is_native_abi && default
-}
-
-multilib_src_install() {
-	if multilib_is_native_abi; then
-		emake DESTDIR="${D}" install
-
-		# Only install extra-tools when relevant USE flag is enabled
-		if use extra-tools; then
-			ewarn "Upstream doesn't support using this tools and their bugs are"
-			ewarn "likely to be ignored forever, also that tools can break"
-			ewarn "without previous announcement."
-			ewarn "Upstream also states all this tools are not really needed,"
-			ewarn "then, if you still need to rely on them, you must ask them"
-			ewarn "to either install that tool by default or add the needed"
-			ewarn "functionality to the existing 'official' tools."
-			ewarn "Please report this issues to:"
-			ewarn "http://www.bluez.org/development/lists/"
-
-			# Upstream doesn't install this, bug #524640
-			# http://permalink.gmane.org/gmane.linux.bluez.kernel/53115
-			# http://comments.gmane.org/gmane.linux.bluez.kernel/54564
-			# gatttool is only built with readline, bug #530776
-			dobin attrib/gatttool
-			dobin tools/btmgmt
-		fi
-
-		# Unittests are not that useful once installed, so make them optional
-		if use test-programs; then
-			# example-gatt-client is the only one needing
-			# python3, the others are python2 only. Remove
-			# until we see how to pull in python2 and python3
-			# for runtime
-			rm "${ED}"/usr/$(get_libdir)/bluez/test/example-gatt-server || die
-			rm "${ED}"/usr/$(get_libdir)/bluez/test/example-gatt-client || die
-			python_fix_shebang "${ED}"/usr/$(get_libdir)/bluez/test
-			for i in $(find "${ED}"/usr/$(get_libdir)/bluez/test -maxdepth 1 -type f ! -name "*.*"); do
-				dosym "${i}" /usr/bin/bluez-"${i##*/}"
-			done
-		fi
-	else
-		emake DESTDIR="${D}" \
-			install-includeHEADERS \
-			install-libLTLIBRARIES \
-			install-pkgconfigDATA
-	fi
-}
-
-multilib_src_install_all() {
-	# We need to ensure obexd can be spawned automatically by systemd
-	# when user-session is enabled:
-	# http://marc.info/?l=linux-bluetooth&m=148096094716386&w=2
-	# https://bugs.gentoo.org/show_bug.cgi?id=577842
-	# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=804908
-	# https://bugs.archlinux.org/task/45816
-	# https://bugzilla.redhat.com/show_bug.cgi?id=1318441
-	# https://bugzilla.redhat.com/show_bug.cgi?id=1389347
-	use user-session && ln -s "${ED}"/usr/lib/systemd/user/obex.service "${ED}"/usr/lib/systemd/user/dbus-org.bluez.obex.service
-
-	find "${D}" -name '*.la' -delete || die
-
-	keepdir /var/lib/bluetooth
-
-	# Upstream don't want people to play with them
-	# But we keep installing them due to 'historical' reasons
-	insinto /etc/bluetooth
-	local d
-	for d in input network; do
-		doins profiles/${d}/${d}.conf
-	done
-	doins src/main.conf
-
-	newinitd "${FILESDIR}"/bluetooth-init.d-r4 bluetooth
-
-	einstalldocs
-	use doc && dodoc doc/*.txt
-	! use systemd && readme.gentoo_create_doc
-}
-
-pkg_postinst() {
-	! use systemd && readme.gentoo_print_elog
-
-	use udev && udev_reload
-	systemd_reenable bluetooth.service
-
-	has_version net-dialup/ppp || elog "To use dial up networking you must install net-dialup/ppp."
-}

diff --git a/net-wireless/bluez/bluez-5.50-r1.ebuild b/net-wireless/bluez/bluez-5.50-r1.ebuild
deleted file mode 100644
index 58a9288c74d..00000000000
--- a/net-wireless/bluez/bluez-5.50-r1.ebuild
+++ /dev/null
@@ -1,265 +0,0 @@
-# Copyright 1999-2019 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=6
-PYTHON_COMPAT=( python2_7 )
-
-inherit autotools multilib python-single-r1 readme.gentoo-r1 systemd udev user multilib-minimal
-
-DESCRIPTION="Bluetooth Tools and System Daemons for Linux"
-HOMEPAGE="http://www.bluez.org"
-SRC_URI="mirror://kernel/linux/bluetooth/${P}.tar.xz"
-
-LICENSE="GPL-2+ LGPL-2.1+"
-SLOT="0/3"
-KEYWORDS="amd64 arm ~arm64 ~hppa ~mips ~ppc ~ppc64 x86"
-IUSE="alsa btpclient cups doc debug deprecated extra-tools experimental +mesh +obex +readline selinux systemd test test-programs +udev user-session"
-
-# Since this release all remaining extra-tools need readline support, but this could
-# change in the future, hence, this REQUIRED_USE constraint could be dropped
-# again in the future.
-REQUIRED_USE="
-	extra-tools? ( deprecated readline )
-	test? ( ${PYTHON_REQUIRED_USE} )
-	test-programs? ( ${PYTHON_REQUIRED_USE} )
-	user-session? ( systemd )
-"
-
-CDEPEND="
-	>=dev-libs/glib-2.28:2[${MULTILIB_USEDEP}]
-	>=sys-apps/dbus-1.6:=[user-session=]
-	>=sys-apps/hwids-20121202.2
-	alsa? ( media-libs/alsa-lib )
-	btpclient? ( >=dev-libs/ell-0.3 )
-	cups? ( net-print/cups:= )
-	mesh? (
-		>=dev-libs/ell-0.3
-		dev-libs/json-c:=
-		sys-libs/readline:0= )
-	obex? ( dev-libs/libical:= )
-	readline? ( sys-libs/readline:0= )
-	systemd? ( sys-apps/systemd )
-	udev? ( >=virtual/udev-172 )
-"
-TEST_DEPS="${PYTHON_DEPS}
-	>=dev-python/dbus-python-1[${PYTHON_USEDEP}]
-	dev-python/pygobject:3[${PYTHON_USEDEP}]
-"
-
-DEPEND="${CDEPEND}
-	virtual/pkgconfig
-	test? (	${TEST_DEPS} )
-"
-RDEPEND="${CDEPEND}
-	selinux? ( sec-policy/selinux-bluetooth )
-	test-programs? ( ${TEST_DEPS} )
-"
-DOC_CONTENTS="
-	If you want to control your bluetooth devices as a non-root user,
-	please remember to add you to plugdev group.
-"
-
-PATCHES=(
-	# Fix missing header (fixed in 'master')
-	"${FILESDIR}"/${P}-btpclient-header.patch
-
-	# Use static group "plugdev" to not force people to become root for
-	# controlling the devices.
-	"${FILESDIR}"/${PN}-plugdev.patch
-
-	# Try both udevadm paths to cover udev/systemd vs. eudev locations (#539844)
-	# http://www.spinics.net/lists/linux-bluetooth/msg58739.html
-	"${FILESDIR}"/${PN}-udevadm-path.patch
-
-	# build: Quote systemd variable names, bug #527432
-	# http://article.gmane.org/gmane.linux.bluez.kernel/67230
-	"${FILESDIR}"/${PN}-5.39-systemd-quote.patch
-
-	# Fedora patches
-	# http://www.spinics.net/lists/linux-bluetooth/msg40136.html
-	"${FILESDIR}"/0001-obex-Use-GLib-helper-function-to-manipulate-paths.patch
-
-	# ???
-	"${FILESDIR}"/0004-agent-Assert-possible-infinite-loop.patch
-)
-
-pkg_setup() {
-	enewgroup plugdev
-
-	if use test || use test-programs; then
-		python-single-r1_pkg_setup
-	fi
-
-	if ! use udev; then
-		ewarn
-		ewarn "You are installing ${PN} with USE=-udev. This means various bluetooth"
-		ewarn "devices and adapters from Apple, Dell, Logitech etc. will not work,"
-		ewarn "and hid2hci will not be available."
-		ewarn
-	fi
-}
-
-src_prepare() {
-	default
-
-	# http://www.spinics.net/lists/linux-bluetooth/msg38490.html
-	! use user-session && eapply "${FILESDIR}"/0001-Allow-using-obexd-without-systemd-in-the-user-sessio.patch
-
-	if use cups; then
-		sed -i \
-			-e "s:cupsdir = \$(libdir)/cups:cupsdir = $(cups-config --serverbin):" \
-			Makefile.{in,tools} || die
-	fi
-
-	# Broken test https://bugzilla.kernel.org/show_bug.cgi?id=196621
-	sed -i -e '/unit_tests += unit\/test-gatt\b/d' Makefile.am || die
-
-	eautoreconf
-
-	multilib_copy_sources
-}
-
-multilib_src_configure() {
-	local myconf=(
-		# readline is automagic when client is enabled
-		# --enable-client always needs readline, bug #504038
-		# --enable-mesh is handled in the same way
-		ac_cv_header_readline_readline_h=$(multilib_native_usex readline)
-		ac_cv_header_readline_readline_h=$(multilib_native_usex mesh)
-	)
-
-	if ! multilib_is_native_abi; then
-		myconf+=(
-			# deps not used for the library
-			{DBUS,GLIB}_{CFLAGS,LIBS}=' '
-		)
-	fi
-
-	econf \
-		--localstatedir=/var \
-		--disable-android \
-		--enable-datafiles \
-		--enable-optimization \
-		$(use_enable debug) \
-		--enable-pie \
-		--enable-threads \
-		--enable-library \
-		--enable-tools \
-		--enable-manpages \
-		--enable-monitor \
-		--with-systemdsystemunitdir="$(systemd_get_systemunitdir)" \
-		--with-systemduserunitdir="$(systemd_get_userunitdir)" \
-		$(multilib_native_use_enable alsa midi) \
-		$(multilib_native_use_enable btpclient) \
-		$(multilib_native_use_enable cups) \
-		$(multilib_native_use_enable deprecated) \
-		$(multilib_native_use_enable experimental) \
-		$(multilib_native_use_enable mesh) \
-		$(multilib_native_use_enable obex) \
-		$(multilib_native_use_enable readline client) \
-		$(multilib_native_use_enable systemd) \
-		$(multilib_native_use_enable test-programs test) \
-		$(multilib_native_use_enable udev) \
-		$(multilib_native_use_enable udev sixaxis)
-}
-
-multilib_src_compile() {
-	if multilib_is_native_abi; then
-		default
-	else
-		emake -f Makefile -f - libs \
-			<<<'libs: $(lib_LTLIBRARIES)'
-	fi
-}
-
-multilib_src_test() {
-	multilib_is_native_abi && default
-}
-
-multilib_src_install() {
-	if multilib_is_native_abi; then
-		emake DESTDIR="${D}" install
-
-		# Only install extra-tools when relevant USE flag is enabled
-		if use extra-tools; then
-			ewarn "Upstream doesn't support using this tools and their bugs are"
-			ewarn "likely to be ignored forever, also that tools can break"
-			ewarn "without previous announcement."
-			ewarn "Upstream also states all this tools are not really needed,"
-			ewarn "then, if you still need to rely on them, you must ask them"
-			ewarn "to either install that tool by default or add the needed"
-			ewarn "functionality to the existing 'official' tools."
-			ewarn "Please report this issues to:"
-			ewarn "http://www.bluez.org/development/lists/"
-
-			# Upstream doesn't install this, bug #524640
-			# http://permalink.gmane.org/gmane.linux.bluez.kernel/53115
-			# http://comments.gmane.org/gmane.linux.bluez.kernel/54564
-			# gatttool is only built with readline, bug #530776
-			dobin attrib/gatttool
-			dobin tools/btmgmt
-		fi
-
-		# Not installed by default after being built, bug #666756
-		use btpclient && dobin tools/btpclient
-
-		# Unittests are not that useful once installed, so make them optional
-		if use test-programs; then
-			# example-gatt-client is the only one needing
-			# python3, the others are python2 only. Remove
-			# until we see how to pull in python2 and python3
-			# for runtime
-			rm "${ED}"/usr/$(get_libdir)/bluez/test/example-gatt-server || die
-			rm "${ED}"/usr/$(get_libdir)/bluez/test/example-gatt-client || die
-			python_fix_shebang "${ED}"/usr/$(get_libdir)/bluez/test
-			for i in $(find "${ED}"/usr/$(get_libdir)/bluez/test -maxdepth 1 -type f ! -name "*.*"); do
-				dosym "${i}" /usr/bin/bluez-"${i##*/}"
-			done
-		fi
-	else
-		emake DESTDIR="${D}" \
-			install-includeHEADERS \
-			install-libLTLIBRARIES \
-			install-pkgconfigDATA
-	fi
-}
-
-multilib_src_install_all() {
-	# We need to ensure obexd can be spawned automatically by systemd
-	# when user-session is enabled:
-	# http://marc.info/?l=linux-bluetooth&m=148096094716386&w=2
-	# https://bugs.gentoo.org/show_bug.cgi?id=577842
-	# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=804908
-	# https://bugs.archlinux.org/task/45816
-	# https://bugzilla.redhat.com/show_bug.cgi?id=1318441
-	# https://bugzilla.redhat.com/show_bug.cgi?id=1389347
-	use user-session && ln -s "${ED}"/usr/lib/systemd/user/obex.service "${ED}"/usr/lib/systemd/user/dbus-org.bluez.obex.service
-
-	find "${D}" -name '*.la' -delete || die
-
-	keepdir /var/lib/bluetooth
-
-	# Upstream don't want people to play with them
-	# But we keep installing them due to 'historical' reasons
-	insinto /etc/bluetooth
-	local d
-	for d in input network; do
-		doins profiles/${d}/${d}.conf
-	done
-	doins src/main.conf
-
-	newinitd "${FILESDIR}"/bluetooth-init.d-r4 bluetooth
-
-	einstalldocs
-	use doc && dodoc doc/*.txt
-	! use systemd && readme.gentoo_create_doc
-}
-
-pkg_postinst() {
-	! use systemd && readme.gentoo_print_elog
-
-	use udev && udev_reload
-	systemd_reenable bluetooth.service
-
-	has_version net-dialup/ppp || elog "To use dial up networking you must install net-dialup/ppp."
-}

diff --git a/net-wireless/bluez/files/bluez-5.49-crash-non-LE.patch b/net-wireless/bluez/files/bluez-5.49-crash-non-LE.patch
deleted file mode 100644
index b66868e7140..00000000000
--- a/net-wireless/bluez/files/bluez-5.49-crash-non-LE.patch
+++ /dev/null
@@ -1,51 +0,0 @@
-From 2c3bba7b38be03834162e34069156f1fd49f0528 Mon Sep 17 00:00:00 2001
-From: "antoine.belvire@laposte.net" <antoine.belvire@laposte.net>
-Date: Tue, 27 Mar 2018 20:30:26 +0200
-Subject: adapter: Don't refresh adv_manager for non-LE devices
-
-btd_adv_manager_refresh is called upon MGMT_SETTING_DISCOVERABLE setting change
-but as only LE adapters have an adv_manager, this leads to segmentation fault
-for non-LE devices:
-
-0  btd_adv_manager_refresh (manager=0x0) at src/advertising.c:1176
-1  0x0000556fe45fcb02 in settings_changed (settings=<optimized out>,
-    adapter=0x556fe53f7c70) at src/adapter.c:543
-2  new_settings_callback (index=<optimized out>, length=<optimized out>,
-    param=<optimized out>, user_data=0x556fe53f7c70) at src/adapter.c:573
-3  0x0000556fe462c278 in request_complete (mgmt=mgmt@entry=0x556fe53f20c0,
-    status=<optimized out>, opcode=opcode@entry=7, index=index@entry=0,
-    length=length@entry=4, param=0x556fe53eb5f9) at src/shared/mgmt.c:261
-4  0x0000556fe462cd9d in can_read_data (io=<optimized out>,
-    user_data=0x556fe53f20c0) at src/shared/mgmt.c:353
-5  0x0000556fe46396e3 in watch_callback (channel=<optimized out>,
-    cond=<optimized out>, user_data=<optimized out>)
-    at src/shared/io-glib.c:170
-6  0x00007fe351c980e5 in g_main_context_dispatch ()
-   from /usr/lib64/libglib-2.0.so.0
-7  0x00007fe351c984b0 in ?? () from /usr/lib64/libglib-2.0.so.0
-8  0x00007fe351c987c2 in g_main_loop_run () from /usr/lib64/libglib-2.0.so.0
-9  0x0000556fe45abc75 in main (argc=<optimized out>, argv=<optimized out>)
-    at src/main.c:770
-
-This commit prevents the call to btd_adv_manager_refresh for non-LE devices.
----
- src/adapter.c | 3 ++-
- 1 file changed, 2 insertions(+), 1 deletion(-)
-
-diff --git a/src/adapter.c b/src/adapter.c
-index 6b9222b..daccfdc 100644
---- a/src/adapter.c
-+++ b/src/adapter.c
-@@ -540,7 +540,8 @@ static void settings_changed(struct btd_adapter *adapter, uint32_t settings)
- 		g_dbus_emit_property_changed(dbus_conn, adapter->path,
- 					ADAPTER_INTERFACE, "Discoverable");
- 		store_adapter_info(adapter);
--		btd_adv_manager_refresh(adapter->adv_manager);
-+		if (adapter->supported_settings & MGMT_SETTING_LE)
-+			btd_adv_manager_refresh(adapter->adv_manager);
- 	}
- 
- 	if (changed_mask & MGMT_SETTING_BONDABLE) {
--- 
-cgit v1.1
-


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-wireless/bluez/, net-wireless/bluez/files/
@ 2019-09-29 13:47 Pacho Ramos
  0 siblings, 0 replies; 22+ messages in thread
From: Pacho Ramos @ 2019-09-29 13:47 UTC (permalink / raw
  To: gentoo-commits

commit:     e4bccfefa9e19ea37c7999197e4042adef1bbf02
Author:     Pacho Ramos <pacho <AT> gentoo <DOT> org>
AuthorDate: Sun Sep 29 13:47:36 2019 +0000
Commit:     Pacho Ramos <pacho <AT> gentoo <DOT> org>
CommitDate: Sun Sep 29 13:47:36 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e4bccfef

net-wireless/bluez: Update patch

Thanks-to: Joakim Tjernlund
Bug: https://bugs.gentoo.org/show_bug.cgi?id=695316
Package-Manager: Portage-2.3.76, Repoman-2.3.17
Signed-off-by: Pacho Ramos <pacho <AT> gentoo.org>

 net-wireless/bluez/bluez-5.51.ebuild               |  2 +-
 ...xd-without-systemd-in-the-user-session-r1.patch | 58 ++++++++++++++++++++++
 2 files changed, 59 insertions(+), 1 deletion(-)

diff --git a/net-wireless/bluez/bluez-5.51.ebuild b/net-wireless/bluez/bluez-5.51.ebuild
index d0143d9e574..3c34a631d36 100644
--- a/net-wireless/bluez/bluez-5.51.ebuild
+++ b/net-wireless/bluez/bluez-5.51.ebuild
@@ -93,7 +93,7 @@ src_prepare() {
 
 	# http://www.spinics.net/lists/linux-bluetooth/msg38490.html
 	if ! use user-session || ! use systemd; then
-		eapply "${FILESDIR}"/0001-Allow-using-obexd-without-systemd-in-the-user-sessio.patch
+		eapply "${FILESDIR}"/0001-Allow-using-obexd-without-systemd-in-the-user-session-r1.patch
 	fi
 
 	if use cups; then

diff --git a/net-wireless/bluez/files/0001-Allow-using-obexd-without-systemd-in-the-user-session-r1.patch b/net-wireless/bluez/files/0001-Allow-using-obexd-without-systemd-in-the-user-session-r1.patch
new file mode 100644
index 00000000000..dec93073e18
--- /dev/null
+++ b/net-wireless/bluez/files/0001-Allow-using-obexd-without-systemd-in-the-user-session-r1.patch
@@ -0,0 +1,58 @@
+From 3027cb7141fb65cf3eeda69c688db8c4045e2d3f Mon Sep 17 00:00:00 2001
+From: Giovanni Campagna <gcampagna-cNUdlRotFMnNLxjTenLetw@public.gmane.org>
+Date: Sat, 12 Oct 2013 17:45:25 +0200
+Subject: [PATCH] Allow using obexd without systemd in the user session
+
+Not all sessions run systemd --user (actually, the majority
+doesn't), so the dbus daemon must be able to spawn obexd
+directly, and to do so it needs the full path of the daemon.
+---
+ Makefile.obexd                      | 4 ++--
+ obexd/src/org.bluez.obex.service    | 4 ----
+ obexd/src/org.bluez.obex.service.in | 4 ++++
+ 3 files changed, 6 insertions(+), 6 deletions(-)
+ delete mode 100644 obexd/src/org.bluez.obex.service
+ create mode 100644 obexd/src/org.bluez.obex.service.in
+
+diff --git a/Makefile.obexd b/Makefile.obexd
+index 3760867..142e7c3 100644
+--- a/Makefile.obexd
++++ b/Makefile.obexd
+@@ -2,12 +2,12 @@
+ if SYSTEMD
+ systemduserunitdir = $(SYSTEMD_USERUNITDIR)
+ systemduserunit_DATA = obexd/src/obex.service
++endif
+ 
+ dbussessionbusdir = $(DBUS_SESSIONBUSDIR)
+ dbussessionbus_DATA = obexd/src/org.bluez.obex.service
+-endif
+ 
+-EXTRA_DIST += obexd/src/obex.service.in obexd/src/org.bluez.obex.service
++EXTRA_DIST += obexd/src/obex.service.in obexd/src/org.bluez.obex.service.in
+ 
+ obex_plugindir = $(libdir)/obex/plugins
+ 
+diff --git a/obexd/src/org.bluez.obex.service b/obexd/src/org.bluez.obex.service
+deleted file mode 100644
+index a538088..0000000
+--- a/obexd/src/org.bluez.obex.service
++++ /dev/null
+@@ -1,4 +0,0 @@
+-[D-BUS Service]
+-Name=org.bluez.obex
+-Exec=/bin/false
+-SystemdService=dbus-org.bluez.obex.service
+diff --git a/obexd/src/org.bluez.obex.service.in b/obexd/src/org.bluez.obex.service.in
+new file mode 100644
+index 0000000..9c815f2
+--- /dev/null
++++ b/obexd/src/org.bluez.obex.service.in
+@@ -0,0 +1,4 @@
++[D-BUS Service]
++Name=org.bluez.obex
++Exec=@libexecdir@/obexd
++SystemdService=dbus-org.bluez.obex.service
+-- 
+1.8.3.1
+


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-wireless/bluez/, net-wireless/bluez/files/
@ 2019-10-20  8:55 Pacho Ramos
  0 siblings, 0 replies; 22+ messages in thread
From: Pacho Ramos @ 2019-10-20  8:55 UTC (permalink / raw
  To: gentoo-commits

commit:     2db8345584f1f074d4e823ce52d04bb1dd39a931
Author:     Pacho Ramos <pacho <AT> gentoo <DOT> org>
AuthorDate: Sun Oct 20 08:55:02 2019 +0000
Commit:     Pacho Ramos <pacho <AT> gentoo <DOT> org>
CommitDate: Sun Oct 20 08:55:47 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2db83455

net-wireless/bluez: Fix building in non-glibc systems

Thanks-to: Jory A. Pratt
Closes: https://bugs.gentoo.org/695940
Package-Manager: Portage-2.3.76, Repoman-2.3.17
Signed-off-by: Pacho Ramos <pacho <AT> gentoo.org>

 net-wireless/bluez/bluez-5.51.ebuild               |  5 ++
 .../bluez/files/bluez-5.51-include-limits-h.patch  | 64 ++++++++++++++++++++++
 2 files changed, 69 insertions(+)

diff --git a/net-wireless/bluez/bluez-5.51.ebuild b/net-wireless/bluez/bluez-5.51.ebuild
index 00a51cb6047..792792341b4 100644
--- a/net-wireless/bluez/bluez-5.51.ebuild
+++ b/net-wireless/bluez/bluez-5.51.ebuild
@@ -69,6 +69,11 @@ PATCHES=(
 	# http://article.gmane.org/gmane.linux.bluez.kernel/67230
 	"${FILESDIR}"/${PN}-5.39-systemd-quote.patch
 
+	# Include limits.h for PATH_MAX
+	# https://marc.info/?l=linux-bluetooth&m=157156119320950&w=2
+	# https://bugs.gentoo.org/695940
+	"${FILESDIR}"/${PN}-5.51-include-limits-h.patch
+
 	# Fedora patches
 	# http://www.spinics.net/lists/linux-bluetooth/msg40136.html
 	"${FILESDIR}"/0001-obex-Use-GLib-helper-function-to-manipulate-paths.patch

diff --git a/net-wireless/bluez/files/bluez-5.51-include-limits-h.patch b/net-wireless/bluez/files/bluez-5.51-include-limits-h.patch
new file mode 100644
index 00000000000..ccbc152a4ee
--- /dev/null
+++ b/net-wireless/bluez/files/bluez-5.51-include-limits-h.patch
@@ -0,0 +1,64 @@
+From 20128c5c95fbae93c9fd996d5ad2584cf6ad8032 Mon Sep 17 00:00:00 2001
+From: Jory Pratt <anarchy@gentoo.org>
+Date: Mon, 30 Sep 2019 18:35:56 -0500
+Subject: [PATCH] Include limits.h for PATH_MAX
+
+Signed-off-by: Jory Pratt <anarchy@gentoo.org>
+---
+ mesh/keyring.c          | 1 +
+ mesh/mesh-config-json.c | 1 +
+ mesh/node.c             | 1 +
+ mesh/util.c             | 1 +
+ 4 files changed, 4 insertions(+)
+
+diff --git a/mesh/keyring.c b/mesh/keyring.c
+index 3a7f92f..9fa7d6b 100644
+--- a/mesh/keyring.c
++++ b/mesh/keyring.c
+@@ -24,6 +24,7 @@
+ #define _GNU_SOURCE
+ #include <fcntl.h>
+ #include <dirent.h>
++#include <limits.h>
+ #include <stdio.h>
+ #include <unistd.h>
+ #include <dirent.h>
+diff --git a/mesh/mesh-config-json.c b/mesh/mesh-config-json.c
+index cafa2fd..74ca495 100644
+--- a/mesh/mesh-config-json.c
++++ b/mesh/mesh-config-json.c
+@@ -27,6 +27,7 @@
+ #include <fcntl.h>
+ #include <ftw.h>
+ #include <libgen.h>
++#include <limits.h>
+ #include <stdio.h>
+ #include <string.h>
+ #include <unistd.h>
+diff --git a/mesh/node.c b/mesh/node.c
+index b6824f5..15dcb97 100644
+--- a/mesh/node.c
++++ b/mesh/node.c
+@@ -23,6 +23,7 @@
+ 
+ #define _GNU_SOURCE
+ #include <dirent.h>
++#include <limits.h>
+ #include <stdio.h>
+ #include <sys/time.h>
+ 
+diff --git a/mesh/util.c b/mesh/util.c
+index 1455bde..986ba4b 100644
+--- a/mesh/util.c
++++ b/mesh/util.c
+@@ -25,6 +25,7 @@
+ #include <dirent.h>
+ #include <ftw.h>
+ #include <stdio.h>
++#include <limits.h>
+ #include <time.h>
+ #include <sys/time.h>
+ 
+-- 
+2.23.0
+


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-wireless/bluez/, net-wireless/bluez/files/
@ 2019-11-10 12:11 Pacho Ramos
  0 siblings, 0 replies; 22+ messages in thread
From: Pacho Ramos @ 2019-11-10 12:11 UTC (permalink / raw
  To: gentoo-commits

commit:     5dd6f073369af3d0fa1c9bb99abd9314adcd73e7
Author:     Pacho Ramos <pacho <AT> gentoo <DOT> org>
AuthorDate: Sun Nov 10 12:06:20 2019 +0000
Commit:     Pacho Ramos <pacho <AT> gentoo <DOT> org>
CommitDate: Sun Nov 10 12:11:17 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5dd6f073

net-wireless/bluez: Bump to 5.52

Also drop obsolete patch (as systemd-m4 package is going to be removed and
was the one causing the issue with variables quoting) and those that were
merged by upstream.

Fix patch for -user-session setups (#698394)

Bug: https://bugs.gentoo.org/698394
Closes: https://bugs.gentoo.org/699234
Package-Manager: Portage-2.3.79, Repoman-2.3.18
Signed-off-by: Pacho Ramos <pacho <AT> gentoo.org>

 net-wireless/bluez/Manifest                        |   1 +
 net-wireless/bluez/bluez-5.52.ebuild               | 281 +++++++++++++++++++++
 ...xd-without-systemd-in-the-user-session-r2.patch |  58 +++++
 3 files changed, 340 insertions(+)

diff --git a/net-wireless/bluez/Manifest b/net-wireless/bluez/Manifest
index 042c13a4249..18725c46f41 100644
--- a/net-wireless/bluez/Manifest
+++ b/net-wireless/bluez/Manifest
@@ -1,3 +1,4 @@
 DIST bluez-5.50-fedora-backports.tar.xz 32232 BLAKE2B 35244036bbe18481e32bef2dcd4a223d44442ce28cee85a3a736bfbf5ee9d74372fa6366dc1102bf86babada608966a8c30b1c2537859a3741c289cabbc76026 SHA512 6d33e8bc67e50dc0d4cee3fa080402a51ddc8b6549f19b6c272de7dc51604eab23f909322f01aaca8a834abdc3cfd0bf24bb8623071af0cf0611d7427c9d8e9a
 DIST bluez-5.50.tar.xz 1755384 BLAKE2B d70763a80fa233cd31fbefc44f73ffceb54c2d7b64ee83df0d2dafb039771d2b18e69dd44b35b2cdf8eee97553c02deca2281f7ec54e958218cf6c4b364a8516 SHA512 64a680e4b3c270bc2439610c91ad2aef36131d84401e4bbdf6c2b7ec8708a19dfc942b31b9189c38a97ca072c761c669ae1aace5f4ff5d06de3ccbf33184be45
 DIST bluez-5.51.tar.xz 1941904 BLAKE2B e8580388961c99305c6f723160e726232a097067815a88a056c1569c55c2ea410004cf92572afbef9b782807d8a940503b4501f9c6046cacac35136fbbe580a8 SHA512 8b14eea98f541b981162abce728e0f917654ad3c990721ec398fe41bdd68069fe55ff64b61bc3c3b9f813facf42c995b07619f6d5d153965de27154b1a7b578f
+DIST bluez-5.52.tar.xz 1957504 BLAKE2B 670cdfb44eca1b184c0bd678bab34116f9172394b86fb69fa454f7bdcc1ae82c466a806879ddef96dddd6ae6cd31466b48f9e87113d43144659ae0c057b9def8 SHA512 9024481910d1dee85578bf3d7a4fc4be2bece516e6216c91aa1a7ac18537f092b47c41c4a5506ddd7e279599d58002e98203c5439745c01df4dbc22a75234c84

diff --git a/net-wireless/bluez/bluez-5.52.ebuild b/net-wireless/bluez/bluez-5.52.ebuild
new file mode 100644
index 00000000000..0529ab680d5
--- /dev/null
+++ b/net-wireless/bluez/bluez-5.52.ebuild
@@ -0,0 +1,281 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+PYTHON_COMPAT=( python2_7 )
+
+inherit autotools python-single-r1 readme.gentoo-r1 systemd udev multilib-minimal
+
+DESCRIPTION="Bluetooth Tools and System Daemons for Linux"
+HOMEPAGE="http://www.bluez.org"
+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 ~x86"
+IUSE="btpclient cups doc debug deprecated extra-tools experimental +mesh midi +obex +readline selinux systemd test test-programs +udev user-session"
+
+# Since this release all remaining extra-tools need readline support, but this could
+# change in the future, hence, this REQUIRED_USE constraint could be dropped
+# again in the future.
+REQUIRED_USE="
+	extra-tools? ( deprecated readline )
+	test? ( ${PYTHON_REQUIRED_USE} )
+	test-programs? ( ${PYTHON_REQUIRED_USE} )
+"
+
+TEST_DEPS="${PYTHON_DEPS}
+	>=dev-python/dbus-python-1[${PYTHON_USEDEP}]
+	dev-python/pygobject:3[${PYTHON_USEDEP}]
+"
+BDEPEND="
+	virtual/pkgconfig
+	test? ( ${TEST_DEPS} )
+"
+DEPEND="
+	>=dev-libs/glib-2.28:2[${MULTILIB_USEDEP}]
+	>=sys-apps/hwids-20121202.2
+	btpclient? ( >=dev-libs/ell-0.26 )
+	cups? ( net-print/cups:= )
+	mesh? (
+		>=dev-libs/ell-0.26
+		dev-libs/json-c:=
+		sys-libs/readline:0=
+	)
+	midi? ( media-libs/alsa-lib )
+	obex? ( dev-libs/libical:= )
+	readline? ( sys-libs/readline:0= )
+	systemd? (
+		>=sys-apps/dbus-1.6:=[user-session=]
+		sys-apps/systemd
+	)
+	!systemd? ( >=sys-apps/dbus-1.6:= )
+	udev? ( >=virtual/udev-172 )
+"
+RDEPEND="${DEPEND}
+	selinux? ( sec-policy/selinux-bluetooth )
+	test-programs? ( ${TEST_DEPS} )
+"
+
+RESTRICT="!test? ( test )"
+
+PATCHES=(
+	# Try both udevadm paths to cover udev/systemd vs. eudev locations (#539844)
+	# http://www.spinics.net/lists/linux-bluetooth/msg58739.html
+	# https://bugs.gentoo.org/539844
+	"${FILESDIR}"/${PN}-udevadm-path-r1.patch
+
+	# Fedora patches
+	# http://www.spinics.net/lists/linux-bluetooth/msg40136.html
+	"${FILESDIR}"/0001-obex-Use-GLib-helper-function-to-manipulate-paths.patch
+)
+
+pkg_setup() {
+	if use test || use test-programs; then
+		python-single-r1_pkg_setup
+	fi
+
+	if ! use udev; then
+		ewarn
+		ewarn "You are installing ${PN} with USE=-udev. This means various bluetooth"
+		ewarn "devices and adapters from Apple, Dell, Logitech etc. will not work,"
+		ewarn "and hid2hci will not be available."
+		ewarn
+	fi
+}
+
+src_prepare() {
+	default
+
+	# http://www.spinics.net/lists/linux-bluetooth/msg38490.html
+	if ! use user-session || ! use systemd; then
+		eapply "${FILESDIR}"/0001-Allow-using-obexd-without-systemd-in-the-user-session-r2.patch
+	fi
+
+	if use cups; then
+		sed -i \
+			-e "s:cupsdir = \$(libdir)/cups:cupsdir = $(cups-config --serverbin):" \
+			Makefile.{in,tools} || die
+	fi
+
+	# Broken test https://bugzilla.kernel.org/show_bug.cgi?id=196621
+	# https://bugs.gentoo.org/618548
+	sed -i -e '/unit_tests += unit\/test-gatt\b/d' Makefile.am || die
+
+	eautoreconf
+
+	multilib_copy_sources
+}
+
+multilib_src_configure() {
+	local myconf=(
+		# readline is automagic when client is enabled
+		# --enable-client always needs readline, bug #504038
+		# --enable-mesh is handled in the same way
+		ac_cv_header_readline_readline_h=$(multilib_native_usex readline)
+		ac_cv_header_readline_readline_h=$(multilib_native_usex mesh)
+	)
+
+	if ! multilib_is_native_abi; then
+		myconf+=(
+			# deps not used for the library
+			{DBUS,GLIB}_{CFLAGS,LIBS}=' '
+		)
+	fi
+
+	econf \
+		--localstatedir=/var \
+		--disable-android \
+		--enable-datafiles \
+		--enable-optimization \
+		$(use_enable debug) \
+		--enable-pie \
+		--enable-threads \
+		--enable-library \
+		--enable-tools \
+		--enable-manpages \
+		--enable-monitor \
+		--with-systemdsystemunitdir="$(systemd_get_systemunitdir)" \
+		--with-systemduserunitdir="$(systemd_get_userunitdir)" \
+		$(multilib_native_use_enable btpclient) \
+		$(multilib_native_use_enable btpclient external-ell) \
+		$(multilib_native_use_enable cups) \
+		$(multilib_native_use_enable deprecated) \
+		$(multilib_native_use_enable experimental) \
+		$(multilib_native_use_enable mesh) \
+		$(multilib_native_use_enable mesh external-ell) \
+		$(multilib_native_use_enable midi) \
+		$(multilib_native_use_enable obex) \
+		$(multilib_native_use_enable readline client) \
+		$(multilib_native_use_enable systemd) \
+		$(multilib_native_use_enable test-programs test) \
+		$(multilib_native_use_enable udev) \
+		$(multilib_native_use_enable udev sixaxis)
+}
+
+multilib_src_compile() {
+	if multilib_is_native_abi; then
+		default
+	else
+		emake -f Makefile -f - libs \
+			<<<'libs: $(lib_LTLIBRARIES)'
+	fi
+}
+
+multilib_src_test() {
+	multilib_is_native_abi && default
+}
+
+multilib_src_install() {
+	if multilib_is_native_abi; then
+		emake DESTDIR="${D}" install
+
+		# Only install extra-tools when relevant USE flag is enabled
+		if use extra-tools; then
+			ewarn "Upstream doesn't support using this tools and their bugs are"
+			ewarn "likely to be ignored forever, also that tools can break"
+			ewarn "without previous announcement."
+			ewarn "Upstream also states all this tools are not really needed,"
+			ewarn "then, if you still need to rely on them, you must ask them"
+			ewarn "to either install that tool by default or add the needed"
+			ewarn "functionality to the existing 'official' tools."
+			ewarn "Please report this issues to:"
+			ewarn "http://www.bluez.org/development/lists/"
+
+			# Upstream doesn't install this, bug #524640
+			# http://permalink.gmane.org/gmane.linux.bluez.kernel/53115
+			# http://comments.gmane.org/gmane.linux.bluez.kernel/54564
+			dobin tools/btmgmt
+			# gatttool is only built with readline, bug #530776
+			# https://bugzilla.redhat.com/show_bug.cgi?id=1141909
+			# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=720486
+			# https://bugs.archlinux.org/task/37686
+			dobin attrib/gatttool
+			# https://bugzilla.redhat.com/show_bug.cgi?id=1699680
+			dobin tools/avinfo
+		fi
+
+		# Not installed by default after being built, bug #666756
+		use btpclient && dobin tools/btpclient
+
+		# Unittests are not that useful once installed, so make them optional
+		if use test-programs; then
+			# Few are needing python3, the others are python2 only. Remove
+			# until we see how to pull in python2 and python3 for runtime
+			rm "${ED}"/usr/$(get_libdir)/bluez/test/example-gatt-server || die
+			rm "${ED}"/usr/$(get_libdir)/bluez/test/example-gatt-client || die
+			rm "${ED}"/usr/$(get_libdir)/bluez/test/agent.py || die
+			rm "${ED}"/usr/$(get_libdir)/bluez/test/test-mesh || die
+
+			python_fix_shebang "${ED}"/usr/$(get_libdir)/bluez/test
+
+			for i in $(find "${ED}"/usr/$(get_libdir)/bluez/test -maxdepth 1 -type f ! -name "*.*"); do
+				dosym "${i}" /usr/bin/bluez-"${i##*/}"
+			done
+		fi
+	else
+		emake DESTDIR="${D}" \
+			install-pkgincludeHEADERS \
+			install-libLTLIBRARIES \
+			install-pkgconfigDATA
+	fi
+}
+
+multilib_src_install_all() {
+	# We need to ensure obexd can be spawned automatically by systemd
+	# when user-session is enabled:
+	# http://marc.info/?l=linux-bluetooth&m=148096094716386&w=2
+	# https://bugs.gentoo.org/show_bug.cgi?id=577842
+	# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=804908
+	# https://bugs.archlinux.org/task/45816
+	# https://bugzilla.redhat.com/show_bug.cgi?id=1318441
+	# https://bugzilla.redhat.com/show_bug.cgi?id=1389347
+	if use user-session && use systemd; then
+		ln -s "${ED}"/usr/lib/systemd/user/obex.service "${ED}"/usr/lib/systemd/user/dbus-org.bluez.obex.service
+	fi
+
+	find "${D}" -name '*.la' -type f -delete || die
+
+	keepdir /var/lib/bluetooth
+
+	# Upstream don't want people to play with them
+	# But we keep installing them due to 'historical' reasons
+	insinto /etc/bluetooth
+	local d
+	for d in input network; do
+		doins profiles/${d}/${d}.conf
+	done
+	# Setup auto enable as Fedora does for allowing to use
+	# keyboards/mouse as soon as possible
+	sed -i 's/#\[Policy\]$/\[Policy\]/; s/#AutoEnable=false/AutoEnable=true/' src/main.conf || die
+	doins src/main.conf
+
+	newinitd "${FILESDIR}"/bluetooth-init.d-r4 bluetooth
+
+	einstalldocs
+	use doc && dodoc doc/*.txt
+	# Install .json files as examples to be used by meshctl
+	if use mesh; then
+		dodoc tools/mesh/*.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
+
+	# From Fedora:
+	# Scripts for automatically btattach-ing serial ports connected to Broadcom HCIs
+	# as found on some Atom based x86 hardware
+	udev_dorules "${FILESDIR}/69-btattach-bcm.rules"
+	systemd_newunit "${FILESDIR}/btattach-bcm_at.service" "btattach-bcm@.service"
+	exeinto /usr/libexec/bluetooth
+	doexe "${FILESDIR}/btattach-bcm-service.sh"
+}
+
+pkg_postinst() {
+	use udev && udev_reload
+	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
+}

diff --git a/net-wireless/bluez/files/0001-Allow-using-obexd-without-systemd-in-the-user-session-r2.patch b/net-wireless/bluez/files/0001-Allow-using-obexd-without-systemd-in-the-user-session-r2.patch
new file mode 100644
index 00000000000..dcebaa007bc
--- /dev/null
+++ b/net-wireless/bluez/files/0001-Allow-using-obexd-without-systemd-in-the-user-session-r2.patch
@@ -0,0 +1,58 @@
+From 3027cb7141fb65cf3eeda69c688db8c4045e2d3f Mon Sep 17 00:00:00 2001
+From: Giovanni Campagna <gcampagna-cNUdlRotFMnNLxjTenLetw@public.gmane.org>
+Date: Sat, 12 Oct 2013 17:45:25 +0200
+Subject: [PATCH] Allow using obexd without systemd in the user session
+
+Not all sessions run systemd --user (actually, the majority
+doesn't), so the dbus daemon must be able to spawn obexd
+directly, and to do so it needs the full path of the daemon.
+---
+ Makefile.obexd                      | 4 ++--
+ obexd/src/org.bluez.obex.service    | 4 ----
+ obexd/src/org.bluez.obex.service.in | 4 ++++
+ 3 files changed, 6 insertions(+), 6 deletions(-)
+ delete mode 100644 obexd/src/org.bluez.obex.service
+ create mode 100644 obexd/src/org.bluez.obex.service.in
+
+diff --git a/Makefile.obexd b/Makefile.obexd
+index 3760867..142e7c3 100644
+--- a/Makefile.obexd
++++ b/Makefile.obexd
+@@ -2,12 +2,12 @@
+ if SYSTEMD
+ systemduserunitdir = $(SYSTEMD_USERUNITDIR)
+ systemduserunit_DATA = obexd/src/obex.service
++endif
+ 
+ dbussessionbusdir = $(DBUS_SESSIONBUSDIR)
+ dbussessionbus_DATA = obexd/src/org.bluez.obex.service
+-endif
+ 
+-EXTRA_DIST += obexd/src/obex.service.in obexd/src/org.bluez.obex.service
++EXTRA_DIST += obexd/src/obex.service.in obexd/src/org.bluez.obex.service.in
+ 
+ obex_plugindir = $(libdir)/obex/plugins
+ 
+diff --git a/obexd/src/org.bluez.obex.service b/obexd/src/org.bluez.obex.service
+deleted file mode 100644
+index a538088..0000000
+--- a/obexd/src/org.bluez.obex.service
++++ /dev/null
+@@ -1,4 +0,0 @@
+-[D-BUS Service]
+-Name=org.bluez.obex
+-Exec=/bin/false
+-SystemdService=dbus-org.bluez.obex.service
+diff --git a/obexd/src/org.bluez.obex.service.in b/obexd/src/org.bluez.obex.service.in
+new file mode 100644
+index 0000000..9c815f2
+--- /dev/null
++++ b/obexd/src/org.bluez.obex.service.in
+@@ -0,0 +1,4 @@
++[D-BUS Service]
++Name=org.bluez.obex
++Exec=@pkglibexecdir@/obexd
++SystemdService=dbus-org.bluez.obex.service
+-- 
+1.8.3.1
+


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-wireless/bluez/, net-wireless/bluez/files/
@ 2019-11-10 12:11 Pacho Ramos
  0 siblings, 0 replies; 22+ messages in thread
From: Pacho Ramos @ 2019-11-10 12:11 UTC (permalink / raw
  To: gentoo-commits

commit:     90af6067b565c94c3812a4a672fff3e3923ab4a5
Author:     Pacho Ramos <pacho <AT> gentoo <DOT> org>
AuthorDate: Sun Nov 10 12:10:59 2019 +0000
Commit:     Pacho Ramos <pacho <AT> gentoo <DOT> org>
CommitDate: Sun Nov 10 12:11:20 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=90af6067

net-wireless/bluez: Drop old

Package-Manager: Portage-2.3.79, Repoman-2.3.18
Signed-off-by: Pacho Ramos <pacho <AT> gentoo.org>

 net-wireless/bluez/Manifest                        |   2 -
 net-wireless/bluez/bluez-5.50-r3.ebuild            | 267 -------------------
 net-wireless/bluez/bluez-5.51-r1.ebuild            | 294 ---------------------
 ...-obexd-without-systemd-in-the-user-sessio.patch |  58 ----
 .../0004-agent-Assert-possible-infinite-loop.patch |  25 --
 .../bluez/files/bluez-5.50-btpclient-header.patch  |  10 -
 .../bluez/files/bluez-5.50-sink-connect.patch      |  72 -----
 net-wireless/bluez/files/bluez-udevadm-path.patch  |  10 -
 8 files changed, 738 deletions(-)

diff --git a/net-wireless/bluez/Manifest b/net-wireless/bluez/Manifest
index 18725c46f41..d1745749f72 100644
--- a/net-wireless/bluez/Manifest
+++ b/net-wireless/bluez/Manifest
@@ -1,4 +1,2 @@
-DIST bluez-5.50-fedora-backports.tar.xz 32232 BLAKE2B 35244036bbe18481e32bef2dcd4a223d44442ce28cee85a3a736bfbf5ee9d74372fa6366dc1102bf86babada608966a8c30b1c2537859a3741c289cabbc76026 SHA512 6d33e8bc67e50dc0d4cee3fa080402a51ddc8b6549f19b6c272de7dc51604eab23f909322f01aaca8a834abdc3cfd0bf24bb8623071af0cf0611d7427c9d8e9a
-DIST bluez-5.50.tar.xz 1755384 BLAKE2B d70763a80fa233cd31fbefc44f73ffceb54c2d7b64ee83df0d2dafb039771d2b18e69dd44b35b2cdf8eee97553c02deca2281f7ec54e958218cf6c4b364a8516 SHA512 64a680e4b3c270bc2439610c91ad2aef36131d84401e4bbdf6c2b7ec8708a19dfc942b31b9189c38a97ca072c761c669ae1aace5f4ff5d06de3ccbf33184be45
 DIST bluez-5.51.tar.xz 1941904 BLAKE2B e8580388961c99305c6f723160e726232a097067815a88a056c1569c55c2ea410004cf92572afbef9b782807d8a940503b4501f9c6046cacac35136fbbe580a8 SHA512 8b14eea98f541b981162abce728e0f917654ad3c990721ec398fe41bdd68069fe55ff64b61bc3c3b9f813facf42c995b07619f6d5d153965de27154b1a7b578f
 DIST bluez-5.52.tar.xz 1957504 BLAKE2B 670cdfb44eca1b184c0bd678bab34116f9172394b86fb69fa454f7bdcc1ae82c466a806879ddef96dddd6ae6cd31466b48f9e87113d43144659ae0c057b9def8 SHA512 9024481910d1dee85578bf3d7a4fc4be2bece516e6216c91aa1a7ac18537f092b47c41c4a5506ddd7e279599d58002e98203c5439745c01df4dbc22a75234c84

diff --git a/net-wireless/bluez/bluez-5.50-r3.ebuild b/net-wireless/bluez/bluez-5.50-r3.ebuild
deleted file mode 100644
index e6f8139acd8..00000000000
--- a/net-wireless/bluez/bluez-5.50-r3.ebuild
+++ /dev/null
@@ -1,267 +0,0 @@
-# Copyright 1999-2019 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-PYTHON_COMPAT=( python2_7 )
-inherit autotools python-single-r1 systemd udev user multilib-minimal
-
-DESCRIPTION="Bluetooth Tools and System Daemons for Linux"
-HOMEPAGE="http://www.bluez.org"
-SRC_URI="
-	https://www.kernel.org/pub/linux/bluetooth/${P}.tar.xz
-	https://dev.gentoo.org/~pacho/${PN}/${P}-fedora-backports.tar.xz
-"
-
-LICENSE="GPL-2+ LGPL-2.1+"
-SLOT="0/3"
-KEYWORDS="amd64 arm arm64 ~hppa ~mips ppc ppc64 x86"
-IUSE="btpclient cups doc debug deprecated extra-tools experimental +mesh midi +obex +readline selinux systemd test test-programs +udev user-session"
-
-# Since this release all remaining extra-tools need readline support, but this could
-# change in the future, hence, this REQUIRED_USE constraint could be dropped
-# again in the future.
-REQUIRED_USE="
-	extra-tools? ( deprecated readline )
-	test? ( ${PYTHON_REQUIRED_USE} )
-	test-programs? ( ${PYTHON_REQUIRED_USE} )
-"
-
-TEST_DEPS="${PYTHON_DEPS}
-	>=dev-python/dbus-python-1[${PYTHON_USEDEP}]
-	dev-python/pygobject:3[${PYTHON_USEDEP}]
-"
-BDEPEND="
-	virtual/pkgconfig
-	test? ( ${TEST_DEPS} )
-"
-DEPEND="
-	>=dev-libs/glib-2.28:2[${MULTILIB_USEDEP}]
-	>=sys-apps/hwids-20121202.2
-	btpclient? ( >=dev-libs/ell-0.3 )
-	cups? ( net-print/cups:= )
-	mesh? (
-		>=dev-libs/ell-0.3
-		dev-libs/json-c:=
-		sys-libs/readline:0=
-	)
-	midi? ( media-libs/alsa-lib )
-	obex? ( dev-libs/libical:= )
-	readline? ( sys-libs/readline:0= )
-	systemd? (
-		>=sys-apps/dbus-1.6:=[user-session=]
-		sys-apps/systemd
-	)
-	!systemd? ( >=sys-apps/dbus-1.6:= )
-	udev? ( >=virtual/udev-172 )
-"
-RDEPEND="${DEPEND}
-	selinux? ( sec-policy/selinux-bluetooth )
-	test-programs? ( ${TEST_DEPS} )
-"
-
-PATCHES=(
-	# Fix missing header (fixed in 'master')
-	"${FILESDIR}"/${P}-btpclient-header.patch
-
-	# Fix switch to A2DP sink profile
-	"${FILESDIR}"/${P}-sink-connect.patch
-
-	# Try both udevadm paths to cover udev/systemd vs. eudev locations (#539844)
-	# http://www.spinics.net/lists/linux-bluetooth/msg58739.html
-	"${FILESDIR}"/${PN}-udevadm-path-r1.patch
-
-	# build: Quote systemd variable names, bug #527432
-	# http://article.gmane.org/gmane.linux.bluez.kernel/67230
-	"${FILESDIR}"/${PN}-5.39-systemd-quote.patch
-
-	# Fedora patches
-	# http://www.spinics.net/lists/linux-bluetooth/msg40136.html
-	"${FILESDIR}"/0001-obex-Use-GLib-helper-function-to-manipulate-paths.patch
-
-	# ???
-	"${FILESDIR}"/0004-agent-Assert-possible-infinite-loop.patch
-)
-
-pkg_setup() {
-	if use test || use test-programs; then
-		python-single-r1_pkg_setup
-	fi
-
-	if ! use udev; then
-		ewarn
-		ewarn "You are installing ${PN} with USE=-udev. This means various bluetooth"
-		ewarn "devices and adapters from Apple, Dell, Logitech etc. will not work,"
-		ewarn "and hid2hci will not be available."
-		ewarn
-	fi
-}
-
-src_prepare() {
-	default
-
-	# Apply Fedora backports
-	eapply "${WORKDIR}"/${P}-fedora-backports/*.patch
-
-	# http://www.spinics.net/lists/linux-bluetooth/msg38490.html
-	if ! use user-session || ! use systemd; then
-		eapply "${FILESDIR}"/0001-Allow-using-obexd-without-systemd-in-the-user-sessio.patch
-	fi
-
-	if use cups; then
-		sed -i \
-			-e "s:cupsdir = \$(libdir)/cups:cupsdir = $(cups-config --serverbin):" \
-			Makefile.{in,tools} || die
-	fi
-
-	# Broken test https://bugzilla.kernel.org/show_bug.cgi?id=196621
-	sed -i -e '/unit_tests += unit\/test-gatt\b/d' Makefile.am || die
-
-	eautoreconf
-
-	multilib_copy_sources
-}
-
-multilib_src_configure() {
-	local myconf=(
-		# readline is automagic when client is enabled
-		# --enable-client always needs readline, bug #504038
-		# --enable-mesh is handled in the same way
-		ac_cv_header_readline_readline_h=$(multilib_native_usex readline)
-		ac_cv_header_readline_readline_h=$(multilib_native_usex mesh)
-	)
-
-	if ! multilib_is_native_abi; then
-		myconf+=(
-			# deps not used for the library
-			{DBUS,GLIB}_{CFLAGS,LIBS}=' '
-		)
-	fi
-
-	econf \
-		--localstatedir=/var \
-		--disable-android \
-		--enable-datafiles \
-		--enable-optimization \
-		$(use_enable debug) \
-		--enable-pie \
-		--enable-threads \
-		--enable-library \
-		--enable-tools \
-		--enable-manpages \
-		--enable-monitor \
-		--with-systemdsystemunitdir="$(systemd_get_systemunitdir)" \
-		--with-systemduserunitdir="$(systemd_get_userunitdir)" \
-		$(multilib_native_use_enable btpclient) \
-		$(multilib_native_use_enable cups) \
-		$(multilib_native_use_enable deprecated) \
-		$(multilib_native_use_enable experimental) \
-		$(multilib_native_use_enable mesh) \
-		$(multilib_native_use_enable midi) \
-		$(multilib_native_use_enable obex) \
-		$(multilib_native_use_enable readline client) \
-		$(multilib_native_use_enable systemd) \
-		$(multilib_native_use_enable test-programs test) \
-		$(multilib_native_use_enable udev) \
-		$(multilib_native_use_enable udev sixaxis)
-}
-
-multilib_src_compile() {
-	if multilib_is_native_abi; then
-		default
-	else
-		emake -f Makefile -f - libs \
-			<<<'libs: $(lib_LTLIBRARIES)'
-	fi
-}
-
-multilib_src_test() {
-	multilib_is_native_abi && default
-}
-
-multilib_src_install() {
-	if multilib_is_native_abi; then
-		emake DESTDIR="${D}" install
-
-		# Only install extra-tools when relevant USE flag is enabled
-		if use extra-tools; then
-			ewarn "Upstream doesn't support using this tools and their bugs are"
-			ewarn "likely to be ignored forever, also that tools can break"
-			ewarn "without previous announcement."
-			ewarn "Upstream also states all this tools are not really needed,"
-			ewarn "then, if you still need to rely on them, you must ask them"
-			ewarn "to either install that tool by default or add the needed"
-			ewarn "functionality to the existing 'official' tools."
-			ewarn "Please report this issues to:"
-			ewarn "http://www.bluez.org/development/lists/"
-
-			# Upstream doesn't install this, bug #524640
-			# http://permalink.gmane.org/gmane.linux.bluez.kernel/53115
-			# http://comments.gmane.org/gmane.linux.bluez.kernel/54564
-			# gatttool is only built with readline, bug #530776
-			dobin attrib/gatttool
-			dobin tools/btmgmt
-		fi
-
-		# Not installed by default after being built, bug #666756
-		use btpclient && dobin tools/btpclient
-
-		# Unittests are not that useful once installed, so make them optional
-		if use test-programs; then
-			# example-gatt-client is the only one needing
-			# python3, the others are python2 only. Remove
-			# until we see how to pull in python2 and python3
-			# for runtime
-			rm "${ED}"/usr/$(get_libdir)/bluez/test/example-gatt-server || die
-			rm "${ED}"/usr/$(get_libdir)/bluez/test/example-gatt-client || die
-			python_fix_shebang "${ED}"/usr/$(get_libdir)/bluez/test
-			for i in $(find "${ED}"/usr/$(get_libdir)/bluez/test -maxdepth 1 -type f ! -name "*.*"); do
-				dosym "${i}" /usr/bin/bluez-"${i##*/}"
-			done
-		fi
-	else
-		emake DESTDIR="${D}" \
-			install-includeHEADERS \
-			install-libLTLIBRARIES \
-			install-pkgconfigDATA
-	fi
-}
-
-multilib_src_install_all() {
-	# We need to ensure obexd can be spawned automatically by systemd
-	# when user-session is enabled:
-	# http://marc.info/?l=linux-bluetooth&m=148096094716386&w=2
-	# https://bugs.gentoo.org/show_bug.cgi?id=577842
-	# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=804908
-	# https://bugs.archlinux.org/task/45816
-	# https://bugzilla.redhat.com/show_bug.cgi?id=1318441
-	# https://bugzilla.redhat.com/show_bug.cgi?id=1389347
-	if use user-session && use systemd; then
-		ln -s "${ED}"/usr/lib/systemd/user/obex.service "${ED}"/usr/lib/systemd/user/dbus-org.bluez.obex.service
-	fi
-
-	find "${D}" -name '*.la' -delete || die
-
-	keepdir /var/lib/bluetooth
-
-	# Upstream don't want people to play with them
-	# But we keep installing them due to 'historical' reasons
-	insinto /etc/bluetooth
-	local d
-	for d in input network; do
-		doins profiles/${d}/${d}.conf
-	done
-	doins src/main.conf
-
-	newinitd "${FILESDIR}"/bluetooth-init.d-r4 bluetooth
-
-	einstalldocs
-	use doc && dodoc doc/*.txt
-}
-
-pkg_postinst() {
-	use udev && udev_reload
-	systemd_reenable bluetooth.service
-
-	has_version net-dialup/ppp || elog "To use dial up networking you must install net-dialup/ppp."
-}

diff --git a/net-wireless/bluez/bluez-5.51-r1.ebuild b/net-wireless/bluez/bluez-5.51-r1.ebuild
deleted file mode 100644
index 1bf47c399e0..00000000000
--- a/net-wireless/bluez/bluez-5.51-r1.ebuild
+++ /dev/null
@@ -1,294 +0,0 @@
-# Copyright 1999-2019 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-PYTHON_COMPAT=( python2_7 )
-
-inherit autotools python-single-r1 readme.gentoo-r1 systemd udev multilib-minimal
-
-DESCRIPTION="Bluetooth Tools and System Daemons for Linux"
-HOMEPAGE="http://www.bluez.org"
-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 ~x86"
-IUSE="btpclient cups doc debug deprecated extra-tools experimental +mesh midi +obex +readline selinux systemd test test-programs +udev user-session"
-
-# Since this release all remaining extra-tools need readline support, but this could
-# change in the future, hence, this REQUIRED_USE constraint could be dropped
-# again in the future.
-REQUIRED_USE="
-	extra-tools? ( deprecated readline )
-	test? ( ${PYTHON_REQUIRED_USE} )
-	test-programs? ( ${PYTHON_REQUIRED_USE} )
-"
-
-TEST_DEPS="${PYTHON_DEPS}
-	>=dev-python/dbus-python-1[${PYTHON_USEDEP}]
-	dev-python/pygobject:3[${PYTHON_USEDEP}]
-"
-BDEPEND="
-	virtual/pkgconfig
-	test? ( ${TEST_DEPS} )
-"
-DEPEND="
-	>=dev-libs/glib-2.28:2[${MULTILIB_USEDEP}]
-	>=sys-apps/hwids-20121202.2
-	btpclient? ( >=dev-libs/ell-0.14 )
-	cups? ( net-print/cups:= )
-	mesh? (
-		>=dev-libs/ell-0.14
-		dev-libs/json-c:=
-		sys-libs/readline:0=
-	)
-	midi? ( media-libs/alsa-lib )
-	obex? ( dev-libs/libical:= )
-	readline? ( sys-libs/readline:0= )
-	systemd? (
-		>=sys-apps/dbus-1.6:=[user-session=]
-		sys-apps/systemd
-	)
-	!systemd? ( >=sys-apps/dbus-1.6:= )
-	udev? ( >=virtual/udev-172 )
-"
-RDEPEND="${DEPEND}
-	selinux? ( sec-policy/selinux-bluetooth )
-	test-programs? ( ${TEST_DEPS} )
-"
-
-RESTRICT="!test? ( test )"
-
-PATCHES=(
-	# Try both udevadm paths to cover udev/systemd vs. eudev locations (#539844)
-	# http://www.spinics.net/lists/linux-bluetooth/msg58739.html
-	# https://bugs.gentoo.org/539844
-	"${FILESDIR}"/${PN}-udevadm-path-r1.patch
-
-	# build: Quote systemd variable names, bug #527432
-	# http://article.gmane.org/gmane.linux.bluez.kernel/67230
-	"${FILESDIR}"/${PN}-5.39-systemd-quote.patch
-
-	# Include limits.h for PATH_MAX
-	# https://marc.info/?l=linux-bluetooth&m=157156119320950&w=2
-	# https://bugs.gentoo.org/695940
-	"${FILESDIR}"/${PN}-5.51-include-limits-h.patch
-
-	# audio: Fix cancelling disconnect timeout (from 'master')
-	# https://marc.info/?l=linux-bluetooth&m=157047663920714&w=2
-	"${FILESDIR}"/${P}-disconnect-timeout.patch
-
-	# Fedora patches
-	# http://www.spinics.net/lists/linux-bluetooth/msg40136.html
-	"${FILESDIR}"/0001-obex-Use-GLib-helper-function-to-manipulate-paths.patch
-)
-
-pkg_setup() {
-	if use test || use test-programs; then
-		python-single-r1_pkg_setup
-	fi
-
-	if ! use udev; then
-		ewarn
-		ewarn "You are installing ${PN} with USE=-udev. This means various bluetooth"
-		ewarn "devices and adapters from Apple, Dell, Logitech etc. will not work,"
-		ewarn "and hid2hci will not be available."
-		ewarn
-	fi
-}
-
-src_prepare() {
-	default
-
-	# http://www.spinics.net/lists/linux-bluetooth/msg38490.html
-	if ! use user-session || ! use systemd; then
-		eapply "${FILESDIR}"/0001-Allow-using-obexd-without-systemd-in-the-user-session-r1.patch
-	fi
-
-	if use cups; then
-		sed -i \
-			-e "s:cupsdir = \$(libdir)/cups:cupsdir = $(cups-config --serverbin):" \
-			Makefile.{in,tools} || die
-	fi
-
-	# Broken test https://bugzilla.kernel.org/show_bug.cgi?id=196621
-	# https://bugs.gentoo.org/618548
-	sed -i -e '/unit_tests += unit\/test-gatt\b/d' Makefile.am || die
-
-	eautoreconf
-
-	multilib_copy_sources
-}
-
-multilib_src_configure() {
-	local myconf=(
-		# readline is automagic when client is enabled
-		# --enable-client always needs readline, bug #504038
-		# --enable-mesh is handled in the same way
-		ac_cv_header_readline_readline_h=$(multilib_native_usex readline)
-		ac_cv_header_readline_readline_h=$(multilib_native_usex mesh)
-	)
-
-	if ! multilib_is_native_abi; then
-		myconf+=(
-			# deps not used for the library
-			{DBUS,GLIB}_{CFLAGS,LIBS}=' '
-		)
-	fi
-
-	econf \
-		--localstatedir=/var \
-		--disable-android \
-		--enable-datafiles \
-		--enable-optimization \
-		$(use_enable debug) \
-		--enable-pie \
-		--enable-threads \
-		--enable-library \
-		--enable-tools \
-		--enable-manpages \
-		--enable-monitor \
-		--with-systemdsystemunitdir="$(systemd_get_systemunitdir)" \
-		--with-systemduserunitdir="$(systemd_get_userunitdir)" \
-		$(multilib_native_use_enable btpclient) \
-		$(multilib_native_use_enable btpclient external-ell) \
-		$(multilib_native_use_enable cups) \
-		$(multilib_native_use_enable deprecated) \
-		$(multilib_native_use_enable experimental) \
-		$(multilib_native_use_enable mesh) \
-		$(multilib_native_use_enable mesh external-ell) \
-		$(multilib_native_use_enable midi) \
-		$(multilib_native_use_enable obex) \
-		$(multilib_native_use_enable readline client) \
-		$(multilib_native_use_enable systemd) \
-		$(multilib_native_use_enable test-programs test) \
-		$(multilib_native_use_enable udev) \
-		$(multilib_native_use_enable udev sixaxis)
-}
-
-multilib_src_compile() {
-	if multilib_is_native_abi; then
-		default
-	else
-		emake -f Makefile -f - libs \
-			<<<'libs: $(lib_LTLIBRARIES)'
-	fi
-}
-
-multilib_src_test() {
-	multilib_is_native_abi && default
-}
-
-multilib_src_install() {
-	if multilib_is_native_abi; then
-		emake DESTDIR="${D}" install
-
-		# Only install extra-tools when relevant USE flag is enabled
-		if use extra-tools; then
-			ewarn "Upstream doesn't support using this tools and their bugs are"
-			ewarn "likely to be ignored forever, also that tools can break"
-			ewarn "without previous announcement."
-			ewarn "Upstream also states all this tools are not really needed,"
-			ewarn "then, if you still need to rely on them, you must ask them"
-			ewarn "to either install that tool by default or add the needed"
-			ewarn "functionality to the existing 'official' tools."
-			ewarn "Please report this issues to:"
-			ewarn "http://www.bluez.org/development/lists/"
-
-			# Upstream doesn't install this, bug #524640
-			# http://permalink.gmane.org/gmane.linux.bluez.kernel/53115
-			# http://comments.gmane.org/gmane.linux.bluez.kernel/54564
-			dobin tools/btmgmt
-			# gatttool is only built with readline, bug #530776
-			# https://bugzilla.redhat.com/show_bug.cgi?id=1141909
-			# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=720486
-			# https://bugs.archlinux.org/task/37686
-			dobin attrib/gatttool
-			# https://bugzilla.redhat.com/show_bug.cgi?id=1699680
-			dobin tools/avinfo
-		fi
-
-		# Not installed by default after being built, bug #666756
-		use btpclient && dobin tools/btpclient
-
-		# Unittests are not that useful once installed, so make them optional
-		if use test-programs; then
-			# Few are needing python3, the others are python2 only. Remove
-			# until we see how to pull in python2 and python3 for runtime
-			rm "${ED}"/usr/$(get_libdir)/bluez/test/example-gatt-server || die
-			rm "${ED}"/usr/$(get_libdir)/bluez/test/example-gatt-client || die
-			rm "${ED}"/usr/$(get_libdir)/bluez/test/agent.py || die
-			rm "${ED}"/usr/$(get_libdir)/bluez/test/test-mesh || die
-
-			python_fix_shebang "${ED}"/usr/$(get_libdir)/bluez/test
-
-			for i in $(find "${ED}"/usr/$(get_libdir)/bluez/test -maxdepth 1 -type f ! -name "*.*"); do
-				dosym "${i}" /usr/bin/bluez-"${i##*/}"
-			done
-		fi
-	else
-		emake DESTDIR="${D}" \
-			install-pkgincludeHEADERS \
-			install-libLTLIBRARIES \
-			install-pkgconfigDATA
-	fi
-}
-
-multilib_src_install_all() {
-	# We need to ensure obexd can be spawned automatically by systemd
-	# when user-session is enabled:
-	# http://marc.info/?l=linux-bluetooth&m=148096094716386&w=2
-	# https://bugs.gentoo.org/show_bug.cgi?id=577842
-	# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=804908
-	# https://bugs.archlinux.org/task/45816
-	# https://bugzilla.redhat.com/show_bug.cgi?id=1318441
-	# https://bugzilla.redhat.com/show_bug.cgi?id=1389347
-	if use user-session && use systemd; then
-		ln -s "${ED}"/usr/lib/systemd/user/obex.service "${ED}"/usr/lib/systemd/user/dbus-org.bluez.obex.service
-	fi
-
-	find "${D}" -name '*.la' -type f -delete || die
-
-	keepdir /var/lib/bluetooth
-
-	# Upstream don't want people to play with them
-	# But we keep installing them due to 'historical' reasons
-	insinto /etc/bluetooth
-	local d
-	for d in input network; do
-		doins profiles/${d}/${d}.conf
-	done
-	# Setup auto enable as Fedora does for allowing to use
-	# keyboards/mouse as soon as possible
-	sed -i 's/#\[Policy\]$/\[Policy\]/; s/#AutoEnable=false/AutoEnable=true/' src/main.conf || die
-	doins src/main.conf
-
-	newinitd "${FILESDIR}"/bluetooth-init.d-r4 bluetooth
-
-	einstalldocs
-	use doc && dodoc doc/*.txt
-	# Install .json files as examples to be used by meshctl
-	if use mesh; then
-		dodoc tools/mesh/*.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
-
-	# From Fedora:
-	# Scripts for automatically btattach-ing serial ports connected to Broadcom HCIs
-	# as found on some Atom based x86 hardware
-	udev_dorules "${FILESDIR}/69-btattach-bcm.rules"
-	systemd_newunit "${FILESDIR}/btattach-bcm_at.service" "btattach-bcm@.service"
-	exeinto /usr/libexec/bluetooth
-	doexe "${FILESDIR}/btattach-bcm-service.sh"
-}
-
-pkg_postinst() {
-	use udev && udev_reload
-	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
-}

diff --git a/net-wireless/bluez/files/0001-Allow-using-obexd-without-systemd-in-the-user-sessio.patch b/net-wireless/bluez/files/0001-Allow-using-obexd-without-systemd-in-the-user-sessio.patch
deleted file mode 100644
index 1ea3e6f3e0c..00000000000
--- a/net-wireless/bluez/files/0001-Allow-using-obexd-without-systemd-in-the-user-sessio.patch
+++ /dev/null
@@ -1,58 +0,0 @@
-From 3027cb7141fb65cf3eeda69c688db8c4045e2d3f Mon Sep 17 00:00:00 2001
-From: Giovanni Campagna <gcampagna-cNUdlRotFMnNLxjTenLetw@public.gmane.org>
-Date: Sat, 12 Oct 2013 17:45:25 +0200
-Subject: [PATCH] Allow using obexd without systemd in the user session
-
-Not all sessions run systemd --user (actually, the majority
-doesn't), so the dbus daemon must be able to spawn obexd
-directly, and to do so it needs the full path of the daemon.
----
- Makefile.obexd                      | 4 ++--
- obexd/src/org.bluez.obex.service    | 4 ----
- obexd/src/org.bluez.obex.service.in | 4 ++++
- 3 files changed, 6 insertions(+), 6 deletions(-)
- delete mode 100644 obexd/src/org.bluez.obex.service
- create mode 100644 obexd/src/org.bluez.obex.service.in
-
-diff --git a/Makefile.obexd b/Makefile.obexd
-index 3760867..142e7c3 100644
---- a/Makefile.obexd
-+++ b/Makefile.obexd
-@@ -2,12 +2,12 @@
- if SYSTEMD
- systemduserunitdir = @SYSTEMD_USERUNITDIR@
- systemduserunit_DATA = obexd/src/obex.service
-+endif
- 
- dbussessionbusdir = @DBUS_SESSIONBUSDIR@
- dbussessionbus_DATA = obexd/src/org.bluez.obex.service
--endif
- 
--EXTRA_DIST += obexd/src/obex.service.in obexd/src/org.bluez.obex.service
-+EXTRA_DIST += obexd/src/obex.service.in obexd/src/org.bluez.obex.service.in
- 
- obex_plugindir = $(libdir)/obex/plugins
- 
-diff --git a/obexd/src/org.bluez.obex.service b/obexd/src/org.bluez.obex.service
-deleted file mode 100644
-index a538088..0000000
---- a/obexd/src/org.bluez.obex.service
-+++ /dev/null
-@@ -1,4 +0,0 @@
--[D-BUS Service]
--Name=org.bluez.obex
--Exec=/bin/false
--SystemdService=dbus-org.bluez.obex.service
-diff --git a/obexd/src/org.bluez.obex.service.in b/obexd/src/org.bluez.obex.service.in
-new file mode 100644
-index 0000000..9c815f2
---- /dev/null
-+++ b/obexd/src/org.bluez.obex.service.in
-@@ -0,0 +1,4 @@
-+[D-BUS Service]
-+Name=org.bluez.obex
-+Exec=@libexecdir@/obexd
-+SystemdService=dbus-org.bluez.obex.service
--- 
-1.8.3.1
-

diff --git a/net-wireless/bluez/files/0004-agent-Assert-possible-infinite-loop.patch b/net-wireless/bluez/files/0004-agent-Assert-possible-infinite-loop.patch
deleted file mode 100644
index 2746e0cdd2c..00000000000
--- a/net-wireless/bluez/files/0004-agent-Assert-possible-infinite-loop.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-From 67e5477687a2753d3f7b300bcfdc74464d8ad41f Mon Sep 17 00:00:00 2001
-From: Bastien Nocera <hadess@hadess.net>
-Date: Mon, 9 Dec 2013 18:04:56 +0100
-Subject: [PATCH 4/5] agent: Assert possible infinite loop
-
----
- src/agent.c | 2 ++
- 1 file changed, 2 insertions(+)
-
-diff --git a/src/agent.c b/src/agent.c
-index bcba969..b292881 100644
---- a/src/agent.c
-+++ b/src/agent.c
-@@ -203,6 +203,8 @@ void agent_unref(struct agent *agent)
- 	if (agent->ref > 0)
- 		return;
- 
-+	g_assert (agent->ref == 0);
-+
- 	if (agent->request) {
- 		DBusError err;
- 		agent_pincode_cb pincode_cb;
--- 
-1.8.4.2
-

diff --git a/net-wireless/bluez/files/bluez-5.50-btpclient-header.patch b/net-wireless/bluez/files/bluez-5.50-btpclient-header.patch
deleted file mode 100644
index 61a8e6a3742..00000000000
--- a/net-wireless/bluez/files/bluez-5.50-btpclient-header.patch
+++ /dev/null
@@ -1,10 +0,0 @@
-diff -Nuar bluez-5.50/tools/btpclient.c bluez-5.50-fixed/tools/btpclient.c
---- bluez-5.50/tools/btpclient.c	2018-03-10 17:37:07.000000000 +0200
-+++ bluez-5.50-fixed/tools/btpclient.c	2018-11-18 09:54:38.916794492 +0200
-@@ -29,6 +29,7 @@
- #include <stdlib.h>
- #include <assert.h>
- #include <getopt.h>
-+#include <signal.h>
- 
- #include <ell/ell.h>

diff --git a/net-wireless/bluez/files/bluez-5.50-sink-connect.patch b/net-wireless/bluez/files/bluez-5.50-sink-connect.patch
deleted file mode 100644
index 2093b69a655..00000000000
--- a/net-wireless/bluez/files/bluez-5.50-sink-connect.patch
+++ /dev/null
@@ -1,72 +0,0 @@
-From 477ecca127c529611adbc53f08039cefaf86305d Mon Sep 17 00:00:00 2001
-From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
-Date: Tue, 26 Jun 2018 13:37:33 +0300
-Subject: policy: Add logic to connect a Sink
-
-If HFP/HSP HS connects and the device also supports a Sink connect it
-as well since some devices (e.g. Sony MW600) may not connect it
-automatically.
----
- plugins/policy.c | 39 +++++++++++++++++++++++++++++++++++++++
- 1 file changed, 39 insertions(+)
-
-diff --git a/plugins/policy.c b/plugins/policy.c
-index 1f5a506a2..de51e58b9 100644
---- a/plugins/policy.c
-+++ b/plugins/policy.c
-@@ -297,6 +297,42 @@ static void sink_cb(struct btd_service *service, btd_service_state_t old_state,
- 	}
- }
- 
-+static void hs_cb(struct btd_service *service, btd_service_state_t old_state,
-+						btd_service_state_t new_state)
-+{
-+	struct btd_device *dev = btd_service_get_device(service);
-+	struct policy_data *data;
-+	struct btd_service *sink;
-+
-+	/* If the device supports Sink set a timer to connect it as well */
-+	sink = btd_device_get_service(dev, A2DP_SINK_UUID);
-+	if (sink == NULL)
-+		return;
-+
-+	data = policy_get_data(dev);
-+
-+	switch (new_state) {
-+	case BTD_SERVICE_STATE_UNAVAILABLE:
-+		break;
-+	case BTD_SERVICE_STATE_DISCONNECTED:
-+		break;
-+	case BTD_SERVICE_STATE_CONNECTING:
-+		break;
-+	case BTD_SERVICE_STATE_CONNECTED:
-+		/* Check if service initiate the connection then proceed
-+		 * immediately otherwise set timer
-+		 */
-+		if (old_state == BTD_SERVICE_STATE_CONNECTING)
-+			policy_connect(data, sink);
-+		else if (btd_service_get_state(sink) !=
-+						BTD_SERVICE_STATE_CONNECTED)
-+			policy_set_sink_timer(data);
-+		break;
-+	case BTD_SERVICE_STATE_DISCONNECTING:
-+		break;
-+	}
-+}
-+
- static gboolean policy_connect_tg(gpointer user_data)
- {
- 	struct policy_data *data = user_data;
-@@ -615,6 +651,9 @@ static void service_cb(struct btd_service *service,
- 		controller_cb(service, old_state, new_state);
- 	else if (g_str_equal(profile->remote_uuid, AVRCP_TARGET_UUID))
- 		target_cb(service, old_state, new_state);
-+	else if (g_str_equal(profile->remote_uuid, HFP_HS_UUID) ||
-+			g_str_equal(profile->remote_uuid, HSP_HS_UUID))
-+		hs_cb(service, old_state, new_state);
- 
- 	/*
- 	 * Return if the reconnection feature is not enabled (all
--- 
-cgit 1.2-0.3.lf.el7
-

diff --git a/net-wireless/bluez/files/bluez-udevadm-path.patch b/net-wireless/bluez/files/bluez-udevadm-path.patch
deleted file mode 100644
index f9bbac5b987..00000000000
--- a/net-wireless/bluez/files/bluez-udevadm-path.patch
+++ /dev/null
@@ -1,10 +0,0 @@
---- a/tools/hid2hci.rules
-+++ b/tools/hid2hci.rules
-@@ -20,6 +20,7 @@
- # Unfortunately the only event seen is the BT device disappearing, so the mouse
- # device needs to be chased down on the USB bus.
- ATTR{bDeviceClass}=="e0", ATTR{bDeviceSubClass}=="01", ATTR{bDeviceProtocol}=="01", ATTR{idVendor}=="413c", \
-+  ENV{REMOVE_CMD}="/usr/bin/udevadm trigger --action=change --subsystem-match=usb --property-match=HID2HCI_SWITCH=1"     \
-   ENV{REMOVE_CMD}="/sbin/udevadm trigger --action=change --subsystem-match=usb --property-match=HID2HCI_SWITCH=1"
- 
- # CSR devices


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-wireless/bluez/, net-wireless/bluez/files/
@ 2020-03-11 15:01 Pacho Ramos
  0 siblings, 0 replies; 22+ messages in thread
From: Pacho Ramos @ 2020-03-11 15:01 UTC (permalink / raw
  To: gentoo-commits

commit:     f9fda6486b9c8d070a5c8fa1e9d76093cb21ee70
Author:     Pacho Ramos <pacho <AT> gentoo <DOT> org>
AuthorDate: Wed Mar 11 14:50:34 2020 +0000
Commit:     Pacho Ramos <pacho <AT> gentoo <DOT> org>
CommitDate: Wed Mar 11 15:01:29 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f9fda648

net-wireless/bluez: Drop old

Package-Manager: Portage-2.3.93, Repoman-2.3.20
Signed-off-by: Pacho Ramos <pacho <AT> gentoo.org>

 net-wireless/bluez/Manifest                        |   1 -
 net-wireless/bluez/bluez-5.51-r2.ebuild            | 292 ---------------------
 .../files/bluez-5.51-disconnect-timeout.patch      | 104 --------
 .../bluez/files/bluez-5.51-include-limits-h.patch  |  64 -----
 4 files changed, 461 deletions(-)

diff --git a/net-wireless/bluez/Manifest b/net-wireless/bluez/Manifest
index d1745749f72..ec45687f7a0 100644
--- a/net-wireless/bluez/Manifest
+++ b/net-wireless/bluez/Manifest
@@ -1,2 +1 @@
-DIST bluez-5.51.tar.xz 1941904 BLAKE2B e8580388961c99305c6f723160e726232a097067815a88a056c1569c55c2ea410004cf92572afbef9b782807d8a940503b4501f9c6046cacac35136fbbe580a8 SHA512 8b14eea98f541b981162abce728e0f917654ad3c990721ec398fe41bdd68069fe55ff64b61bc3c3b9f813facf42c995b07619f6d5d153965de27154b1a7b578f
 DIST bluez-5.52.tar.xz 1957504 BLAKE2B 670cdfb44eca1b184c0bd678bab34116f9172394b86fb69fa454f7bdcc1ae82c466a806879ddef96dddd6ae6cd31466b48f9e87113d43144659ae0c057b9def8 SHA512 9024481910d1dee85578bf3d7a4fc4be2bece516e6216c91aa1a7ac18537f092b47c41c4a5506ddd7e279599d58002e98203c5439745c01df4dbc22a75234c84

diff --git a/net-wireless/bluez/bluez-5.51-r2.ebuild b/net-wireless/bluez/bluez-5.51-r2.ebuild
deleted file mode 100644
index 5b222563fc8..00000000000
--- a/net-wireless/bluez/bluez-5.51-r2.ebuild
+++ /dev/null
@@ -1,292 +0,0 @@
-# Copyright 1999-2020 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-PYTHON_COMPAT=( python2_7 )
-
-inherit autotools python-single-r1 readme.gentoo-r1 systemd udev multilib-minimal
-
-DESCRIPTION="Bluetooth Tools and System Daemons for Linux"
-HOMEPAGE="http://www.bluez.org"
-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 x86"
-IUSE="btpclient cups doc debug deprecated extra-tools experimental +mesh midi +obex +readline selinux systemd test test-programs +udev user-session"
-
-# Since this release all remaining extra-tools need readline support, but this could
-# change in the future, hence, this REQUIRED_USE constraint could be dropped
-# again in the future.
-REQUIRED_USE="
-	extra-tools? ( deprecated readline )
-	test? ( ${PYTHON_REQUIRED_USE} )
-	test-programs? ( ${PYTHON_REQUIRED_USE} )
-"
-
-TEST_DEPS="${PYTHON_DEPS}
-	$(python_gen_cond_dep '
-		>=dev-python/dbus-python-1[${PYTHON_MULTI_USEDEP}]
-		dev-python/pygobject:3[${PYTHON_MULTI_USEDEP}]
-	')
-"
-BDEPEND="
-	virtual/pkgconfig
-	test? ( ${TEST_DEPS} )
-"
-DEPEND="
-	>=dev-libs/glib-2.28:2[${MULTILIB_USEDEP}]
-	>=sys-apps/hwids-20121202.2
-	btpclient? ( >=dev-libs/ell-0.14 )
-	cups? ( net-print/cups:= )
-	mesh? (
-		>=dev-libs/ell-0.14
-		dev-libs/json-c:=
-		sys-libs/readline:0=
-	)
-	midi? ( media-libs/alsa-lib )
-	obex? ( dev-libs/libical:= )
-	readline? ( sys-libs/readline:0= )
-	systemd? (
-		>=sys-apps/dbus-1.6:=[user-session=]
-		sys-apps/systemd
-	)
-	!systemd? ( >=sys-apps/dbus-1.6:= )
-	udev? ( >=virtual/udev-172 )
-"
-RDEPEND="${DEPEND}
-	selinux? ( sec-policy/selinux-bluetooth )
-	test-programs? ( ${TEST_DEPS} )
-"
-
-RESTRICT="!test? ( test )"
-
-PATCHES=(
-	# Try both udevadm paths to cover udev/systemd vs. eudev locations (#539844)
-	# http://www.spinics.net/lists/linux-bluetooth/msg58739.html
-	# https://bugs.gentoo.org/539844
-	"${FILESDIR}"/${PN}-udevadm-path-r1.patch
-
-	# Include limits.h for PATH_MAX
-	# https://marc.info/?l=linux-bluetooth&m=157156119320950&w=2
-	# https://bugs.gentoo.org/695940
-	"${FILESDIR}"/${PN}-5.51-include-limits-h.patch
-
-	# audio: Fix cancelling disconnect timeout (from 'master')
-	# https://marc.info/?l=linux-bluetooth&m=157047663920714&w=2
-	"${FILESDIR}"/${P}-disconnect-timeout.patch
-
-	# Fedora patches
-	# http://www.spinics.net/lists/linux-bluetooth/msg40136.html
-	"${FILESDIR}"/0001-obex-Use-GLib-helper-function-to-manipulate-paths.patch
-)
-
-pkg_setup() {
-	if use test || use test-programs; then
-		python-single-r1_pkg_setup
-	fi
-
-	if ! use udev; then
-		ewarn
-		ewarn "You are installing ${PN} with USE=-udev. This means various bluetooth"
-		ewarn "devices and adapters from Apple, Dell, Logitech etc. will not work,"
-		ewarn "and hid2hci will not be available."
-		ewarn
-	fi
-}
-
-src_prepare() {
-	default
-
-	# http://www.spinics.net/lists/linux-bluetooth/msg38490.html
-	if ! use user-session || ! use systemd; then
-		eapply "${FILESDIR}"/0001-Allow-using-obexd-without-systemd-in-the-user-session-r2.patch
-	fi
-
-	if use cups; then
-		sed -i \
-			-e "s:cupsdir = \$(libdir)/cups:cupsdir = $(cups-config --serverbin):" \
-			Makefile.{in,tools} || die
-	fi
-
-	# Broken test https://bugzilla.kernel.org/show_bug.cgi?id=196621
-	# https://bugs.gentoo.org/618548
-	sed -i -e '/unit_tests += unit\/test-gatt\b/d' Makefile.am || die
-
-	eautoreconf
-
-	multilib_copy_sources
-}
-
-multilib_src_configure() {
-	local myconf=(
-		# readline is automagic when client is enabled
-		# --enable-client always needs readline, bug #504038
-		# --enable-mesh is handled in the same way
-		ac_cv_header_readline_readline_h=$(multilib_native_usex readline)
-		ac_cv_header_readline_readline_h=$(multilib_native_usex mesh)
-	)
-
-	if ! multilib_is_native_abi; then
-		myconf+=(
-			# deps not used for the library
-			{DBUS,GLIB}_{CFLAGS,LIBS}=' '
-		)
-	fi
-
-	econf \
-		--localstatedir=/var \
-		--disable-android \
-		--enable-datafiles \
-		--enable-optimization \
-		$(use_enable debug) \
-		--enable-pie \
-		--enable-threads \
-		--enable-library \
-		--enable-tools \
-		--enable-manpages \
-		--enable-monitor \
-		--with-systemdsystemunitdir="$(systemd_get_systemunitdir)" \
-		--with-systemduserunitdir="$(systemd_get_userunitdir)" \
-		$(multilib_native_use_enable btpclient) \
-		$(multilib_native_use_enable btpclient external-ell) \
-		$(multilib_native_use_enable cups) \
-		$(multilib_native_use_enable deprecated) \
-		$(multilib_native_use_enable experimental) \
-		$(multilib_native_use_enable mesh) \
-		$(multilib_native_use_enable mesh external-ell) \
-		$(multilib_native_use_enable midi) \
-		$(multilib_native_use_enable obex) \
-		$(multilib_native_use_enable readline client) \
-		$(multilib_native_use_enable systemd) \
-		$(multilib_native_use_enable test-programs test) \
-		$(multilib_native_use_enable udev) \
-		$(multilib_native_use_enable udev sixaxis)
-}
-
-multilib_src_compile() {
-	if multilib_is_native_abi; then
-		default
-	else
-		emake -f Makefile -f - libs \
-			<<<'libs: $(lib_LTLIBRARIES)'
-	fi
-}
-
-multilib_src_test() {
-	multilib_is_native_abi && default
-}
-
-multilib_src_install() {
-	if multilib_is_native_abi; then
-		emake DESTDIR="${D}" install
-
-		# Only install extra-tools when relevant USE flag is enabled
-		if use extra-tools; then
-			ewarn "Upstream doesn't support using this tools and their bugs are"
-			ewarn "likely to be ignored forever, also that tools can break"
-			ewarn "without previous announcement."
-			ewarn "Upstream also states all this tools are not really needed,"
-			ewarn "then, if you still need to rely on them, you must ask them"
-			ewarn "to either install that tool by default or add the needed"
-			ewarn "functionality to the existing 'official' tools."
-			ewarn "Please report this issues to:"
-			ewarn "http://www.bluez.org/development/lists/"
-
-			# Upstream doesn't install this, bug #524640
-			# http://permalink.gmane.org/gmane.linux.bluez.kernel/53115
-			# http://comments.gmane.org/gmane.linux.bluez.kernel/54564
-			dobin tools/btmgmt
-			# gatttool is only built with readline, bug #530776
-			# https://bugzilla.redhat.com/show_bug.cgi?id=1141909
-			# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=720486
-			# https://bugs.archlinux.org/task/37686
-			dobin attrib/gatttool
-			# https://bugzilla.redhat.com/show_bug.cgi?id=1699680
-			dobin tools/avinfo
-		fi
-
-		# Not installed by default after being built, bug #666756
-		use btpclient && dobin tools/btpclient
-
-		# Unittests are not that useful once installed, so make them optional
-		if use test-programs; then
-			# Few are needing python3, the others are python2 only. Remove
-			# until we see how to pull in python2 and python3 for runtime
-			rm "${ED}"/usr/$(get_libdir)/bluez/test/example-gatt-server || die
-			rm "${ED}"/usr/$(get_libdir)/bluez/test/example-gatt-client || die
-			rm "${ED}"/usr/$(get_libdir)/bluez/test/agent.py || die
-			rm "${ED}"/usr/$(get_libdir)/bluez/test/test-mesh || die
-
-			python_fix_shebang "${ED}"/usr/$(get_libdir)/bluez/test
-
-			for i in $(find "${ED}"/usr/$(get_libdir)/bluez/test -maxdepth 1 -type f ! -name "*.*"); do
-				dosym "${i}" /usr/bin/bluez-"${i##*/}"
-			done
-		fi
-	else
-		emake DESTDIR="${D}" \
-			install-pkgincludeHEADERS \
-			install-libLTLIBRARIES \
-			install-pkgconfigDATA
-	fi
-}
-
-multilib_src_install_all() {
-	# We need to ensure obexd can be spawned automatically by systemd
-	# when user-session is enabled:
-	# http://marc.info/?l=linux-bluetooth&m=148096094716386&w=2
-	# https://bugs.gentoo.org/show_bug.cgi?id=577842
-	# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=804908
-	# https://bugs.archlinux.org/task/45816
-	# https://bugzilla.redhat.com/show_bug.cgi?id=1318441
-	# https://bugzilla.redhat.com/show_bug.cgi?id=1389347
-	if use user-session && use systemd; then
-		ln -s "${ED}"/usr/lib/systemd/user/obex.service "${ED}"/usr/lib/systemd/user/dbus-org.bluez.obex.service
-	fi
-
-	find "${D}" -name '*.la' -type f -delete || die
-
-	keepdir /var/lib/bluetooth
-
-	# Upstream don't want people to play with them
-	# But we keep installing them due to 'historical' reasons
-	insinto /etc/bluetooth
-	local d
-	for d in input network; do
-		doins profiles/${d}/${d}.conf
-	done
-	# Setup auto enable as Fedora does for allowing to use
-	# keyboards/mouse as soon as possible
-	sed -i 's/#\[Policy\]$/\[Policy\]/; s/#AutoEnable=false/AutoEnable=true/' src/main.conf || die
-	doins src/main.conf
-
-	newinitd "${FILESDIR}"/bluetooth-init.d-r4 bluetooth
-
-	einstalldocs
-	use doc && dodoc doc/*.txt
-	# Install .json files as examples to be used by meshctl
-	if use mesh; then
-		dodoc tools/mesh/*.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
-
-	# From Fedora:
-	# Scripts for automatically btattach-ing serial ports connected to Broadcom HCIs
-	# as found on some Atom based x86 hardware
-	udev_dorules "${FILESDIR}/69-btattach-bcm.rules"
-	systemd_newunit "${FILESDIR}/btattach-bcm_at.service" "btattach-bcm@.service"
-	exeinto /usr/libexec/bluetooth
-	doexe "${FILESDIR}/btattach-bcm-service.sh"
-}
-
-pkg_postinst() {
-	use udev && udev_reload
-	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
-}

diff --git a/net-wireless/bluez/files/bluez-5.51-disconnect-timeout.patch b/net-wireless/bluez/files/bluez-5.51-disconnect-timeout.patch
deleted file mode 100644
index 2f6e7c8c4d9..00000000000
--- a/net-wireless/bluez/files/bluez-5.51-disconnect-timeout.patch
+++ /dev/null
@@ -1,104 +0,0 @@
-From 52faac4648500dd45c06b6aa41f1be426c43a125 Mon Sep 17 00:00:00 2001
-From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
-Date: Fri, 11 Oct 2019 15:40:04 +0300
-Subject: audio: Fix cancelling disconnect timeout
-
-If AVDTP session has been connected but no stream has been setup calls
-to service->connect would return -EBUSY to avoid stream setup collision
-but it also takes a reference to the session cancelling the disconnect
-timeout and disabling the stream_setup logic that would attempt to
-estabilish a stream.
----
- profiles/audio/sink.c   | 25 ++++++++++++-------------
- profiles/audio/source.c | 25 ++++++++++++-------------
- 2 files changed, 24 insertions(+), 26 deletions(-)
-
-diff --git a/profiles/audio/sink.c b/profiles/audio/sink.c
-index 7cac21034..966440534 100644
---- a/profiles/audio/sink.c
-+++ b/profiles/audio/sink.c
-@@ -256,11 +256,18 @@ gboolean sink_setup_stream(struct btd_service *service, struct avdtp *session)
- 	if (sink->connect_id > 0 || sink->disconnect_id > 0)
- 		return FALSE;
- 
--	if (session && !sink->session)
--		sink->session = avdtp_ref(session);
--
--	if (!sink->session)
--		return FALSE;
-+	if (!sink->session) {
-+		if (session)
-+			sink->session = avdtp_ref(session);
-+		else
-+			sink->session = a2dp_avdtp_get(
-+					btd_service_get_device(service));
-+
-+		if (!sink->session) {
-+			DBG("Unable to get a session");
-+			return FALSE;
-+		}
-+	}
- 
- 	sink->connect_id = a2dp_discover(sink->session, discovery_complete,
- 								sink);
-@@ -274,14 +281,6 @@ int sink_connect(struct btd_service *service)
- {
- 	struct sink *sink = btd_service_get_user_data(service);
- 
--	if (!sink->session)
--		sink->session = a2dp_avdtp_get(btd_service_get_device(service));
--
--	if (!sink->session) {
--		DBG("Unable to get a session");
--		return -EIO;
--	}
--
- 	if (sink->connect_id > 0 || sink->disconnect_id > 0)
- 		return -EBUSY;
- 
-diff --git a/profiles/audio/source.c b/profiles/audio/source.c
-index 4081e1970..0ac20fe40 100644
---- a/profiles/audio/source.c
-+++ b/profiles/audio/source.c
-@@ -257,11 +257,18 @@ gboolean source_setup_stream(struct btd_service *service,
- 	if (source->connect_id > 0 || source->disconnect_id > 0)
- 		return FALSE;
- 
--	if (session && !source->session)
--		source->session = avdtp_ref(session);
--
--	if (!source->session)
--		return FALSE;
-+	if (!source->session) {
-+		if (session)
-+			source->session = avdtp_ref(session);
-+		else
-+			source->session = a2dp_avdtp_get(
-+					btd_service_get_device(service));
-+
-+		if (!source->session) {
-+			DBG("Unable to get a session");
-+			return FALSE;
-+		}
-+	}
- 
- 	source->connect_id = a2dp_discover(source->session, discovery_complete,
- 								source);
-@@ -275,14 +282,6 @@ int source_connect(struct btd_service *service)
- {
- 	struct source *source = btd_service_get_user_data(service);
- 
--	if (!source->session)
--		source->session = a2dp_avdtp_get(btd_service_get_device(service));
--
--	if (!source->session) {
--		DBG("Unable to get a session");
--		return -EIO;
--	}
--
- 	if (source->connect_id > 0 || source->disconnect_id > 0)
- 		return -EBUSY;
- 
--- 
-cgit 1.2-0.3.lf.el7
-

diff --git a/net-wireless/bluez/files/bluez-5.51-include-limits-h.patch b/net-wireless/bluez/files/bluez-5.51-include-limits-h.patch
deleted file mode 100644
index ccbc152a4ee..00000000000
--- a/net-wireless/bluez/files/bluez-5.51-include-limits-h.patch
+++ /dev/null
@@ -1,64 +0,0 @@
-From 20128c5c95fbae93c9fd996d5ad2584cf6ad8032 Mon Sep 17 00:00:00 2001
-From: Jory Pratt <anarchy@gentoo.org>
-Date: Mon, 30 Sep 2019 18:35:56 -0500
-Subject: [PATCH] Include limits.h for PATH_MAX
-
-Signed-off-by: Jory Pratt <anarchy@gentoo.org>
----
- mesh/keyring.c          | 1 +
- mesh/mesh-config-json.c | 1 +
- mesh/node.c             | 1 +
- mesh/util.c             | 1 +
- 4 files changed, 4 insertions(+)
-
-diff --git a/mesh/keyring.c b/mesh/keyring.c
-index 3a7f92f..9fa7d6b 100644
---- a/mesh/keyring.c
-+++ b/mesh/keyring.c
-@@ -24,6 +24,7 @@
- #define _GNU_SOURCE
- #include <fcntl.h>
- #include <dirent.h>
-+#include <limits.h>
- #include <stdio.h>
- #include <unistd.h>
- #include <dirent.h>
-diff --git a/mesh/mesh-config-json.c b/mesh/mesh-config-json.c
-index cafa2fd..74ca495 100644
---- a/mesh/mesh-config-json.c
-+++ b/mesh/mesh-config-json.c
-@@ -27,6 +27,7 @@
- #include <fcntl.h>
- #include <ftw.h>
- #include <libgen.h>
-+#include <limits.h>
- #include <stdio.h>
- #include <string.h>
- #include <unistd.h>
-diff --git a/mesh/node.c b/mesh/node.c
-index b6824f5..15dcb97 100644
---- a/mesh/node.c
-+++ b/mesh/node.c
-@@ -23,6 +23,7 @@
- 
- #define _GNU_SOURCE
- #include <dirent.h>
-+#include <limits.h>
- #include <stdio.h>
- #include <sys/time.h>
- 
-diff --git a/mesh/util.c b/mesh/util.c
-index 1455bde..986ba4b 100644
---- a/mesh/util.c
-+++ b/mesh/util.c
-@@ -25,6 +25,7 @@
- #include <dirent.h>
- #include <ftw.h>
- #include <stdio.h>
-+#include <limits.h>
- #include <time.h>
- #include <sys/time.h>
- 
--- 
-2.23.0
-


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-wireless/bluez/, net-wireless/bluez/files/
@ 2021-06-05 10:53 Pacho Ramos
  0 siblings, 0 replies; 22+ messages in thread
From: Pacho Ramos @ 2021-06-05 10:53 UTC (permalink / raw
  To: gentoo-commits

commit:     6a96eb681d21361852158b122f44ef3a8a8d81d2
Author:     Pacho Ramos <pacho <AT> gentoo <DOT> org>
AuthorDate: Sat Jun  5 10:52:16 2021 +0000
Commit:     Pacho Ramos <pacho <AT> gentoo <DOT> org>
CommitDate: Sat Jun  5 10:53:23 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6a96eb68

net-wireless/bluez: Fix rfkill handling with latest kernels

Closes: https://bugs.gentoo.org/787749
Thanks-to: Iade Gesso
Thanks-to: poncho
Package-Manager: Portage-3.0.19, Repoman-3.0.3
Signed-off-by: Pacho Ramos <pacho <AT> gentoo.org>

 net-wireless/bluez/bluez-5.58-r1.ebuild          | 296 +++++++++++++++++++++++
 net-wireless/bluez/files/bluez-5.58-rfkill.patch |  84 +++++++
 2 files changed, 380 insertions(+)

diff --git a/net-wireless/bluez/bluez-5.58-r1.ebuild b/net-wireless/bluez/bluez-5.58-r1.ebuild
new file mode 100644
index 00000000000..c34a9ecc702
--- /dev/null
+++ b/net-wireless/bluez/bluez-5.58-r1.ebuild
@@ -0,0 +1,296 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+PYTHON_COMPAT=( python3_{7..9} )
+
+inherit autotools linux-info python-single-r1 readme.gentoo-r1 systemd udev multilib-minimal
+
+DESCRIPTION="Bluetooth Tools and System Daemons for Linux"
+HOMEPAGE="http://www.bluez.org"
+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 ~x86"
+IUSE="btpclient cups doc debug deprecated extra-tools experimental +mesh midi +obex +readline selinux systemd test test-programs +udev user-session"
+
+# Since this release all remaining extra-tools need readline support, but this could
+# change in the future, hence, this REQUIRED_USE constraint could be dropped
+# again in the future.
+REQUIRED_USE="
+	extra-tools? ( deprecated readline )
+	test? ( ${PYTHON_REQUIRED_USE} )
+	test-programs? ( ${PYTHON_REQUIRED_USE} )
+"
+
+TEST_DEPS="${PYTHON_DEPS}
+	$(python_gen_cond_dep '
+		>=dev-python/dbus-python-1[${PYTHON_MULTI_USEDEP}]
+		dev-python/pygobject:3[${PYTHON_MULTI_USEDEP}]
+	')
+"
+BDEPEND="
+	virtual/pkgconfig
+	test? ( ${TEST_DEPS} )
+"
+DEPEND="
+	>=dev-libs/glib-2.28:2[${MULTILIB_USEDEP}]
+	>=sys-apps/hwids-20121202.2
+	btpclient? ( >=dev-libs/ell-0.39 )
+	cups? ( net-print/cups:= )
+	mesh? (
+		>=dev-libs/ell-0.39
+		>=dev-libs/json-c-0.13:=
+		sys-libs/readline:0=
+	)
+	midi? ( media-libs/alsa-lib )
+	obex? ( dev-libs/libical:= )
+	readline? ( sys-libs/readline:0= )
+	systemd? (
+		>=sys-apps/dbus-1.6:=[user-session=]
+		sys-apps/systemd
+	)
+	!systemd? ( >=sys-apps/dbus-1.6:= )
+	udev? ( >=virtual/udev-172 )
+"
+RDEPEND="${DEPEND}
+	selinux? ( sec-policy/selinux-bluetooth )
+	test-programs? ( ${TEST_DEPS} )
+"
+
+RESTRICT="!test? ( test )"
+
+PATCHES=(
+	# rfkill: Fix reading from rfkill socket
+	"${FILESDIR}"/${P}-rfkill.patch
+
+	# Try both udevadm paths to cover udev/systemd vs. eudev locations (#539844)
+	# http://www.spinics.net/lists/linux-bluetooth/msg58739.html
+	# https://bugs.gentoo.org/539844
+	"${FILESDIR}"/${PN}-udevadm-path-r1.patch
+
+	# Fedora patches
+	# http://www.spinics.net/lists/linux-bluetooth/msg40136.html
+	"${FILESDIR}"/0001-obex-Use-GLib-helper-function-to-manipulate-paths.patch
+)
+
+pkg_setup() {
+	# From http://www.linuxfromscratch.org/blfs/view/svn/general/bluez.html
+	# to prevent bugs like:
+	# https://bugzilla.kernel.org/show_bug.cgi?id=196621
+	CONFIG_CHECK="~NET ~BT ~BT_RFCOMM ~BT_RFCOMM_TTY ~BT_BNEP ~BT_BNEP_MC_FILTER
+				~BT_BNEP_PROTO_FILTER ~BT_HIDP ~RFKILL"
+	# https://bugzilla.kernel.org/show_bug.cgi?id=196621
+	# https://bugzilla.kernel.org/show_bug.cgi?id=206815
+	if use mesh || use test; then
+		CONFIG_CHECK="${CONFIG_CHECK} ~CRYPTO_USER
+		~CRYPTO_USER_API ~CRYPTO_USER_API_AEAD ~CRYPTO_USER_API_HASH
+		~CRYPTO_AES ~CRYPTO_CCM ~CRYPTO_AEAD ~CRYPTO_CMAC"
+	fi
+	if use test; then
+		# http://www.linuxfromscratch.org/blfs/view/svn/general/bluez.html
+		CONFIG_CHECK="${CONFIG_CHECK} ~CRYPTO ~CRYPTO_USER_API_HASH ~CRYPTO_USER_API_SKCIPHER"
+	fi
+	linux-info_pkg_setup
+
+	if use test || use test-programs; then
+		python-single-r1_pkg_setup
+	fi
+
+	if ! use udev; then
+		ewarn
+		ewarn "You are installing ${PN} with USE=-udev. This means various bluetooth"
+		ewarn "devices and adapters from Apple, Dell, Logitech etc. will not work,"
+		ewarn "and hid2hci will not be available."
+		ewarn
+	fi
+}
+
+src_prepare() {
+	default
+
+	# http://www.spinics.net/lists/linux-bluetooth/msg38490.html
+	if ! use user-session || ! use systemd; then
+		eapply "${FILESDIR}"/0001-Allow-using-obexd-without-systemd-in-the-user-session-r2.patch
+	fi
+
+	eautoreconf
+
+	if use cups; then
+		# Only not .am to not need to run eautoreconf only because of this
+		sed -i \
+			-e "s:cupsdir = \$(libdir)/cups:cupsdir = $(cups-config --serverbin):" \
+			Makefile.{in,tools} || die
+	fi
+
+	multilib_copy_sources
+}
+
+multilib_src_configure() {
+	local myconf=(
+		# readline is automagic when client is enabled
+		# --enable-client always needs readline, bug #504038
+		# --enable-mesh is handled in the same way
+		ac_cv_header_readline_readline_h=$(multilib_native_usex readline)
+		ac_cv_header_readline_readline_h=$(multilib_native_usex mesh)
+	)
+
+	if ! multilib_is_native_abi; then
+		myconf+=(
+			# deps not used for the library
+			{DBUS,GLIB}_{CFLAGS,LIBS}=' '
+		)
+	fi
+
+	econf \
+		--localstatedir=/var \
+		--disable-android \
+		--enable-datafiles \
+		--enable-optimization \
+		$(use_enable debug) \
+		--enable-pie \
+		--enable-threads \
+		--enable-library \
+		--enable-tools \
+		--enable-manpages \
+		--enable-monitor \
+		--with-systemdsystemunitdir="$(systemd_get_systemunitdir)" \
+		--with-systemduserunitdir="$(systemd_get_userunitdir)" \
+		$(multilib_native_use_enable btpclient) \
+		$(multilib_native_use_enable btpclient external-ell) \
+		$(multilib_native_use_enable cups) \
+		$(multilib_native_use_enable deprecated) \
+		$(multilib_native_use_enable experimental) \
+		$(multilib_native_use_enable mesh) \
+		$(multilib_native_use_enable mesh external-ell) \
+		$(multilib_native_use_enable midi) \
+		$(multilib_native_use_enable obex) \
+		$(multilib_native_use_enable readline client) \
+		$(multilib_native_use_enable systemd) \
+		$(multilib_native_use_enable test-programs test) \
+		$(multilib_native_use_enable udev) \
+		$(multilib_native_use_enable udev hid2hci) \
+		$(multilib_native_use_enable udev sixaxis)
+}
+
+multilib_src_compile() {
+	if multilib_is_native_abi; then
+		default
+	else
+		emake -f Makefile -f - libs \
+			<<<'libs: $(lib_LTLIBRARIES)'
+	fi
+}
+
+multilib_src_test() {
+	multilib_is_native_abi && default
+}
+
+multilib_src_install() {
+	if multilib_is_native_abi; then
+		emake DESTDIR="${D}" install
+
+		# Only install extra-tools when relevant USE flag is enabled
+		if use extra-tools; then
+			ewarn "Upstream doesn't support using this tools and their bugs are"
+			ewarn "likely to be ignored forever, also they can break without"
+			ewarn "previous announcement."
+			ewarn "Upstream also states all this tools are not really needed,"
+			ewarn "then, if you still need to rely on them, you must ask them"
+			ewarn "to either install that tool by default or add the needed"
+			ewarn "functionality to the existing 'official' tools."
+			ewarn "Please report this issues to:"
+			ewarn "http://www.bluez.org/development/lists/"
+
+			# Upstream doesn't install this, bug #524640
+			# http://permalink.gmane.org/gmane.linux.bluez.kernel/53115
+			# http://comments.gmane.org/gmane.linux.bluez.kernel/54564
+			dobin tools/btmgmt
+			# gatttool is only built with readline, bug #530776
+			# https://bugzilla.redhat.com/show_bug.cgi?id=1141909
+			# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=720486
+			# https://bugs.archlinux.org/task/37686
+			dobin attrib/gatttool
+			# https://bugzilla.redhat.com/show_bug.cgi?id=1699680
+			dobin tools/avinfo
+		fi
+
+		# Not installed by default after being built, bug #666756
+		use btpclient && dobin tools/btpclient
+
+		# Unittests are not that useful once installed, so make them optional
+		if use test-programs; then
+			# Drop python2 only test tools
+			# https://bugzilla.kernel.org/show_bug.cgi?id=206819
+			rm "${ED}"/usr/$(get_libdir)/bluez/test/simple-player || die
+			# https://bugzilla.kernel.org/show_bug.cgi?id=206821
+			rm "${ED}"/usr/$(get_libdir)/bluez/test/test-hfp || die
+			# https://bugzilla.kernel.org/show_bug.cgi?id=206823
+			rm "${ED}"/usr/$(get_libdir)/bluez/test/test-sap-server	|| die
+
+			python_fix_shebang "${ED}"/usr/$(get_libdir)/bluez/test
+
+			for i in $(find "${ED}"/usr/$(get_libdir)/bluez/test -maxdepth 1 -type f ! -name "*.*"); do
+				dosym "${i}" /usr/bin/bluez-"${i##*/}"
+			done
+		fi
+	else
+		emake DESTDIR="${D}" \
+			install-pkgincludeHEADERS \
+			install-libLTLIBRARIES \
+			install-pkgconfigDATA
+	fi
+}
+
+multilib_src_install_all() {
+	# We need to ensure obexd can be spawned automatically by systemd
+	# when user-session is enabled:
+	# http://marc.info/?l=linux-bluetooth&m=148096094716386&w=2
+	# https://bugs.gentoo.org/show_bug.cgi?id=577842
+	# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=804908
+	# https://bugs.archlinux.org/task/45816
+	# https://bugzilla.redhat.com/show_bug.cgi?id=1318441
+	# https://bugzilla.redhat.com/show_bug.cgi?id=1389347
+	if use user-session && use systemd; then
+		ln -s "${ED}"/usr/lib/systemd/user/obex.service "${ED}"/usr/lib/systemd/user/dbus-org.bluez.obex.service
+	fi
+
+	find "${D}" -name '*.la' -type f -delete || die
+
+	keepdir /var/lib/bluetooth
+
+	# Upstream don't want people to play with them
+	# But we keep installing them due to 'historical' reasons
+	insinto /etc/bluetooth
+	local d
+	for d in input network; do
+		doins profiles/${d}/${d}.conf
+	done
+	# Setup auto enable as Fedora does for allowing to use
+	# keyboards/mouse as soon as possible
+	sed -i 's/#\[Policy\]$/\[Policy\]/; s/#AutoEnable=false/AutoEnable=true/' src/main.conf || die
+	doins src/main.conf
+
+	newinitd "${FILESDIR}"/bluetooth-init.d-r5 bluetooth
+	newconfd "${FILESDIR}"/bluetooth-conf.d bluetooth
+
+	einstalldocs
+	use doc && dodoc doc/*.txt
+	# 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
+}
+
+pkg_postinst() {
+	use udev && udev_reload
+	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
+}

diff --git a/net-wireless/bluez/files/bluez-5.58-rfkill.patch b/net-wireless/bluez/files/bluez-5.58-rfkill.patch
new file mode 100644
index 00000000000..dd7f2f978e7
--- /dev/null
+++ b/net-wireless/bluez/files/bluez-5.58-rfkill.patch
@@ -0,0 +1,84 @@
+From 382646b490c1c336dd32f9186293616ceb4d808b Mon Sep 17 00:00:00 2001
+From: Benjamin Berg <bberg@redhat.com>
+Date: Mon, 3 May 2021 14:45:00 +0200
+Subject: [PATCH 1/2] rfkill: Fix reading from rfkill socket
+
+The kernel will always send exactly one event, but the size of the
+passed struct will depend on the length of the submitted read() and the
+kernel version. i.e. the interface can be extended and we need to expect
+for a read to be longer than expected if we ask for it.
+
+Fix this by only requesting the needed length and explicitly check the
+length against the V1 version of the structure to make the code a bit
+more future proof in case the internal copy of the struct is updated to
+contain new fields.
+---
+ src/rfkill.c | 24 +++++++++++-------------
+ 1 file changed, 11 insertions(+), 13 deletions(-)
+
+diff --git a/src/rfkill.c b/src/rfkill.c
+index ec9fcdfdd..2099c5ac5 100644
+--- a/src/rfkill.c
++++ b/src/rfkill.c
+@@ -53,12 +53,12 @@ struct rfkill_event {
+ 	uint8_t  soft;
+ 	uint8_t  hard;
+ };
++#define RFKILL_EVENT_SIZE_V1    8
+ 
+ static gboolean rfkill_event(GIOChannel *chan,
+ 				GIOCondition cond, gpointer data)
+ {
+-	unsigned char buf[32];
+-	struct rfkill_event *event = (void *) buf;
++	struct rfkill_event event = { 0 };
+ 	struct btd_adapter *adapter;
+ 	char sysname[PATH_MAX];
+ 	ssize_t len;
+@@ -69,34 +69,32 @@ static gboolean rfkill_event(GIOChannel *chan,
+ 
+ 	fd = g_io_channel_unix_get_fd(chan);
+ 
+-	memset(buf, 0, sizeof(buf));
+-
+-	len = read(fd, buf, sizeof(buf));
++	len = read(fd, &event, sizeof(event));
+ 	if (len < 0) {
+ 		if (errno == EAGAIN)
+ 			return TRUE;
+ 		return FALSE;
+ 	}
+ 
+-	if (len != sizeof(struct rfkill_event))
++	if (len < RFKILL_EVENT_SIZE_V1)
+ 		return TRUE;
+ 
+ 	DBG("RFKILL event idx %u type %u op %u soft %u hard %u",
+-					event->idx, event->type, event->op,
+-						event->soft, event->hard);
++					event.idx, event.type, event.op,
++						event.soft, event.hard);
+ 
+-	if (event->soft || event->hard)
++	if (event.soft || event.hard)
+ 		return TRUE;
+ 
+-	if (event->op != RFKILL_OP_CHANGE)
++	if (event.op != RFKILL_OP_CHANGE)
+ 		return TRUE;
+ 
+-	if (event->type != RFKILL_TYPE_BLUETOOTH &&
+-					event->type != RFKILL_TYPE_ALL)
++	if (event.type != RFKILL_TYPE_BLUETOOTH &&
++					event.type != RFKILL_TYPE_ALL)
+ 		return TRUE;
+ 
+ 	snprintf(sysname, sizeof(sysname) - 1,
+-			"/sys/class/rfkill/rfkill%u/name", event->idx);
++			"/sys/class/rfkill/rfkill%u/name", event.idx);
+ 
+ 	fd = open(sysname, O_RDONLY);
+ 	if (fd < 0)
+-- 
+2.31.1
+


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-wireless/bluez/, net-wireless/bluez/files/
@ 2021-07-08  8:09 Pacho Ramos
  0 siblings, 0 replies; 22+ messages in thread
From: Pacho Ramos @ 2021-07-08  8:09 UTC (permalink / raw
  To: gentoo-commits

commit:     db3448b335b66ad791293cc025596669ae15a683
Author:     Pacho Ramos <pacho <AT> gentoo <DOT> org>
AuthorDate: Thu Jul  8 07:54:57 2021 +0000
Commit:     Pacho Ramos <pacho <AT> gentoo <DOT> org>
CommitDate: Thu Jul  8 07:54:57 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=db3448b3

net-wireless/bluez: Drop old

Package-Manager: Portage-3.0.20, Repoman-3.0.3
Signed-off-by: Pacho Ramos <pacho <AT> gentoo.org>

 net-wireless/bluez/Manifest                        |   1 -
 net-wireless/bluez/bluez-5.59-r1.ebuild            | 292 ---------------------
 .../bluez/files/bluez-5.59-a2dp-parsing.patch      |  38 ---
 3 files changed, 331 deletions(-)

diff --git a/net-wireless/bluez/Manifest b/net-wireless/bluez/Manifest
index cd48d873ea1..1320549d38b 100644
--- a/net-wireless/bluez/Manifest
+++ b/net-wireless/bluez/Manifest
@@ -1,3 +1,2 @@
 DIST bluez-5.58.tar.xz 2060368 BLAKE2B 157780f83181d89fb126face5e9794bc0de8196f43d57d079fc09ae7e45e7ef21bf404e834d844da28d06f9a29cb92f11c310dbbcb7f60e845a335a558d7190c SHA512 159b554e0afd56af5da6f8333383f2fdf96d77a0e82d762bf4b37786e7312b7e61fbbae0f18b26442a606e0a232f48e0f45a4b38b95de36c7daf384f582315a3
-DIST bluez-5.59.tar.xz 2123104 BLAKE2B 59e063ffc0cd810a151f49c2d8b3e1dca46eef038dfe112bfc0524e111e00cfea78557f3d1ccf657882b76158ee9249291f9fc6e6a4cce851e0e6dc43f707398 SHA512 506ce28459a82614e5f6c55235b84e5780a9bfa821904fd40ee2928a503978248368069c57a283db9dd81f48d78f45e00d95a7c52d1538d3f5c858a29424304f
 DIST bluez-5.60.tar.xz 2124312 BLAKE2B 52cd08192cbfb7adc2e11f270442af62307dbf3cb940554f77e1ec4c30036ca1c05970d7d48719d3036173135f2b14123f2d0aad8147f0a919773d211238a11e SHA512 069e054360b4ab72f1daa033572f0fd822fb0f47e52069f4f3dcdfecfa312b9a5366cc04967e639aef39b980c0e1007389f1ee757e7c3bae43a5e66f8ed21a6b

diff --git a/net-wireless/bluez/bluez-5.59-r1.ebuild b/net-wireless/bluez/bluez-5.59-r1.ebuild
deleted file mode 100644
index 898115e910a..00000000000
--- a/net-wireless/bluez/bluez-5.59-r1.ebuild
+++ /dev/null
@@ -1,292 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-PYTHON_COMPAT=( python3_{7..10} )
-
-inherit autotools linux-info python-single-r1 readme.gentoo-r1 systemd udev multilib-minimal
-
-DESCRIPTION="Bluetooth Tools and System Daemons for Linux"
-HOMEPAGE="http://www.bluez.org"
-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 ~x86"
-IUSE="btpclient cups doc debug deprecated extra-tools experimental +mesh midi +obex +readline selinux systemd test test-programs +udev user-session"
-
-# Since this release all remaining extra-tools need readline support, but this could
-# change in the future, hence, this REQUIRED_USE constraint could be dropped
-# again in the future.
-REQUIRED_USE="
-	extra-tools? ( deprecated readline )
-	test? ( ${PYTHON_REQUIRED_USE} )
-	test-programs? ( ${PYTHON_REQUIRED_USE} )
-"
-
-TEST_DEPS="${PYTHON_DEPS}
-	$(python_gen_cond_dep '
-		>=dev-python/dbus-python-1[${PYTHON_MULTI_USEDEP}]
-		dev-python/pygobject:3[${PYTHON_MULTI_USEDEP}]
-	')
-"
-BDEPEND="
-	dev-python/docutils
-	virtual/pkgconfig
-	test? ( ${TEST_DEPS} )
-"
-DEPEND="
-	>=dev-libs/glib-2.28:2[${MULTILIB_USEDEP}]
-	>=sys-apps/hwids-20121202.2
-	btpclient? ( >=dev-libs/ell-0.39 )
-	cups? ( net-print/cups:= )
-	mesh? (
-		>=dev-libs/ell-0.39
-		>=dev-libs/json-c-0.13:=
-		sys-libs/readline:0=
-	)
-	midi? ( media-libs/alsa-lib )
-	obex? ( dev-libs/libical:= )
-	readline? ( sys-libs/readline:0= )
-	systemd? (
-		>=sys-apps/dbus-1.6:=[user-session=]
-		sys-apps/systemd
-	)
-	!systemd? ( >=sys-apps/dbus-1.6:= )
-	udev? ( >=virtual/udev-172 )
-"
-RDEPEND="${DEPEND}
-	selinux? ( sec-policy/selinux-bluetooth )
-	test-programs? ( ${TEST_DEPS} )
-"
-
-RESTRICT="!test? ( test )"
-
-PATCHES=(
-	# avdtp: Fix parsing capabilities (from 'master')
-	"${FILESDIR}"/${P}-a2dp-parsing.patch
-
-	# Try both udevadm paths to cover udev/systemd vs. eudev locations (#539844)
-	# http://www.spinics.net/lists/linux-bluetooth/msg58739.html
-	# https://bugs.gentoo.org/539844
-	"${FILESDIR}"/${PN}-udevadm-path-r1.patch
-
-	# Fedora patches
-	# http://www.spinics.net/lists/linux-bluetooth/msg40136.html
-	"${FILESDIR}"/0001-obex-Use-GLib-helper-function-to-manipulate-paths.patch
-)
-
-pkg_setup() {
-	# From http://www.linuxfromscratch.org/blfs/view/svn/general/bluez.html
-	# to prevent bugs like:
-	# https://bugzilla.kernel.org/show_bug.cgi?id=196621
-	CONFIG_CHECK="~NET ~BT ~BT_RFCOMM ~BT_RFCOMM_TTY ~BT_BNEP ~BT_BNEP_MC_FILTER
-		~BT_BNEP_PROTO_FILTER ~BT_HIDP ~CRYPTO_USER_API_HASH ~CRYPTO_USER_API_SKCIPHER ~RFKILL"
-	# https://bugzilla.kernel.org/show_bug.cgi?id=196621
-	# https://bugzilla.kernel.org/show_bug.cgi?id=206815
-	if use mesh || use test; then
-		CONFIG_CHECK="${CONFIG_CHECK} ~CRYPTO_USER
-		~CRYPTO_USER_API ~CRYPTO_USER_API_AEAD ~CRYPTO_AES ~CRYPTO_CCM ~CRYPTO_AEAD ~CRYPTO_CMAC"
-	fi
-	linux-info_pkg_setup
-
-	if use test || use test-programs; then
-		python-single-r1_pkg_setup
-	fi
-
-	if ! use udev; then
-		ewarn
-		ewarn "You are installing ${PN} with USE=-udev. This means various bluetooth"
-		ewarn "devices and adapters from Apple, Dell, Logitech etc. will not work,"
-		ewarn "and hid2hci will not be available."
-		ewarn
-	fi
-}
-
-src_prepare() {
-	default
-
-	# http://www.spinics.net/lists/linux-bluetooth/msg38490.html
-	if ! use user-session || ! use systemd; then
-		eapply "${FILESDIR}"/0001-Allow-using-obexd-without-systemd-in-the-user-session-r2.patch
-	fi
-
-	eautoreconf
-
-	if use cups; then
-		# Only not .am to not need to run eautoreconf only because of this
-		sed -i \
-			-e "s:cupsdir = \$(libdir)/cups:cupsdir = $(cups-config --serverbin):" \
-			Makefile.{in,tools} || die
-	fi
-
-	multilib_copy_sources
-}
-
-multilib_src_configure() {
-	local myconf=(
-		# readline is automagic when client is enabled
-		# --enable-client always needs readline, bug #504038
-		# --enable-mesh is handled in the same way
-		ac_cv_header_readline_readline_h=$(multilib_native_usex readline)
-		ac_cv_header_readline_readline_h=$(multilib_native_usex mesh)
-	)
-
-	if ! multilib_is_native_abi; then
-		myconf+=(
-			# deps not used for the library
-			{DBUS,GLIB}_{CFLAGS,LIBS}=' '
-		)
-	fi
-
-	econf \
-		--localstatedir=/var \
-		--disable-android \
-		--enable-datafiles \
-		--enable-optimization \
-		$(use_enable debug) \
-		--enable-pie \
-		--enable-threads \
-		--enable-library \
-		--enable-tools \
-		--enable-manpages \
-		--enable-monitor \
-		--with-systemdsystemunitdir="$(systemd_get_systemunitdir)" \
-		--with-systemduserunitdir="$(systemd_get_userunitdir)" \
-		$(multilib_native_use_enable btpclient) \
-		$(multilib_native_use_enable btpclient external-ell) \
-		$(multilib_native_use_enable cups) \
-		$(multilib_native_use_enable deprecated) \
-		$(multilib_native_use_enable experimental) \
-		$(multilib_native_use_enable mesh) \
-		$(multilib_native_use_enable mesh external-ell) \
-		$(multilib_native_use_enable midi) \
-		$(multilib_native_use_enable obex) \
-		$(multilib_native_use_enable readline client) \
-		$(multilib_native_use_enable systemd) \
-		$(multilib_native_use_enable test-programs test) \
-		$(multilib_native_use_enable udev) \
-		$(multilib_native_use_enable udev hid2hci) \
-		$(multilib_native_use_enable udev sixaxis)
-}
-
-multilib_src_compile() {
-	if multilib_is_native_abi; then
-		default
-	else
-		emake -f Makefile -f - libs \
-			<<<'libs: $(lib_LTLIBRARIES)'
-	fi
-}
-
-multilib_src_test() {
-	multilib_is_native_abi && default
-}
-
-multilib_src_install() {
-	if multilib_is_native_abi; then
-		emake DESTDIR="${D}" install
-
-		# Only install extra-tools when relevant USE flag is enabled
-		if use extra-tools; then
-			ewarn "Upstream doesn't support using this tools and their bugs are"
-			ewarn "likely to be ignored forever, also they can break without"
-			ewarn "previous announcement."
-			ewarn "Upstream also states all this tools are not really needed,"
-			ewarn "then, if you still need to rely on them, you must ask them"
-			ewarn "to either install that tool by default or add the needed"
-			ewarn "functionality to the existing 'official' tools."
-			ewarn "Please report this issues to:"
-			ewarn "http://www.bluez.org/development/lists/"
-
-			# Upstream doesn't install this, bug #524640
-			# http://permalink.gmane.org/gmane.linux.bluez.kernel/53115
-			# http://comments.gmane.org/gmane.linux.bluez.kernel/54564
-			dobin tools/btmgmt
-			# gatttool is only built with readline, bug #530776
-			# https://bugzilla.redhat.com/show_bug.cgi?id=1141909
-			# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=720486
-			# https://bugs.archlinux.org/task/37686
-			dobin attrib/gatttool
-			# https://bugzilla.redhat.com/show_bug.cgi?id=1699680
-			dobin tools/avinfo
-		fi
-
-		# Not installed by default after being built, bug #666756
-		use btpclient && dobin tools/btpclient
-
-		# Unittests are not that useful once installed, so make them optional
-		if use test-programs; then
-			# Drop python2 only test tools
-			# https://bugzilla.kernel.org/show_bug.cgi?id=206819
-			rm "${ED}"/usr/$(get_libdir)/bluez/test/simple-player || die
-			# https://bugzilla.kernel.org/show_bug.cgi?id=206821
-			rm "${ED}"/usr/$(get_libdir)/bluez/test/test-hfp || die
-			# https://bugzilla.kernel.org/show_bug.cgi?id=206823
-			rm "${ED}"/usr/$(get_libdir)/bluez/test/test-sap-server	|| die
-
-			python_fix_shebang "${ED}"/usr/$(get_libdir)/bluez/test
-
-			for i in $(find "${ED}"/usr/$(get_libdir)/bluez/test -maxdepth 1 -type f ! -name "*.*"); do
-				dosym "${i}" /usr/bin/bluez-"${i##*/}"
-			done
-		fi
-	else
-		emake DESTDIR="${D}" \
-			install-pkgincludeHEADERS \
-			install-libLTLIBRARIES \
-			install-pkgconfigDATA
-	fi
-}
-
-multilib_src_install_all() {
-	# We need to ensure obexd can be spawned automatically by systemd
-	# when user-session is enabled:
-	# http://marc.info/?l=linux-bluetooth&m=148096094716386&w=2
-	# https://bugs.gentoo.org/show_bug.cgi?id=577842
-	# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=804908
-	# https://bugs.archlinux.org/task/45816
-	# https://bugzilla.redhat.com/show_bug.cgi?id=1318441
-	# https://bugzilla.redhat.com/show_bug.cgi?id=1389347
-	if use user-session && use systemd; then
-		ln -s "${ED}"/usr/lib/systemd/user/obex.service "${ED}"/usr/lib/systemd/user/dbus-org.bluez.obex.service
-	fi
-
-	find "${D}" -name '*.la' -type f -delete || die
-
-	keepdir /var/lib/bluetooth
-
-	# Upstream don't want people to play with them
-	# But we keep installing them due to 'historical' reasons
-	insinto /etc/bluetooth
-	local d
-	for d in input network; do
-		doins profiles/${d}/${d}.conf
-	done
-	# Setup auto enable as Fedora does for allowing to use
-	# keyboards/mouse as soon as possible
-	sed -i 's/#\[Policy\]$/\[Policy\]/; s/#AutoEnable=false/AutoEnable=true/' src/main.conf || die
-	doins src/main.conf
-
-	newinitd "${FILESDIR}"/bluetooth-init.d-r5 bluetooth
-	newconfd "${FILESDIR}"/bluetooth-conf.d bluetooth
-
-	einstalldocs
-	use doc && dodoc doc/*.txt
-	# 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
-}
-
-pkg_postinst() {
-	use udev && udev_reload
-	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
-}

diff --git a/net-wireless/bluez/files/bluez-5.59-a2dp-parsing.patch b/net-wireless/bluez/files/bluez-5.59-a2dp-parsing.patch
deleted file mode 100644
index 40569ec9805..00000000000
--- a/net-wireless/bluez/files/bluez-5.59-a2dp-parsing.patch
+++ /dev/null
@@ -1,38 +0,0 @@
-From 0388794dc5fdb73a4ea88bcf148de0a12b4364d4 Mon Sep 17 00:00:00 2001
-From: Archie Pusaka <apusaka@chromium.org>
-Date: Thu, 17 Jun 2021 08:53:34 +0800
-Subject: avdtp: Fix parsing capabilities
-
-This patch fixes size comparison and variable misassignment.
-
-Reviewed-by: Alain Michaud <alainm@chromium.org>
-Reviewed-by: Michael Sun <michaelfsun@google.com>
----
- profiles/audio/avdtp.c | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/profiles/audio/avdtp.c b/profiles/audio/avdtp.c
-index c7bf99f42..5d13104c1 100644
---- a/profiles/audio/avdtp.c
-+++ b/profiles/audio/avdtp.c
-@@ -1323,7 +1323,7 @@ static GSList *caps_to_list(uint8_t *data, size_t size,
- 
- 		cap = (struct avdtp_service_capability *)data;
- 
--		if (sizeof(*cap) + cap->length >= size) {
-+		if (sizeof(*cap) + cap->length > size) {
- 			error("Invalid capability data in getcap resp");
- 			break;
- 		}
-@@ -1345,7 +1345,7 @@ static GSList *caps_to_list(uint8_t *data, size_t size,
- 		switch (cap->category) {
- 		case AVDTP_MEDIA_CODEC:
- 			if (codec)
--				*codec = cap;
-+				*codec = cpy;
- 			break;
- 		case AVDTP_DELAY_REPORTING:
- 			if (delay_reporting)
--- 
-cgit 1.2.3-1.el7
-


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-wireless/bluez/, net-wireless/bluez/files/
@ 2021-12-02 13:31 Pacho Ramos
  0 siblings, 0 replies; 22+ messages in thread
From: Pacho Ramos @ 2021-12-02 13:31 UTC (permalink / raw
  To: gentoo-commits

commit:     c56c92516c1f7faa80cf76c5df2938edf50b538f
Author:     Pacho Ramos <pacho <AT> gentoo <DOT> org>
AuthorDate: Thu Dec  2 13:31:03 2021 +0000
Commit:     Pacho Ramos <pacho <AT> gentoo <DOT> org>
CommitDate: Thu Dec  2 13:31:03 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c56c9251

net-wireless/bluez: Important bugfixes

This solves disconnecting due to GattCharacteristic1.MTU and reverts a
commit introducing a regression when connecting some mouse models

Bug: https://bugs.gentoo.org/827706
Bug: https://bugs.gentoo.org/827911
Package-Manager: Portage-3.0.28, Repoman-3.0.3
Signed-off-by: Pacho Ramos <pacho <AT> gentoo.org>

 net-wireless/bluez/bluez-5.62-r3.ebuild            | 294 +++++++++++++++++++++
 ...1-Revert-attrib-Make-use-of-bt_att_resend.patch | 188 +++++++++++++
 .../bluez/files/bluez-5.62-fix-disconnecting.patch |  54 ++++
 3 files changed, 536 insertions(+)

diff --git a/net-wireless/bluez/bluez-5.62-r3.ebuild b/net-wireless/bluez/bluez-5.62-r3.ebuild
new file mode 100644
index 000000000000..0068b5bad6aa
--- /dev/null
+++ b/net-wireless/bluez/bluez-5.62-r3.ebuild
@@ -0,0 +1,294 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+PYTHON_COMPAT=( python3_{8..10} )
+
+inherit autotools linux-info python-single-r1 readme.gentoo-r1 systemd udev multilib-minimal
+
+DESCRIPTION="Bluetooth Tools and System Daemons for Linux"
+HOMEPAGE="http://www.bluez.org"
+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"
+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
+# change in the future, hence, this REQUIRED_USE constraint could be dropped
+# again in the future.
+REQUIRED_USE="
+	extra-tools? ( deprecated readline )
+	test? ( ${PYTHON_REQUIRED_USE} )
+	test-programs? ( ${PYTHON_REQUIRED_USE} )
+"
+
+TEST_DEPS="${PYTHON_DEPS}
+	$(python_gen_cond_dep '
+		>=dev-python/dbus-python-1[${PYTHON_USEDEP}]
+		dev-python/pygobject:3[${PYTHON_USEDEP}]
+	')
+"
+BDEPEND="
+	dev-python/docutils
+	virtual/pkgconfig
+	test? ( ${TEST_DEPS} )
+"
+DEPEND="
+	>=dev-libs/glib-2.28:2[${MULTILIB_USEDEP}]
+	btpclient? ( >=dev-libs/ell-0.39 )
+	cups? ( net-print/cups:= )
+	mesh? (
+		>=dev-libs/ell-0.39
+		>=dev-libs/json-c-0.13:=
+		sys-libs/readline:0=
+	)
+	midi? ( media-libs/alsa-lib )
+	obex? ( dev-libs/libical:= )
+	readline? ( sys-libs/readline:0= )
+	systemd? ( sys-apps/systemd )
+	>=sys-apps/dbus-1.6:=
+	udev? ( >=virtual/udev-172 )
+"
+RDEPEND="${DEPEND}
+	selinux? ( sec-policy/selinux-bluetooth )
+	test-programs? ( ${TEST_DEPS} )
+"
+
+RESTRICT="!test? ( test )"
+
+PATCHES=(
+	# Try both udevadm paths to cover udev/systemd vs. eudev locations (#539844)
+	# http://www.spinics.net/lists/linux-bluetooth/msg58739.html
+	# https://bugs.gentoo.org/539844
+	"${FILESDIR}"/${PN}-udevadm-path-r1.patch
+
+	# Fedora patches
+	# http://www.spinics.net/lists/linux-bluetooth/msg40136.html
+	"${FILESDIR}"/0001-obex-Use-GLib-helper-function-to-manipulate-paths.patch
+
+	# This reverts commit ac2c2e10b3adb432a572b618c6f53cabb6b3c80b. It
+	# causes problems with Logitech MX wireless input devices (see
+	# https://github.com/bluez/bluez/issues/220 )
+	"${FILESDIR}"/0001-Revert-attrib-Make-use-of-bt_att_resend.patch
+
+	# gatt-client: Fix disconnecting due to GattCharacteristic1.MTU
+	# (from 'master')
+	"${FILESDIR}"/${P}-fix-disconnecting.patch
+)
+
+pkg_setup() {
+	# From http://www.linuxfromscratch.org/blfs/view/svn/general/bluez.html
+	# to prevent bugs like:
+	# https://bugzilla.kernel.org/show_bug.cgi?id=196621
+	CONFIG_CHECK="~NET ~BT ~BT_RFCOMM ~BT_RFCOMM_TTY ~BT_BNEP ~BT_BNEP_MC_FILTER
+		~BT_BNEP_PROTO_FILTER ~BT_HIDP ~CRYPTO_USER_API_HASH ~CRYPTO_USER_API_SKCIPHER ~RFKILL"
+	# https://bugzilla.kernel.org/show_bug.cgi?id=196621
+	# https://bugzilla.kernel.org/show_bug.cgi?id=206815
+	if use mesh || use test; then
+		CONFIG_CHECK="${CONFIG_CHECK} ~CRYPTO_USER
+		~CRYPTO_USER_API ~CRYPTO_USER_API_AEAD ~CRYPTO_AES ~CRYPTO_CCM ~CRYPTO_AEAD ~CRYPTO_CMAC"
+	fi
+	linux-info_pkg_setup
+
+	if use test || use test-programs; then
+		python-single-r1_pkg_setup
+	fi
+
+	if ! use udev; then
+		ewarn
+		ewarn "You are installing ${PN} with USE=-udev. This means various bluetooth"
+		ewarn "devices and adapters from Apple, Dell, Logitech etc. will not work,"
+		ewarn "and hid2hci will not be available."
+		ewarn
+	fi
+}
+
+src_prepare() {
+	default
+
+	# http://www.spinics.net/lists/linux-bluetooth/msg38490.html
+	if ! use systemd; then
+		eapply "${FILESDIR}"/0001-Allow-using-obexd-without-systemd-in-the-user-session-r2.patch
+	fi
+
+	eautoreconf
+
+	if use cups; then
+		# Only not .am to not need to run eautoreconf only because of this
+		sed -i \
+			-e "s:cupsdir = \$(libdir)/cups:cupsdir = $(cups-config --serverbin):" \
+			Makefile.{in,tools} || die
+	fi
+
+	multilib_copy_sources
+}
+
+multilib_src_configure() {
+	local myconf=(
+		# readline is automagic when client is enabled
+		# --enable-client always needs readline, bug #504038
+		# --enable-mesh is handled in the same way
+		ac_cv_header_readline_readline_h=$(multilib_native_usex readline)
+		ac_cv_header_readline_readline_h=$(multilib_native_usex mesh)
+	)
+
+	if ! multilib_is_native_abi; then
+		myconf+=(
+			# deps not used for the library
+			{DBUS,GLIB}_{CFLAGS,LIBS}=' '
+		)
+	fi
+
+	econf \
+		--localstatedir=/var \
+		--disable-android \
+		--enable-datafiles \
+		--enable-optimization \
+		$(use_enable debug) \
+		--enable-pie \
+		--enable-threads \
+		--enable-library \
+		--enable-tools \
+		--enable-manpages \
+		--enable-monitor \
+		--with-systemdsystemunitdir="$(systemd_get_systemunitdir)" \
+		--with-systemduserunitdir="$(systemd_get_userunitdir)" \
+		$(multilib_native_use_enable btpclient) \
+		$(multilib_native_use_enable btpclient external-ell) \
+		$(multilib_native_use_enable cups) \
+		$(multilib_native_use_enable deprecated) \
+		$(multilib_native_use_enable experimental) \
+		$(multilib_native_use_enable mesh) \
+		$(multilib_native_use_enable mesh external-ell) \
+		$(multilib_native_use_enable midi) \
+		$(multilib_native_use_enable obex) \
+		$(multilib_native_use_enable readline client) \
+		$(multilib_native_use_enable systemd) \
+		$(multilib_native_use_enable test-programs test) \
+		$(multilib_native_use_enable udev) \
+		$(multilib_native_use_enable udev hid2hci) \
+		$(multilib_native_use_enable udev sixaxis)
+}
+
+multilib_src_compile() {
+	if multilib_is_native_abi; then
+		default
+	else
+		emake -f Makefile -f - libs \
+			<<<'libs: $(lib_LTLIBRARIES)'
+	fi
+}
+
+multilib_src_test() {
+	multilib_is_native_abi && default
+}
+
+multilib_src_install() {
+	if multilib_is_native_abi; then
+		emake DESTDIR="${D}" install
+
+		# Only install extra-tools when relevant USE flag is enabled
+		if use extra-tools; then
+			ewarn "Upstream doesn't support using this tools and their bugs are"
+			ewarn "likely to be ignored forever, also they can break without"
+			ewarn "previous announcement."
+			ewarn "Upstream also states all this tools are not really needed,"
+			ewarn "then, if you still need to rely on them, you must ask them"
+			ewarn "to either install that tool by default or add the needed"
+			ewarn "functionality to the existing 'official' tools."
+			ewarn "Please report this issues to:"
+			ewarn "http://www.bluez.org/development/lists/"
+
+			# Upstream doesn't install this, bug #524640
+			# http://permalink.gmane.org/gmane.linux.bluez.kernel/53115
+			# http://comments.gmane.org/gmane.linux.bluez.kernel/54564
+			dobin tools/btmgmt
+			# gatttool is only built with readline, bug #530776
+			# https://bugzilla.redhat.com/show_bug.cgi?id=1141909
+			# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=720486
+			# https://bugs.archlinux.org/task/37686
+			dobin attrib/gatttool
+			# https://bugzilla.redhat.com/show_bug.cgi?id=1699680
+			dobin tools/avinfo
+		fi
+
+		# Not installed by default after being built, bug #666756
+		use btpclient && dobin tools/btpclient
+
+		# Unittests are not that useful once installed, so make them optional
+		if use test-programs; then
+			# Drop python2 only test tools
+			# https://bugzilla.kernel.org/show_bug.cgi?id=206819
+			rm "${ED}"/usr/$(get_libdir)/bluez/test/simple-player || die
+			# https://bugzilla.kernel.org/show_bug.cgi?id=206821
+			rm "${ED}"/usr/$(get_libdir)/bluez/test/test-hfp || die
+			# https://bugzilla.kernel.org/show_bug.cgi?id=206823
+			rm "${ED}"/usr/$(get_libdir)/bluez/test/test-sap-server	|| die
+
+			python_fix_shebang "${ED}"/usr/$(get_libdir)/bluez/test
+
+			for i in $(find "${ED}"/usr/$(get_libdir)/bluez/test -maxdepth 1 -type f ! -name "*.*"); do
+				dosym "${i}" /usr/bin/bluez-"${i##*/}"
+			done
+		fi
+	else
+		emake DESTDIR="${D}" \
+			install-pkgincludeHEADERS \
+			install-libLTLIBRARIES \
+			install-pkgconfigDATA
+	fi
+}
+
+multilib_src_install_all() {
+	# We need to ensure obexd can be spawned automatically by systemd
+	# when user-session is enabled:
+	# http://marc.info/?l=linux-bluetooth&m=148096094716386&w=2
+	# https://bugs.gentoo.org/show_bug.cgi?id=577842
+	# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=804908
+	# https://bugs.archlinux.org/task/45816
+	# https://bugzilla.redhat.com/show_bug.cgi?id=1318441
+	# https://bugzilla.redhat.com/show_bug.cgi?id=1389347
+	if use systemd; then
+		dosym obex.service /usr/lib/systemd/user/dbus-org.bluez.obex.service
+	fi
+
+	find "${D}" -name '*.la' -type f -delete || die
+
+	keepdir /var/lib/bluetooth
+
+	# Upstream don't want people to play with them
+	# But we keep installing them due to 'historical' reasons
+	insinto /etc/bluetooth
+	local d
+	for d in input network; do
+		doins profiles/${d}/${d}.conf
+	done
+	# Setup auto enable as Fedora does for allowing to use
+	# keyboards/mouse as soon as possible
+	sed -i 's/#\[Policy\]$/\[Policy\]/; s/#AutoEnable=false/AutoEnable=true/' src/main.conf || die
+	doins src/main.conf
+
+	newinitd "${FILESDIR}"/bluetooth-init.d-r5 bluetooth
+	newconfd "${FILESDIR}"/bluetooth-conf.d bluetooth
+
+	einstalldocs
+	use doc && dodoc doc/*.txt
+	# 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
+}
+
+pkg_postinst() {
+	use udev && udev_reload
+	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
+}

diff --git a/net-wireless/bluez/files/0001-Revert-attrib-Make-use-of-bt_att_resend.patch b/net-wireless/bluez/files/0001-Revert-attrib-Make-use-of-bt_att_resend.patch
new file mode 100644
index 000000000000..a8475b0c4273
--- /dev/null
+++ b/net-wireless/bluez/files/0001-Revert-attrib-Make-use-of-bt_att_resend.patch
@@ -0,0 +1,188 @@
+From 697866e210e4e2dce14c95f7a7243e9b9128d01f Mon Sep 17 00:00:00 2001
+From: Adam Williamson <awilliam@redhat.com>
+Date: Sun, 7 Nov 2021 15:10:53 -0800
+Subject: [PATCH] Revert "attrib: Make use of bt_att_resend"
+
+This reverts commit ac2c2e10b3adb432a572b618c6f53cabb6b3c80b. It
+causes problems with Logitech MX wireless input devices (see
+https://github.com/bluez/bluez/issues/220 and
+https://bugzilla.redhat.com/show_bug.cgi?id=2019970 ).
+---
+ attrib/gattrib.c | 95 +++++++++++++++++++++++++++++++++++++-----------
+ 1 file changed, 73 insertions(+), 22 deletions(-)
+
+diff --git a/attrib/gattrib.c b/attrib/gattrib.c
+index 270a37ebe..bc7d4f22c 100644
+--- a/attrib/gattrib.c
++++ b/attrib/gattrib.c
+@@ -41,8 +41,13 @@ struct _GAttrib {
+ 	struct queue *track_ids;
+ };
+ 
++struct id_pair {
++	unsigned int org_id;
++	unsigned int pend_id;
++};
++
+ struct attrib_callbacks {
+-	unsigned int id;
++	struct id_pair *id;
+ 	GAttribResultFunc result_func;
+ 	GAttribNotifyFunc notify_func;
+ 	GDestroyNotify destroy_func;
+@@ -51,6 +56,32 @@ struct attrib_callbacks {
+ 	uint16_t notify_handle;
+ };
+ 
++static bool find_with_org_id(const void *data, const void *user_data)
++{
++	const struct id_pair *p = data;
++	unsigned int orig_id = PTR_TO_UINT(user_data);
++
++	return (p->org_id == orig_id);
++}
++
++static struct id_pair *store_id(GAttrib *attrib, unsigned int org_id,
++							unsigned int pend_id)
++{
++	struct id_pair *t;
++
++	t = new0(struct id_pair, 1);
++	if (!t)
++		return NULL;
++
++	t->org_id = org_id;
++	t->pend_id = pend_id;
++
++	if (queue_push_tail(attrib->track_ids, t))
++		return t;
++
++	return NULL;
++}
++
+ GAttrib *g_attrib_new(GIOChannel *io, guint16 mtu, bool ext_signed)
+ {
+ 	gint fd;
+@@ -119,6 +150,9 @@ static void attrib_callbacks_destroy(void *data)
+ 	if (cb->destroy_func)
+ 		cb->destroy_func(cb->user_data);
+ 
++	if (queue_remove(cb->parent->track_ids, cb->id))
++		free(cb->id);
++
+ 	free(data);
+ }
+ 
+@@ -148,7 +182,7 @@ void g_attrib_unref(GAttrib *attrib)
+ 	bt_att_unref(attrib->att);
+ 
+ 	queue_destroy(attrib->callbacks, attrib_callbacks_destroy);
+-	queue_destroy(attrib->track_ids, NULL);
++	queue_destroy(attrib->track_ids, free);
+ 
+ 	free(attrib->buf);
+ 
+@@ -261,6 +295,7 @@ guint g_attrib_send(GAttrib *attrib, guint id, const guint8 *pdu, guint16 len,
+ 	struct attrib_callbacks *cb = NULL;
+ 	bt_att_response_func_t response_cb = NULL;
+ 	bt_att_destroy_func_t destroy_cb = NULL;
++	unsigned int pend_id;
+ 
+ 	if (!attrib)
+ 		return 0;
+@@ -282,47 +317,62 @@ guint g_attrib_send(GAttrib *attrib, guint id, const guint8 *pdu, guint16 len,
+ 
+ 	}
+ 
+-	if (id == 0)
+-		id = bt_att_send(attrib->att, pdu[0], (void *) pdu + 1,
+-					len - 1, response_cb, cb, destroy_cb);
+-	else {
+-		int err;
+-
+-		err = bt_att_resend(attrib->att, id, pdu[0], (void *) pdu + 1,
+-					len - 1, response_cb, cb, destroy_cb);
+-		if (err)
+-			return 0;
+-	}
++	pend_id = bt_att_send(attrib->att, pdu[0], (void *) pdu + 1, len - 1,
++						response_cb, cb, destroy_cb);
+ 
+-	if (!id)
+-		return id;
++	/*
++	 * We store here pair as it is easier to handle it in response and in
++	 * case where user request us to use specific id request - see below.
++	 */
++	if (id == 0)
++		id = pend_id;
+ 
+ 	/*
+ 	 * If user what us to use given id, lets keep track on that so we give
+ 	 * user a possibility to cancel ongoing request.
+ 	 */
+-	if (cb) {
+-		cb->id = id;
+-		queue_push_tail(attrib->track_ids, UINT_TO_PTR(id));
+-	}
++	if (cb)
++		cb->id = store_id(attrib, id, pend_id);
+ 
+ 	return id;
+ }
+ 
+ gboolean g_attrib_cancel(GAttrib *attrib, guint id)
+ {
++	struct id_pair *p;
++
+ 	if (!attrib)
+ 		return FALSE;
+ 
++	/*
++	 * If request belongs to gattrib and is not yet done it has to be on
++	 * the tracking id queue
++	 *
++	 * FIXME: It can happen that on the queue there is id_pair with
++	 * given id which was provided by the user. In the same time it might
++	 * happen that other attrib user got dynamic allocated req_id with same
++	 * value as the one provided by the other user.
++	 * In such case there are two clients having same request id and in
++	 * this point of time we don't know which one calls cancel. For
++	 * now we cancel request in which id was specified by the user.
++	 */
++	p = queue_remove_if(attrib->track_ids, find_with_org_id,
++							UINT_TO_PTR(id));
++	if (!p)
++		return FALSE;
++
++	id = p->pend_id;
++	free(p);
++
+ 	return bt_att_cancel(attrib->att, id);
+ }
+ 
+ static void cancel_request(void *data, void *user_data)
+ {
+-	unsigned int id = PTR_TO_UINT(data);
++	struct id_pair *p = data;
+ 	GAttrib *attrib = user_data;
+ 
+-	bt_att_cancel(attrib->att, id);
++	bt_att_cancel(attrib->att, p->pend_id);
+ }
+ 
+ gboolean g_attrib_cancel_all(GAttrib *attrib)
+@@ -330,8 +380,9 @@ gboolean g_attrib_cancel_all(GAttrib *attrib)
+ 	if (!attrib)
+ 		return FALSE;
+ 
++	/* Cancel only request which belongs to gattrib */
+ 	queue_foreach(attrib->track_ids, cancel_request, attrib);
+-	queue_remove_all(attrib->track_ids, NULL, NULL, NULL);
++	queue_remove_all(attrib->track_ids, NULL, NULL, free);
+ 
+ 	return TRUE;
+ }
+-- 
+2.33.1
+

diff --git a/net-wireless/bluez/files/bluez-5.62-fix-disconnecting.patch b/net-wireless/bluez/files/bluez-5.62-fix-disconnecting.patch
new file mode 100644
index 000000000000..8eff9dc006dd
--- /dev/null
+++ b/net-wireless/bluez/files/bluez-5.62-fix-disconnecting.patch
@@ -0,0 +1,54 @@
+From ebf2d7935690c00c7fd12768177e2023fc63c9fe Mon Sep 17 00:00:00 2001
+From: Javier de San Pedro <dev.git@javispedro.com>
+Date: Sat, 27 Nov 2021 23:21:36 +0100
+Subject: gatt-client: Fix disconnecting due to GattCharacteristic1.MTU
+
+After the MTU dbus property patches in 5.62 we are seeing bluetoothd
+terminate frequently with "Disconnected from D-Bus. Exiting." msgs.
+Apparently this is because bluetoothd sent an invalid reply to a D-Bus
+Property Get (for GattCharacteristic1's MTU).
+Multiple issues in bluez Github.com project reported similar behavior;
+at least #235 (see Fixes:), #219, and likely #238.
+
+When the Characteristic1 object is still cached/alive, but the
+underlying att connection is not (e.g. someone just called Disconnect),
+the property getter (characteristic_get_mtu) right now returns false.
+However, gdbus seems to ignore the return value and sends the empty reply
+message anyway (rather than a dbus error?), and this seems to cause
+the dbus connection to be terminated (due to the ill-formed reply?).
+bluetoothd then aborts.
+
+This patch makes the property value BT_ATT_DEFAULT_LE_MTU if the
+underlying att object does not exist, rather than returning an invalid
+message. This is consistent with the existing PropertyChanged signal
+behavior (we will emit a PropertyChange only if a larger MTU is
+exchanged), and fixes the issue on my machines.
+An alternative could be to change gdbus behavior, but I'm not sure if we
+are allowed to return an error here anyway without causing problems in
+other dbus libraries/wrappers.
+
+Fixes: aaa0c4996ae9 ("gatt: Add implementation of GattCharacteristic1.MTU")
+Fixes: https://github.com/bluez/bluez/issues/235
+---
+ src/gatt-client.c | 5 +----
+ 1 file changed, 1 insertion(+), 4 deletions(-)
+
+diff --git a/src/gatt-client.c b/src/gatt-client.c
+index de18bea97..6ee984db9 100644
+--- a/src/gatt-client.c
++++ b/src/gatt-client.c
+@@ -883,10 +883,7 @@ static gboolean characteristic_get_mtu(const GDBusPropertyTable *property,
+ 	uint16_t mtu;
+ 
+ 	att = bt_gatt_client_get_att(gatt);
+-	if (!att)
+-		return FALSE;
+-
+-	mtu = bt_att_get_mtu(att);
++	mtu = att ? bt_att_get_mtu(att) : BT_ATT_DEFAULT_LE_MTU;
+ 
+ 	dbus_message_iter_append_basic(iter, DBUS_TYPE_UINT16, &mtu);
+ 
+-- 
+cgit 1.2.3-1.el7
+


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-wireless/bluez/, net-wireless/bluez/files/
@ 2022-01-09 19:52 Pacho Ramos
  0 siblings, 0 replies; 22+ messages in thread
From: Pacho Ramos @ 2022-01-09 19:52 UTC (permalink / raw
  To: gentoo-commits

commit:     e1880ed05a890b2029d038e33eac7f021de787f6
Author:     Pacho Ramos <pacho <AT> gentoo <DOT> org>
AuthorDate: Sun Jan  9 19:52:32 2022 +0000
Commit:     Pacho Ramos <pacho <AT> gentoo <DOT> org>
CommitDate: Sun Jan  9 19:52:32 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e1880ed0

net-wireless/bluez: Bump to 5.63

Also try a less invasive fix for bug #827706. Skip for now test-hog as it
fails (#829091) with all the fixes for previous bug.

More kernel config options are needed to run the tests.

Also fix building with musl

Closes: https://bugs.gentoo.org/829091
Thanks-to: Paolo Pedroni
Bug: https://bugs.gentoo.org/827706
Thanks-to: Florian Schmaus
Closes: https://bugs.gentoo.org/812797
Thanks-to: Jory A. Pratt
Closes: https://bugs.gentoo.org/827825
Thanks-to: Agostino Sarubbo
Package-Manager: Portage-3.0.30, Repoman-3.0.3
Signed-off-by: Pacho Ramos <pacho <AT> gentoo.org>

 net-wireless/bluez/Manifest                        |   1 +
 net-wireless/bluez/bluez-5.63.ebuild               | 302 +++++++++++++++++++++
 .../bluez/files/bluez-5.63-musl-limits.patch       |  24 ++
 .../files/bluez-5.63-use-queue_push_tail.patch     |  27 ++
 4 files changed, 354 insertions(+)

diff --git a/net-wireless/bluez/Manifest b/net-wireless/bluez/Manifest
index ff487814a867..089cee551e37 100644
--- a/net-wireless/bluez/Manifest
+++ b/net-wireless/bluez/Manifest
@@ -1 +1,2 @@
 DIST bluez-5.62.tar.xz 2149348 BLAKE2B db99b36a230fc0be15275d2eda9864b686326ba50648f66b19087ea4309a76d234ab4f1dcb6975f1513a898978b1d5b9332542f5dcee22efd898b79658434a70 SHA512 8fb0b81e1d929d3eee3d70f457ce75dbcff4c2a8a728247fc950bbe11e84d83582345bfd433d2e2df7b5588eb0e42f286658a83c7332be84819d9df49a5707e8
+DIST bluez-5.63.tar.xz 2169168 BLAKE2B 5393bb045a3cf05de164417ce7c98e271742ba752a58aa1ac43a758f2ad8608508e24ff59783d97aa6d5aebdc77e66d9aca94a6c8378cd3fd48fd22ce9d3b89d SHA512 1b8ce7b1bd9611873c27a762a60df580edeefe5424e8733a2067b9afb1a47915f9319849bc1eeee148f5b1f33977b7975e05867e8dbdf73d33cd68e6b99ca75b

diff --git a/net-wireless/bluez/bluez-5.63.ebuild b/net-wireless/bluez/bluez-5.63.ebuild
new file mode 100644
index 000000000000..b2c07f35899e
--- /dev/null
+++ b/net-wireless/bluez/bluez-5.63.ebuild
@@ -0,0 +1,302 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+PYTHON_COMPAT=( python3_{8..10} )
+
+inherit autotools linux-info python-single-r1 readme.gentoo-r1 systemd udev multilib-minimal
+
+DESCRIPTION="Bluetooth Tools and System Daemons for Linux"
+HOMEPAGE="http://www.bluez.org"
+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"
+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
+# change in the future, hence, this REQUIRED_USE constraint could be dropped
+# again in the future.
+# btpclient needs mesh, bug #790587
+REQUIRED_USE="
+	extra-tools? ( deprecated readline )
+	test? ( ${PYTHON_REQUIRED_USE} )
+	test-programs? ( ${PYTHON_REQUIRED_USE} )
+"
+
+TEST_DEPS="${PYTHON_DEPS}
+	$(python_gen_cond_dep '
+		>=dev-python/dbus-python-1[${PYTHON_USEDEP}]
+		dev-python/pygobject:3[${PYTHON_USEDEP}]
+	')
+"
+BDEPEND="
+	dev-python/docutils
+	virtual/pkgconfig
+	test? ( ${TEST_DEPS} )
+"
+DEPEND="
+	>=dev-libs/glib-2.28:2[${MULTILIB_USEDEP}]
+	btpclient? ( >=dev-libs/ell-0.39 )
+	cups? ( net-print/cups:= )
+	mesh? (
+		>=dev-libs/ell-0.39
+		>=dev-libs/json-c-0.13:=
+		sys-libs/readline:0=
+	)
+	midi? ( media-libs/alsa-lib )
+	obex? ( dev-libs/libical:= )
+	readline? ( sys-libs/readline:0= )
+	systemd? ( sys-apps/systemd )
+	>=sys-apps/dbus-1.6:=
+	udev? ( >=virtual/udev-172 )
+"
+RDEPEND="${DEPEND}
+	selinux? ( sec-policy/selinux-bluetooth )
+	test-programs? ( ${TEST_DEPS} )
+"
+
+RESTRICT="!test? ( test )"
+
+PATCHES=(
+	# Try both udevadm paths to cover udev/systemd vs. eudev locations (#539844)
+	# http://www.spinics.net/lists/linux-bluetooth/msg58739.html
+	# https://bugs.gentoo.org/539844
+	# 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
+
+	# This reverts commit ac2c2e10b3adb432a572b618c6f53cabb6b3c80b. It
+	# causes problems with Logitech MX wireless input devices (see
+	# https://github.com/bluez/bluez/issues/220 )
+	#"${FILESDIR}"/0001-Revert-attrib-Make-use-of-bt_att_resend.patch
+	# Instead of reverting, try another fix that seems to work as
+	# reported in upstream bug
+	"${FILESDIR}"/${PN}-5.63-use-queue_push_tail.patch
+)
+
+pkg_setup() {
+	# From http://www.linuxfromscratch.org/blfs/view/svn/general/bluez.html
+	# to prevent bugs like:
+	# https://bugzilla.kernel.org/show_bug.cgi?id=196621
+	CONFIG_CHECK="~NET ~BT ~BT_RFCOMM ~BT_RFCOMM_TTY ~BT_BNEP ~BT_BNEP_MC_FILTER
+		~BT_BNEP_PROTO_FILTER ~BT_HIDP ~CRYPTO_USER_API_HASH ~CRYPTO_USER_API_SKCIPHER ~RFKILL"
+	# https://bugzilla.kernel.org/show_bug.cgi?id=196621
+	# https://bugzilla.kernel.org/show_bug.cgi?id=206815
+	if use mesh || use test; then
+		CONFIG_CHECK="${CONFIG_CHECK} ~CRYPTO_USER
+		~CRYPTO_USER_API ~CRYPTO_USER_API_AEAD ~CRYPTO_AES ~CRYPTO_CCM ~CRYPTO_AEAD ~CRYPTO_CMAC
+		~CRYPTO_MD5 ~CRYPTO_SHA1 ~KEY_DH_OPERATIONS"
+	fi
+	linux-info_pkg_setup
+
+	if use test || use test-programs; then
+		python-single-r1_pkg_setup
+	fi
+
+	if ! use udev; then
+		ewarn
+		ewarn "You are installing ${PN} with USE=-udev. This means various bluetooth"
+		ewarn "devices and adapters from Apple, Dell, Logitech etc. will not work,"
+		ewarn "and hid2hci will not be available."
+		ewarn
+	fi
+}
+
+src_prepare() {
+	default
+
+	# Skip test failing due to fixes for https://github.com/bluez/bluez/issues/220
+	sed -i -e 's:unit_tests += unit/test-hog::' Makefile.am || die
+
+	# http://www.spinics.net/lists/linux-bluetooth/msg38490.html
+	if ! use systemd; then
+		eapply "${FILESDIR}"/0001-Allow-using-obexd-without-systemd-in-the-user-session-r2.patch
+	fi
+
+	eautoreconf
+
+	if use cups; then
+		# Only not .am to not need to run eautoreconf only because of this
+		sed -i \
+			-e "s:cupsdir = \$(libdir)/cups:cupsdir = $(cups-config --serverbin):" \
+			Makefile.{in,tools} || die
+	fi
+
+	multilib_copy_sources
+}
+
+multilib_src_configure() {
+	local myconf=(
+		# readline is automagic when client is enabled
+		# --enable-client always needs readline, bug #504038
+		# --enable-mesh is handled in the same way
+		ac_cv_header_readline_readline_h=$(multilib_native_usex readline)
+		ac_cv_header_readline_readline_h=$(multilib_native_usex mesh)
+	)
+
+	if ! multilib_is_native_abi; then
+		myconf+=(
+			# deps not used for the library
+			{DBUS,GLIB}_{CFLAGS,LIBS}=' '
+		)
+	fi
+
+	econf \
+		--localstatedir=/var \
+		--disable-android \
+		--enable-datafiles \
+		--enable-optimization \
+		$(use_enable debug) \
+		--enable-pie \
+		--enable-threads \
+		--enable-library \
+		--enable-tools \
+		--enable-manpages \
+		--enable-monitor \
+		--with-systemdsystemunitdir="$(systemd_get_systemunitdir)" \
+		--with-systemduserunitdir="$(systemd_get_userunitdir)" \
+		$(multilib_native_use_enable btpclient) \
+		$(multilib_native_use_enable btpclient external-ell) \
+		$(multilib_native_use_enable cups) \
+		$(multilib_native_use_enable deprecated) \
+		$(multilib_native_use_enable experimental) \
+		$(multilib_native_use_enable mesh) \
+		$(multilib_native_use_enable mesh external-ell) \
+		$(multilib_native_use_enable midi) \
+		$(multilib_native_use_enable obex) \
+		$(multilib_native_use_enable readline client) \
+		$(multilib_native_use_enable systemd) \
+		$(multilib_native_use_enable test-programs test) \
+		$(multilib_native_use_enable udev) \
+		$(multilib_native_use_enable udev hid2hci) \
+		$(multilib_native_use_enable udev sixaxis)
+}
+
+multilib_src_compile() {
+	if multilib_is_native_abi; then
+		default
+	else
+		emake -f Makefile -f - libs \
+			<<<'libs: $(lib_LTLIBRARIES)'
+	fi
+}
+
+multilib_src_test() {
+	multilib_is_native_abi && default
+}
+
+multilib_src_install() {
+	if multilib_is_native_abi; then
+		emake DESTDIR="${D}" install
+
+		# Only install extra-tools when relevant USE flag is enabled
+		if use extra-tools; then
+			ewarn "Upstream doesn't support using this tools and their bugs are"
+			ewarn "likely to be ignored forever, also they can break without"
+			ewarn "previous announcement."
+			ewarn "Upstream also states all this tools are not really needed,"
+			ewarn "then, if you still need to rely on them, you must ask them"
+			ewarn "to either install that tool by default or add the needed"
+			ewarn "functionality to the existing 'official' tools."
+			ewarn "Please report this issues to:"
+			ewarn "http://www.bluez.org/development/lists/"
+
+			# Upstream doesn't install this, bug #524640
+			# http://permalink.gmane.org/gmane.linux.bluez.kernel/53115
+			# http://comments.gmane.org/gmane.linux.bluez.kernel/54564
+			dobin tools/btmgmt
+			# gatttool is only built with readline, bug #530776
+			# https://bugzilla.redhat.com/show_bug.cgi?id=1141909
+			# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=720486
+			# https://bugs.archlinux.org/task/37686
+			dobin attrib/gatttool
+			# https://bugzilla.redhat.com/show_bug.cgi?id=1699680
+			dobin tools/avinfo
+		fi
+
+		# Not installed by default after being built, bug #666756
+		use btpclient && dobin tools/btpclient
+
+		# Unittests are not that useful once installed, so make them optional
+		if use test-programs; then
+			# Drop python2 only test tools
+			# https://bugzilla.kernel.org/show_bug.cgi?id=206819
+			rm "${ED}"/usr/$(get_libdir)/bluez/test/simple-player || die
+			# https://bugzilla.kernel.org/show_bug.cgi?id=206821
+			rm "${ED}"/usr/$(get_libdir)/bluez/test/test-hfp || die
+			# https://bugzilla.kernel.org/show_bug.cgi?id=206823
+			rm "${ED}"/usr/$(get_libdir)/bluez/test/test-sap-server	|| die
+
+			python_fix_shebang "${ED}"/usr/$(get_libdir)/bluez/test
+
+			for i in $(find "${ED}"/usr/$(get_libdir)/bluez/test -maxdepth 1 -type f ! -name "*.*"); do
+				dosym "${i}" /usr/bin/bluez-"${i##*/}"
+			done
+		fi
+	else
+		emake DESTDIR="${D}" \
+			install-pkgincludeHEADERS \
+			install-libLTLIBRARIES \
+			install-pkgconfigDATA
+	fi
+}
+
+multilib_src_install_all() {
+	# We need to ensure obexd can be spawned automatically by systemd
+	# when user-session is enabled:
+	# http://marc.info/?l=linux-bluetooth&m=148096094716386&w=2
+	# https://bugs.gentoo.org/show_bug.cgi?id=577842
+	# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=804908
+	# https://bugs.archlinux.org/task/45816
+	# https://bugzilla.redhat.com/show_bug.cgi?id=1318441
+	# https://bugzilla.redhat.com/show_bug.cgi?id=1389347
+	if use systemd; then
+		dosym obex.service /usr/lib/systemd/user/dbus-org.bluez.obex.service
+	fi
+
+	find "${D}" -name '*.la' -type f -delete || die
+
+	keepdir /var/lib/bluetooth
+
+	# Upstream don't want people to play with them
+	# But we keep installing them due to 'historical' reasons
+	insinto /etc/bluetooth
+	local d
+	for d in input network; do
+		doins profiles/${d}/${d}.conf
+	done
+	# Setup auto enable as Fedora does for allowing to use
+	# keyboards/mouse as soon as possible
+	sed -i 's/#\[Policy\]$/\[Policy\]/; s/#AutoEnable=false/AutoEnable=true/' src/main.conf || die
+	doins src/main.conf
+
+	newinitd "${FILESDIR}"/bluetooth-init.d-r5 bluetooth
+	newconfd "${FILESDIR}"/bluetooth-conf.d bluetooth
+
+	einstalldocs
+	use doc && dodoc doc/*.txt
+	# 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
+}
+
+pkg_postinst() {
+	use udev && udev_reload
+	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
+}

diff --git a/net-wireless/bluez/files/bluez-5.63-musl-limits.patch b/net-wireless/bluez/files/bluez-5.63-musl-limits.patch
new file mode 100644
index 000000000000..ebdffc3270b4
--- /dev/null
+++ b/net-wireless/bluez/files/bluez-5.63-musl-limits.patch
@@ -0,0 +1,24 @@
+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.63-use-queue_push_tail.patch b/net-wireless/bluez/files/bluez-5.63-use-queue_push_tail.patch
new file mode 100644
index 000000000000..6644e250cc48
--- /dev/null
+++ b/net-wireless/bluez/files/bluez-5.63-use-queue_push_tail.patch
@@ -0,0 +1,27 @@
+From 7b41f0c38ab34c9a5eec1a70669d183535e86287 Mon Sep 17 00:00:00 2001
+From: Florian Schmaus <flo@geekplace.eu>
+Date: Fri, 17 Dec 2021 14:05:50 +0100
+Subject: [PATCH] DRAFT shared/att: Use queue_push_tail for
+ BT_ATT_OP_READ_BLOB_REQ
+
+As repoorted by Christopher Schramm [1], this is supposed to fix #220.
+
+1: https://github.com/bluez/bluez/issues/220#issuecomment-996669412
+
+Suggested-by: Christopher Schramm <git@cschramm.eu>
+---
+ src/shared/att.c | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/src/shared/att.c b/src/shared/att.c
+index 169f726e4..5ce735a07 100644
+--- a/src/shared/att.c
++++ b/src/shared/att.c
+@@ -1653,7 +1653,6 @@ int bt_att_resend(struct bt_att *att, unsigned int id, uint8_t opcode,
+ 
+ 	switch (opcode) {
+ 	/* Only prepend requests that could be a continuation */
+-	case BT_ATT_OP_READ_BLOB_REQ:
+ 	case BT_ATT_OP_PREP_WRITE_REQ:
+ 	case BT_ATT_OP_EXEC_WRITE_REQ:
+ 		result = queue_push_head(att->req_queue, op);


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-wireless/bluez/, net-wireless/bluez/files/
@ 2022-04-18 16:27 Pacho Ramos
  0 siblings, 0 replies; 22+ messages in thread
From: Pacho Ramos @ 2022-04-18 16:27 UTC (permalink / raw
  To: gentoo-commits

commit:     ce2e1c7de43ea080fbf8e1dea2af821993d8d6d6
Author:     Pacho Ramos <pacho <AT> gentoo <DOT> org>
AuthorDate: Mon Apr 18 16:23:31 2022 +0000
Commit:     Pacho Ramos <pacho <AT> gentoo <DOT> org>
CommitDate: Mon Apr 18 16:23:31 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ce2e1c7d

net-wireless/bluez: drop 5.62-r2, 5.62-r3, 5.63-r1

Bug: https://bugs.gentoo.org/835077
Signed-off-by: Pacho Ramos <pacho <AT> gentoo.org>

 net-wireless/bluez/Manifest                        |   2 -
 net-wireless/bluez/bluez-5.62-r2.ebuild            | 285 -----------
 net-wireless/bluez/bluez-5.62-r3.ebuild            | 295 -----------
 net-wireless/bluez/bluez-5.63-r1.ebuild            | 295 -----------
 ...1-Revert-attrib-Make-use-of-bt_att_resend.patch | 188 -------
 ...hog-Fix-read-order-of-attributes-rediffed.patch | 542 ---------------------
 ...while-uhid-device-has-not-been-c-rediffed.patch |  90 ----
 .../bluez/files/bluez-5.62-fix-disconnecting.patch |  54 --
 8 files changed, 1751 deletions(-)

diff --git a/net-wireless/bluez/Manifest b/net-wireless/bluez/Manifest
index 6183ed41d707..1f5ef5199e6c 100644
--- a/net-wireless/bluez/Manifest
+++ b/net-wireless/bluez/Manifest
@@ -1,3 +1 @@
-DIST bluez-5.62.tar.xz 2149348 BLAKE2B db99b36a230fc0be15275d2eda9864b686326ba50648f66b19087ea4309a76d234ab4f1dcb6975f1513a898978b1d5b9332542f5dcee22efd898b79658434a70 SHA512 8fb0b81e1d929d3eee3d70f457ce75dbcff4c2a8a728247fc950bbe11e84d83582345bfd433d2e2df7b5588eb0e42f286658a83c7332be84819d9df49a5707e8
-DIST bluez-5.63.tar.xz 2169168 BLAKE2B 5393bb045a3cf05de164417ce7c98e271742ba752a58aa1ac43a758f2ad8608508e24ff59783d97aa6d5aebdc77e66d9aca94a6c8378cd3fd48fd22ce9d3b89d SHA512 1b8ce7b1bd9611873c27a762a60df580edeefe5424e8733a2067b9afb1a47915f9319849bc1eeee148f5b1f33977b7975e05867e8dbdf73d33cd68e6b99ca75b
 DIST bluez-5.64.tar.xz 2175148 BLAKE2B 828c620330d1993d5c5c2a865f2d27a29425e3583aac01a1a782290a805ee0fd6456b6832c804ad323dd8714fa9329487b2616ed08f1f491ea29403ee05dba2d SHA512 f11f9974b29c5c6fce3890d7e42425c1cb02e42c1b8f49c5cc4b249234e67b64317d0e5e82721e2fbf1b53269c8569a9c869d59ce42b5e927f6622f0753e53cd

diff --git a/net-wireless/bluez/bluez-5.62-r2.ebuild b/net-wireless/bluez/bluez-5.62-r2.ebuild
deleted file mode 100644
index 70c9a7547c55..000000000000
--- a/net-wireless/bluez/bluez-5.62-r2.ebuild
+++ /dev/null
@@ -1,285 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-PYTHON_COMPAT=( python3_{8..10} )
-
-inherit autotools linux-info python-single-r1 readme.gentoo-r1 systemd udev multilib-minimal
-
-DESCRIPTION="Bluetooth Tools and System Daemons for Linux"
-HOMEPAGE="http://www.bluez.org"
-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"
-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
-# change in the future, hence, this REQUIRED_USE constraint could be dropped
-# again in the future.
-REQUIRED_USE="
-	extra-tools? ( deprecated readline )
-	test? ( ${PYTHON_REQUIRED_USE} )
-	test-programs? ( ${PYTHON_REQUIRED_USE} )
-"
-
-TEST_DEPS="${PYTHON_DEPS}
-	$(python_gen_cond_dep '
-		>=dev-python/dbus-python-1[${PYTHON_USEDEP}]
-		dev-python/pygobject:3[${PYTHON_USEDEP}]
-	')
-"
-BDEPEND="
-	dev-python/docutils
-	virtual/pkgconfig
-	test? ( ${TEST_DEPS} )
-"
-DEPEND="
-	>=dev-libs/glib-2.28:2[${MULTILIB_USEDEP}]
-	btpclient? ( >=dev-libs/ell-0.39 )
-	cups? ( net-print/cups:= )
-	mesh? (
-		>=dev-libs/ell-0.39
-		>=dev-libs/json-c-0.13:=
-		sys-libs/readline:0=
-	)
-	midi? ( media-libs/alsa-lib )
-	obex? ( dev-libs/libical:= )
-	readline? ( sys-libs/readline:0= )
-	systemd? ( sys-apps/systemd )
-	>=sys-apps/dbus-1.6:=
-	udev? ( >=virtual/udev-172 )
-"
-RDEPEND="${DEPEND}
-	selinux? ( sec-policy/selinux-bluetooth )
-	test-programs? ( ${TEST_DEPS} )
-"
-
-RESTRICT="!test? ( test )"
-
-PATCHES=(
-	# Try both udevadm paths to cover udev/systemd vs. eudev locations (#539844)
-	# http://www.spinics.net/lists/linux-bluetooth/msg58739.html
-	# https://bugs.gentoo.org/539844
-	"${FILESDIR}"/${PN}-udevadm-path-r1.patch
-
-	# Fedora patches
-	# http://www.spinics.net/lists/linux-bluetooth/msg40136.html
-	"${FILESDIR}"/0001-obex-Use-GLib-helper-function-to-manipulate-paths.patch
-)
-
-pkg_setup() {
-	# From http://www.linuxfromscratch.org/blfs/view/svn/general/bluez.html
-	# to prevent bugs like:
-	# https://bugzilla.kernel.org/show_bug.cgi?id=196621
-	CONFIG_CHECK="~NET ~BT ~BT_RFCOMM ~BT_RFCOMM_TTY ~BT_BNEP ~BT_BNEP_MC_FILTER
-		~BT_BNEP_PROTO_FILTER ~BT_HIDP ~CRYPTO_USER_API_HASH ~CRYPTO_USER_API_SKCIPHER ~RFKILL"
-	# https://bugzilla.kernel.org/show_bug.cgi?id=196621
-	# https://bugzilla.kernel.org/show_bug.cgi?id=206815
-	if use mesh || use test; then
-		CONFIG_CHECK="${CONFIG_CHECK} ~CRYPTO_USER
-		~CRYPTO_USER_API ~CRYPTO_USER_API_AEAD ~CRYPTO_AES ~CRYPTO_CCM ~CRYPTO_AEAD ~CRYPTO_CMAC"
-	fi
-	linux-info_pkg_setup
-
-	if use test || use test-programs; then
-		python-single-r1_pkg_setup
-	fi
-
-	if ! use udev; then
-		ewarn
-		ewarn "You are installing ${PN} with USE=-udev. This means various bluetooth"
-		ewarn "devices and adapters from Apple, Dell, Logitech etc. will not work,"
-		ewarn "and hid2hci will not be available."
-		ewarn
-	fi
-}
-
-src_prepare() {
-	default
-
-	# http://www.spinics.net/lists/linux-bluetooth/msg38490.html
-	if ! use systemd; then
-		eapply "${FILESDIR}"/0001-Allow-using-obexd-without-systemd-in-the-user-session-r2.patch
-	fi
-
-	eautoreconf
-
-	if use cups; then
-		# Only not .am to not need to run eautoreconf only because of this
-		sed -i \
-			-e "s:cupsdir = \$(libdir)/cups:cupsdir = $(cups-config --serverbin):" \
-			Makefile.{in,tools} || die
-	fi
-
-	multilib_copy_sources
-}
-
-multilib_src_configure() {
-	local myconf=(
-		# readline is automagic when client is enabled
-		# --enable-client always needs readline, bug #504038
-		# --enable-mesh is handled in the same way
-		ac_cv_header_readline_readline_h=$(multilib_native_usex readline)
-		ac_cv_header_readline_readline_h=$(multilib_native_usex mesh)
-	)
-
-	if ! multilib_is_native_abi; then
-		myconf+=(
-			# deps not used for the library
-			{DBUS,GLIB}_{CFLAGS,LIBS}=' '
-		)
-	fi
-
-	econf \
-		--localstatedir=/var \
-		--disable-android \
-		--enable-datafiles \
-		--enable-optimization \
-		$(use_enable debug) \
-		--enable-pie \
-		--enable-threads \
-		--enable-library \
-		--enable-tools \
-		--enable-manpages \
-		--enable-monitor \
-		--with-systemdsystemunitdir="$(systemd_get_systemunitdir)" \
-		--with-systemduserunitdir="$(systemd_get_userunitdir)" \
-		$(multilib_native_use_enable btpclient) \
-		$(multilib_native_use_enable btpclient external-ell) \
-		$(multilib_native_use_enable cups) \
-		$(multilib_native_use_enable deprecated) \
-		$(multilib_native_use_enable experimental) \
-		$(multilib_native_use_enable mesh) \
-		$(multilib_native_use_enable mesh external-ell) \
-		$(multilib_native_use_enable midi) \
-		$(multilib_native_use_enable obex) \
-		$(multilib_native_use_enable readline client) \
-		$(multilib_native_use_enable systemd) \
-		$(multilib_native_use_enable test-programs test) \
-		$(multilib_native_use_enable udev) \
-		$(multilib_native_use_enable udev hid2hci) \
-		$(multilib_native_use_enable udev sixaxis)
-}
-
-multilib_src_compile() {
-	if multilib_is_native_abi; then
-		default
-	else
-		emake -f Makefile -f - libs \
-			<<<'libs: $(lib_LTLIBRARIES)'
-	fi
-}
-
-multilib_src_test() {
-	multilib_is_native_abi && default
-}
-
-multilib_src_install() {
-	if multilib_is_native_abi; then
-		emake DESTDIR="${D}" install
-
-		# Only install extra-tools when relevant USE flag is enabled
-		if use extra-tools; then
-			ewarn "Upstream doesn't support using this tools and their bugs are"
-			ewarn "likely to be ignored forever, also they can break without"
-			ewarn "previous announcement."
-			ewarn "Upstream also states all this tools are not really needed,"
-			ewarn "then, if you still need to rely on them, you must ask them"
-			ewarn "to either install that tool by default or add the needed"
-			ewarn "functionality to the existing 'official' tools."
-			ewarn "Please report this issues to:"
-			ewarn "http://www.bluez.org/development/lists/"
-
-			# Upstream doesn't install this, bug #524640
-			# http://permalink.gmane.org/gmane.linux.bluez.kernel/53115
-			# http://comments.gmane.org/gmane.linux.bluez.kernel/54564
-			dobin tools/btmgmt
-			# gatttool is only built with readline, bug #530776
-			# https://bugzilla.redhat.com/show_bug.cgi?id=1141909
-			# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=720486
-			# https://bugs.archlinux.org/task/37686
-			dobin attrib/gatttool
-			# https://bugzilla.redhat.com/show_bug.cgi?id=1699680
-			dobin tools/avinfo
-		fi
-
-		# Not installed by default after being built, bug #666756
-		use btpclient && dobin tools/btpclient
-
-		# Unittests are not that useful once installed, so make them optional
-		if use test-programs; then
-			# Drop python2 only test tools
-			# https://bugzilla.kernel.org/show_bug.cgi?id=206819
-			rm "${ED}"/usr/$(get_libdir)/bluez/test/simple-player || die
-			# https://bugzilla.kernel.org/show_bug.cgi?id=206821
-			rm "${ED}"/usr/$(get_libdir)/bluez/test/test-hfp || die
-			# https://bugzilla.kernel.org/show_bug.cgi?id=206823
-			rm "${ED}"/usr/$(get_libdir)/bluez/test/test-sap-server	|| die
-
-			python_fix_shebang "${ED}"/usr/$(get_libdir)/bluez/test
-
-			for i in $(find "${ED}"/usr/$(get_libdir)/bluez/test -maxdepth 1 -type f ! -name "*.*"); do
-				dosym "${i}" /usr/bin/bluez-"${i##*/}"
-			done
-		fi
-	else
-		emake DESTDIR="${D}" \
-			install-pkgincludeHEADERS \
-			install-libLTLIBRARIES \
-			install-pkgconfigDATA
-	fi
-}
-
-multilib_src_install_all() {
-	# We need to ensure obexd can be spawned automatically by systemd
-	# when user-session is enabled:
-	# http://marc.info/?l=linux-bluetooth&m=148096094716386&w=2
-	# https://bugs.gentoo.org/show_bug.cgi?id=577842
-	# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=804908
-	# https://bugs.archlinux.org/task/45816
-	# https://bugzilla.redhat.com/show_bug.cgi?id=1318441
-	# https://bugzilla.redhat.com/show_bug.cgi?id=1389347
-	if use systemd; then
-		dosym obex.service /usr/lib/systemd/user/dbus-org.bluez.obex.service
-	fi
-
-	find "${D}" -name '*.la' -type f -delete || die
-
-	keepdir /var/lib/bluetooth
-
-	# Upstream don't want people to play with them
-	# But we keep installing them due to 'historical' reasons
-	insinto /etc/bluetooth
-	local d
-	for d in input network; do
-		doins profiles/${d}/${d}.conf
-	done
-	# Setup auto enable as Fedora does for allowing to use
-	# keyboards/mouse as soon as possible
-	sed -i 's/#\[Policy\]$/\[Policy\]/; s/#AutoEnable=false/AutoEnable=true/' src/main.conf || die
-	doins src/main.conf
-
-	newinitd "${FILESDIR}"/bluetooth-init.d-r5 bluetooth
-	newconfd "${FILESDIR}"/bluetooth-conf.d bluetooth
-
-	einstalldocs
-	use doc && dodoc doc/*.txt
-	# 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
-}
-
-pkg_postinst() {
-	use udev && udev_reload
-	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
-}

diff --git a/net-wireless/bluez/bluez-5.62-r3.ebuild b/net-wireless/bluez/bluez-5.62-r3.ebuild
deleted file mode 100644
index 71035af2f830..000000000000
--- a/net-wireless/bluez/bluez-5.62-r3.ebuild
+++ /dev/null
@@ -1,295 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-PYTHON_COMPAT=( python3_{8..10} )
-
-inherit autotools linux-info python-single-r1 readme.gentoo-r1 systemd udev multilib-minimal
-
-DESCRIPTION="Bluetooth Tools and System Daemons for Linux"
-HOMEPAGE="http://www.bluez.org"
-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"
-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
-# change in the future, hence, this REQUIRED_USE constraint could be dropped
-# again in the future.
-# btpclient needs mesh, bug #790587
-REQUIRED_USE="
-	extra-tools? ( deprecated readline )
-	test? ( ${PYTHON_REQUIRED_USE} )
-	test-programs? ( ${PYTHON_REQUIRED_USE} )
-"
-
-TEST_DEPS="${PYTHON_DEPS}
-	$(python_gen_cond_dep '
-		>=dev-python/dbus-python-1[${PYTHON_USEDEP}]
-		dev-python/pygobject:3[${PYTHON_USEDEP}]
-	')
-"
-BDEPEND="
-	dev-python/docutils
-	virtual/pkgconfig
-	test? ( ${TEST_DEPS} )
-"
-DEPEND="
-	>=dev-libs/glib-2.28:2[${MULTILIB_USEDEP}]
-	btpclient? ( >=dev-libs/ell-0.39 )
-	cups? ( net-print/cups:= )
-	mesh? (
-		>=dev-libs/ell-0.39
-		>=dev-libs/json-c-0.13:=
-		sys-libs/readline:0=
-	)
-	midi? ( media-libs/alsa-lib )
-	obex? ( dev-libs/libical:= )
-	readline? ( sys-libs/readline:0= )
-	systemd? ( sys-apps/systemd )
-	>=sys-apps/dbus-1.6:=
-	udev? ( >=virtual/udev-172 )
-"
-RDEPEND="${DEPEND}
-	selinux? ( sec-policy/selinux-bluetooth )
-	test-programs? ( ${TEST_DEPS} )
-"
-
-RESTRICT="!test? ( test )"
-
-PATCHES=(
-	# Try both udevadm paths to cover udev/systemd vs. eudev locations (#539844)
-	# http://www.spinics.net/lists/linux-bluetooth/msg58739.html
-	# https://bugs.gentoo.org/539844
-	"${FILESDIR}"/${PN}-udevadm-path-r1.patch
-
-	# Fedora patches
-	# http://www.spinics.net/lists/linux-bluetooth/msg40136.html
-	"${FILESDIR}"/0001-obex-Use-GLib-helper-function-to-manipulate-paths.patch
-
-	# This reverts commit ac2c2e10b3adb432a572b618c6f53cabb6b3c80b. It
-	# causes problems with Logitech MX wireless input devices (see
-	# https://github.com/bluez/bluez/issues/220 )
-	"${FILESDIR}"/0001-Revert-attrib-Make-use-of-bt_att_resend.patch
-
-	# gatt-client: Fix disconnecting due to GattCharacteristic1.MTU
-	# (from 'master')
-	"${FILESDIR}"/${P}-fix-disconnecting.patch
-)
-
-pkg_setup() {
-	# From http://www.linuxfromscratch.org/blfs/view/svn/general/bluez.html
-	# to prevent bugs like:
-	# https://bugzilla.kernel.org/show_bug.cgi?id=196621
-	CONFIG_CHECK="~NET ~BT ~BT_RFCOMM ~BT_RFCOMM_TTY ~BT_BNEP ~BT_BNEP_MC_FILTER
-		~BT_BNEP_PROTO_FILTER ~BT_HIDP ~CRYPTO_USER_API_HASH ~CRYPTO_USER_API_SKCIPHER ~RFKILL"
-	# https://bugzilla.kernel.org/show_bug.cgi?id=196621
-	# https://bugzilla.kernel.org/show_bug.cgi?id=206815
-	if use mesh || use test; then
-		CONFIG_CHECK="${CONFIG_CHECK} ~CRYPTO_USER
-		~CRYPTO_USER_API ~CRYPTO_USER_API_AEAD ~CRYPTO_AES ~CRYPTO_CCM ~CRYPTO_AEAD ~CRYPTO_CMAC"
-	fi
-	linux-info_pkg_setup
-
-	if use test || use test-programs; then
-		python-single-r1_pkg_setup
-	fi
-
-	if ! use udev; then
-		ewarn
-		ewarn "You are installing ${PN} with USE=-udev. This means various bluetooth"
-		ewarn "devices and adapters from Apple, Dell, Logitech etc. will not work,"
-		ewarn "and hid2hci will not be available."
-		ewarn
-	fi
-}
-
-src_prepare() {
-	default
-
-	# http://www.spinics.net/lists/linux-bluetooth/msg38490.html
-	if ! use systemd; then
-		eapply "${FILESDIR}"/0001-Allow-using-obexd-without-systemd-in-the-user-session-r2.patch
-	fi
-
-	eautoreconf
-
-	if use cups; then
-		# Only not .am to not need to run eautoreconf only because of this
-		sed -i \
-			-e "s:cupsdir = \$(libdir)/cups:cupsdir = $(cups-config --serverbin):" \
-			Makefile.{in,tools} || die
-	fi
-
-	multilib_copy_sources
-}
-
-multilib_src_configure() {
-	local myconf=(
-		# readline is automagic when client is enabled
-		# --enable-client always needs readline, bug #504038
-		# --enable-mesh is handled in the same way
-		ac_cv_header_readline_readline_h=$(multilib_native_usex readline)
-		ac_cv_header_readline_readline_h=$(multilib_native_usex mesh)
-	)
-
-	if ! multilib_is_native_abi; then
-		myconf+=(
-			# deps not used for the library
-			{DBUS,GLIB}_{CFLAGS,LIBS}=' '
-		)
-	fi
-
-	econf \
-		--localstatedir=/var \
-		--disable-android \
-		--enable-datafiles \
-		--enable-optimization \
-		$(use_enable debug) \
-		--enable-pie \
-		--enable-threads \
-		--enable-library \
-		--enable-tools \
-		--enable-manpages \
-		--enable-monitor \
-		--with-systemdsystemunitdir="$(systemd_get_systemunitdir)" \
-		--with-systemduserunitdir="$(systemd_get_userunitdir)" \
-		$(multilib_native_use_enable btpclient) \
-		$(multilib_native_use_enable btpclient external-ell) \
-		$(multilib_native_use_enable cups) \
-		$(multilib_native_use_enable deprecated) \
-		$(multilib_native_use_enable experimental) \
-		$(multilib_native_use_enable mesh) \
-		$(multilib_native_use_enable mesh external-ell) \
-		$(multilib_native_use_enable midi) \
-		$(multilib_native_use_enable obex) \
-		$(multilib_native_use_enable readline client) \
-		$(multilib_native_use_enable systemd) \
-		$(multilib_native_use_enable test-programs test) \
-		$(multilib_native_use_enable udev) \
-		$(multilib_native_use_enable udev hid2hci) \
-		$(multilib_native_use_enable udev sixaxis)
-}
-
-multilib_src_compile() {
-	if multilib_is_native_abi; then
-		default
-	else
-		emake -f Makefile -f - libs \
-			<<<'libs: $(lib_LTLIBRARIES)'
-	fi
-}
-
-multilib_src_test() {
-	multilib_is_native_abi && default
-}
-
-multilib_src_install() {
-	if multilib_is_native_abi; then
-		emake DESTDIR="${D}" install
-
-		# Only install extra-tools when relevant USE flag is enabled
-		if use extra-tools; then
-			ewarn "Upstream doesn't support using this tools and their bugs are"
-			ewarn "likely to be ignored forever, also they can break without"
-			ewarn "previous announcement."
-			ewarn "Upstream also states all this tools are not really needed,"
-			ewarn "then, if you still need to rely on them, you must ask them"
-			ewarn "to either install that tool by default or add the needed"
-			ewarn "functionality to the existing 'official' tools."
-			ewarn "Please report this issues to:"
-			ewarn "http://www.bluez.org/development/lists/"
-
-			# Upstream doesn't install this, bug #524640
-			# http://permalink.gmane.org/gmane.linux.bluez.kernel/53115
-			# http://comments.gmane.org/gmane.linux.bluez.kernel/54564
-			dobin tools/btmgmt
-			# gatttool is only built with readline, bug #530776
-			# https://bugzilla.redhat.com/show_bug.cgi?id=1141909
-			# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=720486
-			# https://bugs.archlinux.org/task/37686
-			dobin attrib/gatttool
-			# https://bugzilla.redhat.com/show_bug.cgi?id=1699680
-			dobin tools/avinfo
-		fi
-
-		# Not installed by default after being built, bug #666756
-		use btpclient && dobin tools/btpclient
-
-		# Unittests are not that useful once installed, so make them optional
-		if use test-programs; then
-			# Drop python2 only test tools
-			# https://bugzilla.kernel.org/show_bug.cgi?id=206819
-			rm "${ED}"/usr/$(get_libdir)/bluez/test/simple-player || die
-			# https://bugzilla.kernel.org/show_bug.cgi?id=206821
-			rm "${ED}"/usr/$(get_libdir)/bluez/test/test-hfp || die
-			# https://bugzilla.kernel.org/show_bug.cgi?id=206823
-			rm "${ED}"/usr/$(get_libdir)/bluez/test/test-sap-server	|| die
-
-			python_fix_shebang "${ED}"/usr/$(get_libdir)/bluez/test
-
-			for i in $(find "${ED}"/usr/$(get_libdir)/bluez/test -maxdepth 1 -type f ! -name "*.*"); do
-				dosym "${i}" /usr/bin/bluez-"${i##*/}"
-			done
-		fi
-	else
-		emake DESTDIR="${D}" \
-			install-pkgincludeHEADERS \
-			install-libLTLIBRARIES \
-			install-pkgconfigDATA
-	fi
-}
-
-multilib_src_install_all() {
-	# We need to ensure obexd can be spawned automatically by systemd
-	# when user-session is enabled:
-	# http://marc.info/?l=linux-bluetooth&m=148096094716386&w=2
-	# https://bugs.gentoo.org/show_bug.cgi?id=577842
-	# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=804908
-	# https://bugs.archlinux.org/task/45816
-	# https://bugzilla.redhat.com/show_bug.cgi?id=1318441
-	# https://bugzilla.redhat.com/show_bug.cgi?id=1389347
-	if use systemd; then
-		dosym obex.service /usr/lib/systemd/user/dbus-org.bluez.obex.service
-	fi
-
-	find "${D}" -name '*.la' -type f -delete || die
-
-	keepdir /var/lib/bluetooth
-
-	# Upstream don't want people to play with them
-	# But we keep installing them due to 'historical' reasons
-	insinto /etc/bluetooth
-	local d
-	for d in input network; do
-		doins profiles/${d}/${d}.conf
-	done
-	# Setup auto enable as Fedora does for allowing to use
-	# keyboards/mouse as soon as possible
-	sed -i 's/#\[Policy\]$/\[Policy\]/; s/#AutoEnable=false/AutoEnable=true/' src/main.conf || die
-	doins src/main.conf
-
-	newinitd "${FILESDIR}"/bluetooth-init.d-r5 bluetooth
-	newconfd "${FILESDIR}"/bluetooth-conf.d bluetooth
-
-	einstalldocs
-	use doc && dodoc doc/*.txt
-	# 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
-}
-
-pkg_postinst() {
-	use udev && udev_reload
-	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
-}

diff --git a/net-wireless/bluez/bluez-5.63-r1.ebuild b/net-wireless/bluez/bluez-5.63-r1.ebuild
deleted file mode 100644
index baad2b48deaf..000000000000
--- a/net-wireless/bluez/bluez-5.63-r1.ebuild
+++ /dev/null
@@ -1,295 +0,0 @@
-# Copyright 1999-2022 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-PYTHON_COMPAT=( python3_{8..10} )
-
-inherit autotools linux-info python-single-r1 readme.gentoo-r1 systemd udev multilib-minimal
-
-DESCRIPTION="Bluetooth Tools and System Daemons for Linux"
-HOMEPAGE="http://www.bluez.org"
-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"
-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
-# change in the future, hence, this REQUIRED_USE constraint could be dropped
-# again in the future.
-# btpclient needs mesh, bug #790587
-REQUIRED_USE="
-	extra-tools? ( deprecated readline )
-	test? ( ${PYTHON_REQUIRED_USE} )
-	test-programs? ( ${PYTHON_REQUIRED_USE} )
-"
-
-TEST_DEPS="${PYTHON_DEPS}
-	$(python_gen_cond_dep '
-		>=dev-python/dbus-python-1[${PYTHON_USEDEP}]
-		dev-python/pygobject:3[${PYTHON_USEDEP}]
-	')
-"
-BDEPEND="
-	dev-python/docutils
-	virtual/pkgconfig
-	test? ( ${TEST_DEPS} )
-"
-DEPEND="
-	>=dev-libs/glib-2.28:2[${MULTILIB_USEDEP}]
-	btpclient? ( >=dev-libs/ell-0.39 )
-	cups? ( net-print/cups:= )
-	mesh? (
-		>=dev-libs/ell-0.39
-		>=dev-libs/json-c-0.13:=
-		sys-libs/readline:0=
-	)
-	midi? ( media-libs/alsa-lib )
-	obex? ( dev-libs/libical:= )
-	readline? ( sys-libs/readline:0= )
-	systemd? ( sys-apps/systemd )
-	>=sys-apps/dbus-1.6:=
-	udev? ( >=virtual/udev-172 )
-"
-RDEPEND="${DEPEND}
-	selinux? ( sec-policy/selinux-bluetooth )
-	test-programs? ( ${TEST_DEPS} )
-"
-
-RESTRICT="!test? ( test )"
-
-PATCHES=(
-	# Try both udevadm paths to cover udev/systemd vs. eudev locations (#539844)
-	# http://www.spinics.net/lists/linux-bluetooth/msg58739.html
-	# https://bugs.gentoo.org/539844
-	# 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://github.com/bluez/bluez/issues/220
-	"${FILESDIR}"/0001-hog-Fix-read-order-of-attributes-rediffed.patch
-	"${FILESDIR}"/0002-hog-Add-input-queue-while-uhid-device-has-not-been-c-rediffed.patch
-)
-
-pkg_setup() {
-	# From http://www.linuxfromscratch.org/blfs/view/svn/general/bluez.html
-	# to prevent bugs like:
-	# https://bugzilla.kernel.org/show_bug.cgi?id=196621
-	CONFIG_CHECK="~NET ~BT ~BT_RFCOMM ~BT_RFCOMM_TTY ~BT_BNEP ~BT_BNEP_MC_FILTER
-		~BT_BNEP_PROTO_FILTER ~BT_HIDP ~CRYPTO_USER_API_HASH ~CRYPTO_USER_API_SKCIPHER ~RFKILL"
-	# https://bugzilla.kernel.org/show_bug.cgi?id=196621
-	# https://bugzilla.kernel.org/show_bug.cgi?id=206815
-	if use mesh || use test; then
-		CONFIG_CHECK="${CONFIG_CHECK} ~CRYPTO_USER
-		~CRYPTO_USER_API ~CRYPTO_USER_API_AEAD ~CRYPTO_AES ~CRYPTO_CCM ~CRYPTO_AEAD ~CRYPTO_CMAC
-		~CRYPTO_MD5 ~CRYPTO_SHA1 ~KEY_DH_OPERATIONS"
-	fi
-	linux-info_pkg_setup
-
-	if use test || use test-programs; then
-		python-single-r1_pkg_setup
-	fi
-
-	if ! use udev; then
-		ewarn
-		ewarn "You are installing ${PN} with USE=-udev. This means various bluetooth"
-		ewarn "devices and adapters from Apple, Dell, Logitech etc. will not work,"
-		ewarn "and hid2hci will not be available."
-		ewarn
-	fi
-}
-
-src_prepare() {
-	default
-
-	# http://www.spinics.net/lists/linux-bluetooth/msg38490.html
-	if ! use systemd; then
-		eapply "${FILESDIR}"/0001-Allow-using-obexd-without-systemd-in-the-user-session-r2.patch
-	fi
-
-	eautoreconf
-
-	if use cups; then
-		# Only not .am to not need to run eautoreconf only because of this
-		sed -i \
-			-e "s:cupsdir = \$(libdir)/cups:cupsdir = $(cups-config --serverbin):" \
-			Makefile.{in,tools} || die
-	fi
-
-	multilib_copy_sources
-}
-
-multilib_src_configure() {
-	local myconf=(
-		# readline is automagic when client is enabled
-		# --enable-client always needs readline, bug #504038
-		# --enable-mesh is handled in the same way
-		ac_cv_header_readline_readline_h=$(multilib_native_usex readline)
-		ac_cv_header_readline_readline_h=$(multilib_native_usex mesh)
-	)
-
-	if ! multilib_is_native_abi; then
-		myconf+=(
-			# deps not used for the library
-			{DBUS,GLIB}_{CFLAGS,LIBS}=' '
-		)
-	fi
-
-	econf \
-		--localstatedir=/var \
-		--disable-android \
-		--enable-datafiles \
-		--enable-optimization \
-		$(use_enable debug) \
-		--enable-pie \
-		--enable-threads \
-		--enable-library \
-		--enable-tools \
-		--enable-manpages \
-		--enable-monitor \
-		--with-systemdsystemunitdir="$(systemd_get_systemunitdir)" \
-		--with-systemduserunitdir="$(systemd_get_userunitdir)" \
-		$(multilib_native_use_enable btpclient) \
-		$(multilib_native_use_enable btpclient external-ell) \
-		$(multilib_native_use_enable cups) \
-		$(multilib_native_use_enable deprecated) \
-		$(multilib_native_use_enable experimental) \
-		$(multilib_native_use_enable mesh) \
-		$(multilib_native_use_enable mesh external-ell) \
-		$(multilib_native_use_enable midi) \
-		$(multilib_native_use_enable obex) \
-		$(multilib_native_use_enable readline client) \
-		$(multilib_native_use_enable systemd) \
-		$(multilib_native_use_enable test-programs test) \
-		$(multilib_native_use_enable udev) \
-		$(multilib_native_use_enable udev hid2hci) \
-		$(multilib_native_use_enable udev sixaxis)
-}
-
-multilib_src_compile() {
-	if multilib_is_native_abi; then
-		default
-	else
-		emake -f Makefile -f - libs \
-			<<<'libs: $(lib_LTLIBRARIES)'
-	fi
-}
-
-multilib_src_test() {
-	multilib_is_native_abi && default
-}
-
-multilib_src_install() {
-	if multilib_is_native_abi; then
-		emake DESTDIR="${D}" install
-
-		# Only install extra-tools when relevant USE flag is enabled
-		if use extra-tools; then
-			ewarn "Upstream doesn't support using this tools and their bugs are"
-			ewarn "likely to be ignored forever, also they can break without"
-			ewarn "previous announcement."
-			ewarn "Upstream also states all this tools are not really needed,"
-			ewarn "then, if you still need to rely on them, you must ask them"
-			ewarn "to either install that tool by default or add the needed"
-			ewarn "functionality to the existing 'official' tools."
-			ewarn "Please report this issues to:"
-			ewarn "http://www.bluez.org/development/lists/"
-
-			# Upstream doesn't install this, bug #524640
-			# http://permalink.gmane.org/gmane.linux.bluez.kernel/53115
-			# http://comments.gmane.org/gmane.linux.bluez.kernel/54564
-			dobin tools/btmgmt
-			# gatttool is only built with readline, bug #530776
-			# https://bugzilla.redhat.com/show_bug.cgi?id=1141909
-			# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=720486
-			# https://bugs.archlinux.org/task/37686
-			dobin attrib/gatttool
-			# https://bugzilla.redhat.com/show_bug.cgi?id=1699680
-			dobin tools/avinfo
-		fi
-
-		# Not installed by default after being built, bug #666756
-		use btpclient && dobin tools/btpclient
-
-		# Unittests are not that useful once installed, so make them optional
-		if use test-programs; then
-			# Drop python2 only test tools
-			# https://bugzilla.kernel.org/show_bug.cgi?id=206819
-			rm "${ED}"/usr/$(get_libdir)/bluez/test/simple-player || die
-			# https://bugzilla.kernel.org/show_bug.cgi?id=206821
-			rm "${ED}"/usr/$(get_libdir)/bluez/test/test-hfp || die
-			# https://bugzilla.kernel.org/show_bug.cgi?id=206823
-			rm "${ED}"/usr/$(get_libdir)/bluez/test/test-sap-server	|| die
-
-			python_fix_shebang "${ED}"/usr/$(get_libdir)/bluez/test
-
-			for i in $(find "${ED}"/usr/$(get_libdir)/bluez/test -maxdepth 1 -type f ! -name "*.*"); do
-				dosym "${i}" /usr/bin/bluez-"${i##*/}"
-			done
-		fi
-	else
-		emake DESTDIR="${D}" \
-			install-pkgincludeHEADERS \
-			install-libLTLIBRARIES \
-			install-pkgconfigDATA
-	fi
-}
-
-multilib_src_install_all() {
-	# We need to ensure obexd can be spawned automatically by systemd
-	# when user-session is enabled:
-	# http://marc.info/?l=linux-bluetooth&m=148096094716386&w=2
-	# https://bugs.gentoo.org/show_bug.cgi?id=577842
-	# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=804908
-	# https://bugs.archlinux.org/task/45816
-	# https://bugzilla.redhat.com/show_bug.cgi?id=1318441
-	# https://bugzilla.redhat.com/show_bug.cgi?id=1389347
-	if use systemd; then
-		dosym obex.service /usr/lib/systemd/user/dbus-org.bluez.obex.service
-	fi
-
-	find "${D}" -name '*.la' -type f -delete || die
-
-	keepdir /var/lib/bluetooth
-
-	# Upstream don't want people to play with them
-	# But we keep installing them due to 'historical' reasons
-	insinto /etc/bluetooth
-	local d
-	for d in input network; do
-		doins profiles/${d}/${d}.conf
-	done
-	# Setup auto enable as Fedora does for allowing to use
-	# keyboards/mouse as soon as possible
-	sed -i 's/#\[Policy\]$/\[Policy\]/; s/#AutoEnable=false/AutoEnable=true/' src/main.conf || die
-	doins src/main.conf
-
-	newinitd "${FILESDIR}"/bluetooth-init.d-r5 bluetooth
-	newconfd "${FILESDIR}"/bluetooth-conf.d bluetooth
-
-	einstalldocs
-	use doc && dodoc doc/*.txt
-	# 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
-}
-
-pkg_postinst() {
-	use udev && udev_reload
-	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
-}

diff --git a/net-wireless/bluez/files/0001-Revert-attrib-Make-use-of-bt_att_resend.patch b/net-wireless/bluez/files/0001-Revert-attrib-Make-use-of-bt_att_resend.patch
deleted file mode 100644
index a8475b0c4273..000000000000
--- a/net-wireless/bluez/files/0001-Revert-attrib-Make-use-of-bt_att_resend.patch
+++ /dev/null
@@ -1,188 +0,0 @@
-From 697866e210e4e2dce14c95f7a7243e9b9128d01f Mon Sep 17 00:00:00 2001
-From: Adam Williamson <awilliam@redhat.com>
-Date: Sun, 7 Nov 2021 15:10:53 -0800
-Subject: [PATCH] Revert "attrib: Make use of bt_att_resend"
-
-This reverts commit ac2c2e10b3adb432a572b618c6f53cabb6b3c80b. It
-causes problems with Logitech MX wireless input devices (see
-https://github.com/bluez/bluez/issues/220 and
-https://bugzilla.redhat.com/show_bug.cgi?id=2019970 ).
----
- attrib/gattrib.c | 95 +++++++++++++++++++++++++++++++++++++-----------
- 1 file changed, 73 insertions(+), 22 deletions(-)
-
-diff --git a/attrib/gattrib.c b/attrib/gattrib.c
-index 270a37ebe..bc7d4f22c 100644
---- a/attrib/gattrib.c
-+++ b/attrib/gattrib.c
-@@ -41,8 +41,13 @@ struct _GAttrib {
- 	struct queue *track_ids;
- };
- 
-+struct id_pair {
-+	unsigned int org_id;
-+	unsigned int pend_id;
-+};
-+
- struct attrib_callbacks {
--	unsigned int id;
-+	struct id_pair *id;
- 	GAttribResultFunc result_func;
- 	GAttribNotifyFunc notify_func;
- 	GDestroyNotify destroy_func;
-@@ -51,6 +56,32 @@ struct attrib_callbacks {
- 	uint16_t notify_handle;
- };
- 
-+static bool find_with_org_id(const void *data, const void *user_data)
-+{
-+	const struct id_pair *p = data;
-+	unsigned int orig_id = PTR_TO_UINT(user_data);
-+
-+	return (p->org_id == orig_id);
-+}
-+
-+static struct id_pair *store_id(GAttrib *attrib, unsigned int org_id,
-+							unsigned int pend_id)
-+{
-+	struct id_pair *t;
-+
-+	t = new0(struct id_pair, 1);
-+	if (!t)
-+		return NULL;
-+
-+	t->org_id = org_id;
-+	t->pend_id = pend_id;
-+
-+	if (queue_push_tail(attrib->track_ids, t))
-+		return t;
-+
-+	return NULL;
-+}
-+
- GAttrib *g_attrib_new(GIOChannel *io, guint16 mtu, bool ext_signed)
- {
- 	gint fd;
-@@ -119,6 +150,9 @@ static void attrib_callbacks_destroy(void *data)
- 	if (cb->destroy_func)
- 		cb->destroy_func(cb->user_data);
- 
-+	if (queue_remove(cb->parent->track_ids, cb->id))
-+		free(cb->id);
-+
- 	free(data);
- }
- 
-@@ -148,7 +182,7 @@ void g_attrib_unref(GAttrib *attrib)
- 	bt_att_unref(attrib->att);
- 
- 	queue_destroy(attrib->callbacks, attrib_callbacks_destroy);
--	queue_destroy(attrib->track_ids, NULL);
-+	queue_destroy(attrib->track_ids, free);
- 
- 	free(attrib->buf);
- 
-@@ -261,6 +295,7 @@ guint g_attrib_send(GAttrib *attrib, guint id, const guint8 *pdu, guint16 len,
- 	struct attrib_callbacks *cb = NULL;
- 	bt_att_response_func_t response_cb = NULL;
- 	bt_att_destroy_func_t destroy_cb = NULL;
-+	unsigned int pend_id;
- 
- 	if (!attrib)
- 		return 0;
-@@ -282,47 +317,62 @@ guint g_attrib_send(GAttrib *attrib, guint id, const guint8 *pdu, guint16 len,
- 
- 	}
- 
--	if (id == 0)
--		id = bt_att_send(attrib->att, pdu[0], (void *) pdu + 1,
--					len - 1, response_cb, cb, destroy_cb);
--	else {
--		int err;
--
--		err = bt_att_resend(attrib->att, id, pdu[0], (void *) pdu + 1,
--					len - 1, response_cb, cb, destroy_cb);
--		if (err)
--			return 0;
--	}
-+	pend_id = bt_att_send(attrib->att, pdu[0], (void *) pdu + 1, len - 1,
-+						response_cb, cb, destroy_cb);
- 
--	if (!id)
--		return id;
-+	/*
-+	 * We store here pair as it is easier to handle it in response and in
-+	 * case where user request us to use specific id request - see below.
-+	 */
-+	if (id == 0)
-+		id = pend_id;
- 
- 	/*
- 	 * If user what us to use given id, lets keep track on that so we give
- 	 * user a possibility to cancel ongoing request.
- 	 */
--	if (cb) {
--		cb->id = id;
--		queue_push_tail(attrib->track_ids, UINT_TO_PTR(id));
--	}
-+	if (cb)
-+		cb->id = store_id(attrib, id, pend_id);
- 
- 	return id;
- }
- 
- gboolean g_attrib_cancel(GAttrib *attrib, guint id)
- {
-+	struct id_pair *p;
-+
- 	if (!attrib)
- 		return FALSE;
- 
-+	/*
-+	 * If request belongs to gattrib and is not yet done it has to be on
-+	 * the tracking id queue
-+	 *
-+	 * FIXME: It can happen that on the queue there is id_pair with
-+	 * given id which was provided by the user. In the same time it might
-+	 * happen that other attrib user got dynamic allocated req_id with same
-+	 * value as the one provided by the other user.
-+	 * In such case there are two clients having same request id and in
-+	 * this point of time we don't know which one calls cancel. For
-+	 * now we cancel request in which id was specified by the user.
-+	 */
-+	p = queue_remove_if(attrib->track_ids, find_with_org_id,
-+							UINT_TO_PTR(id));
-+	if (!p)
-+		return FALSE;
-+
-+	id = p->pend_id;
-+	free(p);
-+
- 	return bt_att_cancel(attrib->att, id);
- }
- 
- static void cancel_request(void *data, void *user_data)
- {
--	unsigned int id = PTR_TO_UINT(data);
-+	struct id_pair *p = data;
- 	GAttrib *attrib = user_data;
- 
--	bt_att_cancel(attrib->att, id);
-+	bt_att_cancel(attrib->att, p->pend_id);
- }
- 
- gboolean g_attrib_cancel_all(GAttrib *attrib)
-@@ -330,8 +380,9 @@ gboolean g_attrib_cancel_all(GAttrib *attrib)
- 	if (!attrib)
- 		return FALSE;
- 
-+	/* Cancel only request which belongs to gattrib */
- 	queue_foreach(attrib->track_ids, cancel_request, attrib);
--	queue_remove_all(attrib->track_ids, NULL, NULL, NULL);
-+	queue_remove_all(attrib->track_ids, NULL, NULL, free);
- 
- 	return TRUE;
- }
--- 
-2.33.1
-

diff --git a/net-wireless/bluez/files/0001-hog-Fix-read-order-of-attributes-rediffed.patch b/net-wireless/bluez/files/0001-hog-Fix-read-order-of-attributes-rediffed.patch
deleted file mode 100644
index cd6dc44b5d3e..000000000000
--- a/net-wireless/bluez/files/0001-hog-Fix-read-order-of-attributes-rediffed.patch
+++ /dev/null
@@ -1,542 +0,0 @@
-From 7fe38a17f6bee713fde587487fc224b0ae390e8f Mon Sep 17 00:00:00 2001
-From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
-Date: Mon, 10 Jan 2022 17:35:15 -0800
-Subject: [PATCH 1/2] hog: Fix read order of attributes
-
-The Report Map must be read after all other attributes otherwise the
-Kernel driver may start using UHID_SET_REPORT which requires the
-report->id to be known in order to resolve the attribute to send to.
-
-Fixes: https://github.com/bluez/bluez/issues/220
----
- profiles/input/hog-lib.c | 191 ++++++++++++++++++++++++---------------
- 1 file changed, 119 insertions(+), 72 deletions(-)
-
-diff --git a/profiles/input/hog-lib.c b/profiles/input/hog-lib.c
-index d37caa1f1..beb19af70 100644
---- a/profiles/input/hog-lib.c
-+++ b/profiles/input/hog-lib.c
-@@ -90,6 +90,7 @@ struct bt_hog {
- 	uint16_t		getrep_id;
- 	unsigned int		setrep_att;
- 	uint16_t		setrep_id;
-+	unsigned int		report_map_id;
- 	struct bt_scpp		*scpp;
- 	struct bt_dis		*dis;
- 	struct queue		*bas;
-@@ -146,13 +147,34 @@ static bool set_and_store_gatt_req(struct bt_hog *hog,
- 	return queue_push_head(hog->gatt_op, req);
- }
- 
--static void destroy_gatt_req(struct gatt_request *req)
-+static void destroy_gatt_req(void *data)
- {
--	queue_remove(req->hog->gatt_op, req);
-+	struct gatt_request *req = data;
-+
- 	bt_hog_unref(req->hog);
- 	free(req);
- }
- 
-+static void read_report_map(struct bt_hog *hog);
-+
-+static void remove_gatt_req(struct gatt_request *req, uint8_t status)
-+{
-+	struct bt_hog *hog = req->hog;
-+
-+	queue_remove(hog->gatt_op, req);
-+
-+	if (!status && queue_isempty(hog->gatt_op)) {
-+		/* Report Map must be read last since that can result
-+		 * in uhid being created and the driver may start to
-+		 * use UHID_SET_REPORT which requires the report->id to
-+		 * be known what attribute to send to.
-+		 */
-+		read_report_map(hog);
-+	}
-+
-+	destroy_gatt_req(req);
-+}
-+
- static void write_char(struct bt_hog *hog, GAttrib *attrib, uint16_t handle,
- 					const uint8_t *value, size_t vlen,
- 					GAttribResultFunc func,
-@@ -178,27 +200,31 @@ static void write_char(struct bt_hog *hog, GAttrib *attrib, uint16_t handle,
- 	}
- }
- 
--static void read_char(struct bt_hog *hog, GAttrib *attrib, uint16_t handle,
--				GAttribResultFunc func, gpointer user_data)
-+static unsigned int read_char(struct bt_hog *hog, GAttrib *attrib,
-+				uint16_t handle, GAttribResultFunc func,
-+				gpointer user_data)
- {
- 	struct gatt_request *req;
- 	unsigned int id;
- 
- 	req = create_request(hog, user_data);
- 	if (!req)
--		return;
-+		return 0;
- 
- 	id = gatt_read_char(attrib, handle, func, req);
- 	if (!id) {
- 		error("hog: Could not read char");
--		return;
-+		return 0;
- 	}
- 
- 	if (!set_and_store_gatt_req(hog, req, id)) {
- 		error("hog: Failed to queue read char req");
- 		g_attrib_cancel(attrib, id);
- 		free(req);
-+		return 0;
- 	}
-+
-+	return id;
- }
- 
- static void discover_desc(struct bt_hog *hog, GAttrib *attrib,
-@@ -343,16 +369,14 @@ static void report_ccc_written_cb(guint8 status, const guint8 *pdu,
- 	struct report *report = req->user_data;
- 	struct bt_hog *hog = report->hog;
- 
--	destroy_gatt_req(req);
--
- 	if (status != 0) {
- 		error("Write report characteristic descriptor failed: %s",
- 							att_ecode2str(status));
--		return;
-+		goto remove;
- 	}
- 
- 	if (report->notifyid)
--		return;
-+		goto remove;
- 
- 	report->notifyid = g_attrib_register(hog->attrib,
- 					ATT_OP_HANDLE_NOTIFY,
-@@ -360,6 +384,9 @@ static void report_ccc_written_cb(guint8 status, const guint8 *pdu,
- 					report_value_cb, report, NULL);
- 
- 	DBG("Report characteristic descriptor written: notifications enabled");
-+
-+remove:
-+	remove_gatt_req(req, status);
- }
- 
- static void write_ccc(struct bt_hog *hog, GAttrib *attrib, uint16_t handle,
-@@ -379,14 +406,15 @@ static void ccc_read_cb(guint8 status, const guint8 *pdu, guint16 len,
- 	struct gatt_request *req = user_data;
- 	struct report *report = req->user_data;
- 
--	destroy_gatt_req(req);
--
- 	if (status != 0) {
- 		error("Error reading CCC value: %s", att_ecode2str(status));
--		return;
-+		goto remove;
- 	}
- 
- 	write_ccc(report->hog, report->hog->attrib, report->ccc_handle, report);
-+
-+remove:
-+	remove_gatt_req(req, status);
- }
- 
- static const char *type_to_string(uint8_t type)
-@@ -409,17 +437,15 @@ static void report_reference_cb(guint8 status, const guint8 *pdu,
- 	struct gatt_request *req = user_data;
- 	struct report *report = req->user_data;
- 
--	destroy_gatt_req(req);
--
- 	if (status != 0) {
- 		error("Read Report Reference descriptor failed: %s",
- 							att_ecode2str(status));
--		return;
-+		goto remove;
- 	}
- 
- 	if (plen != 3) {
- 		error("Malformed ATT read response");
--		return;
-+		goto remove;
- 	}
- 
- 	report->id = pdu[1];
-@@ -432,6 +458,9 @@ static void report_reference_cb(guint8 status, const guint8 *pdu,
- 	if (report->type == HOG_REPORT_TYPE_INPUT)
- 		read_char(report->hog, report->hog->attrib, report->ccc_handle,
- 							ccc_read_cb, report);
-+
-+remove:
-+	remove_gatt_req(req, status);
- }
- 
- static void external_report_reference_cb(guint8 status, const guint8 *pdu,
-@@ -442,12 +471,10 @@ static void discover_external_cb(uint8_t status, GSList *descs, void *user_data)
- 	struct gatt_request *req = user_data;
- 	struct bt_hog *hog = req->user_data;
- 
--	destroy_gatt_req(req);
--
- 	if (status != 0) {
- 		error("Discover external descriptors failed: %s",
- 							att_ecode2str(status));
--		return;
-+		goto remove;
- 	}
- 
- 	for ( ; descs; descs = descs->next) {
-@@ -457,6 +484,9 @@ static void discover_external_cb(uint8_t status, GSList *descs, void *user_data)
- 						external_report_reference_cb,
- 						hog);
- 	}
-+
-+remove:
-+	remove_gatt_req(req, status);
- }
- 
- static void discover_external(struct bt_hog *hog, GAttrib *attrib,
-@@ -480,12 +510,10 @@ static void discover_report_cb(uint8_t status, GSList *descs, void *user_data)
- 	struct report *report = req->user_data;
- 	struct bt_hog *hog = report->hog;
- 
--	destroy_gatt_req(req);
--
- 	if (status != 0) {
- 		error("Discover report descriptors failed: %s",
- 							att_ecode2str(status));
--		return;
-+		goto remove;
- 	}
- 
- 	for ( ; descs; descs = descs->next) {
-@@ -501,6 +529,9 @@ static void discover_report_cb(uint8_t status, GSList *descs, void *user_data)
- 			break;
- 		}
- 	}
-+
-+remove:
-+	remove_gatt_req(req, status);
- }
- 
- static void discover_report(struct bt_hog *hog, GAttrib *attrib,
-@@ -519,11 +550,9 @@ static void report_read_cb(guint8 status, const guint8 *pdu, guint16 len,
- 	struct gatt_request *req = user_data;
- 	struct report *report = req->user_data;
- 
--	destroy_gatt_req(req);
--
- 	if (status != 0) {
- 		error("Error reading Report value: %s", att_ecode2str(status));
--		return;
-+		goto remove;
- 	}
- 
- 	if (report->value)
-@@ -531,6 +560,9 @@ static void report_read_cb(guint8 status, const guint8 *pdu, guint16 len,
- 
- 	report->value = g_memdup2(pdu, len);
- 	report->len = len;
-+
-+remove:
-+	remove_gatt_req(req, status);
- }
- 
- static int report_chrc_cmp(const void *data, const void *user_data)
-@@ -572,12 +604,11 @@ static void external_service_char_cb(uint8_t status, GSList *chars,
- 	struct report *report;
- 	GSList *l;
- 
--	destroy_gatt_req(req);
--
- 	if (status != 0) {
- 		const char *str = att_ecode2str(status);
-+
- 		DBG("Discover external service characteristic failed: %s", str);
--		return;
-+		goto remove;
- 	}
- 
- 	for (l = chars; l; l = g_slist_next(l)) {
-@@ -595,6 +626,9 @@ static void external_service_char_cb(uint8_t status, GSList *chars,
- 		end = (next ? next->handle - 1 : primary->range.end);
- 		discover_report(hog, hog->attrib, start, end, report);
- 	}
-+
-+remove:
-+	remove_gatt_req(req, status);
- }
- 
- static void external_report_reference_cb(guint8 status, const guint8 *pdu,
-@@ -605,17 +639,15 @@ static void external_report_reference_cb(guint8 status, const guint8 *pdu,
- 	uint16_t uuid16;
- 	bt_uuid_t uuid;
- 
--	destroy_gatt_req(req);
--
- 	if (status != 0) {
- 		error("Read External Report Reference descriptor failed: %s",
- 							att_ecode2str(status));
--		return;
-+		goto remove;
- 	}
- 
- 	if (plen != 3) {
- 		error("Malformed ATT read response");
--		return;
-+		goto remove;
- 	}
- 
- 	uuid16 = get_le16(&pdu[1]);
-@@ -624,11 +656,14 @@ static void external_report_reference_cb(guint8 status, const guint8 *pdu,
- 
- 	/* Do not discover if is not a Report */
- 	if (uuid16 != HOG_REPORT_UUID)
--		return;
-+		goto remove;
- 
- 	bt_uuid16_create(&uuid, uuid16);
- 	discover_char(hog, hog->attrib, 0x0001, 0xffff, &uuid,
- 					external_service_char_cb, hog);
-+
-+remove:
-+	remove_gatt_req(req, status);
- }
- 
- static int report_cmp(gconstpointer a, gconstpointer b)
-@@ -687,12 +722,10 @@ static void output_written_cb(guint8 status, const guint8 *pdu,
- {
- 	struct gatt_request *req = user_data;
- 
--	destroy_gatt_req(req);
--
--	if (status != 0) {
-+	if (status != 0)
- 		error("Write output report failed: %s", att_ecode2str(status));
--		return;
--	}
-+
-+	remove_gatt_req(req, status);
- }
- 
- static void forward_report(struct uhid_event *ev, void *user_data)
-@@ -1056,7 +1089,7 @@ static void report_map_read_cb(guint8 status, const guint8 *pdu, guint16 plen,
- 	uint8_t value[HOG_REPORT_MAP_MAX_SIZE];
- 	ssize_t vlen;
- 
--	destroy_gatt_req(req);
-+	remove_gatt_req(req, status);
- 
- 	DBG("HoG inspecting report map");
- 
-@@ -1081,6 +1114,19 @@ static void report_map_read_cb(guint8 status, const guint8 *pdu, guint16 plen,
- 	}
- }
- 
-+static void read_report_map(struct bt_hog *hog)
-+{
-+	uint16_t handle;
-+
-+	if (!hog->report_map_attr || hog->uhid_created || hog->report_map_id)
-+		return;
-+
-+	handle = gatt_db_attribute_get_handle(hog->report_map_attr);
-+
-+	hog->report_map_id = read_char(hog, hog->attrib, handle,
-+						report_map_read_cb, hog);
-+}
-+
- static void info_read_cb(guint8 status, const guint8 *pdu, guint16 plen,
- 							gpointer user_data)
- {
-@@ -1089,18 +1135,16 @@ static void info_read_cb(guint8 status, const guint8 *pdu, guint16 plen,
- 	uint8_t value[HID_INFO_SIZE];
- 	ssize_t vlen;
- 
--	destroy_gatt_req(req);
--
- 	if (status != 0) {
- 		error("HID Information read failed: %s",
- 						att_ecode2str(status));
--		return;
-+		goto remove;
- 	}
- 
- 	vlen = dec_read_resp(pdu, plen, value, sizeof(value));
- 	if (vlen != 4) {
- 		error("ATT protocol error");
--		return;
-+		goto remove;
- 	}
- 
- 	hog->bcdhid = get_le16(&value[0]);
-@@ -1109,6 +1153,9 @@ static void info_read_cb(guint8 status, const guint8 *pdu, guint16 plen,
- 
- 	DBG("bcdHID: 0x%04X bCountryCode: 0x%02X Flags: 0x%02X",
- 			hog->bcdhid, hog->bcountrycode, hog->flags);
-+
-+remove:
-+	remove_gatt_req(req, status);
- }
- 
- static void proto_mode_read_cb(guint8 status, const guint8 *pdu, guint16 plen,
-@@ -1119,18 +1166,16 @@ static void proto_mode_read_cb(guint8 status, const guint8 *pdu, guint16 plen,
- 	uint8_t value;
- 	ssize_t vlen;
- 
--	destroy_gatt_req(req);
--
- 	if (status != 0) {
- 		error("Protocol Mode characteristic read failed: %s",
- 							att_ecode2str(status));
--		return;
-+		goto remove;
- 	}
- 
- 	vlen = dec_read_resp(pdu, plen, &value, sizeof(value));
- 	if (vlen < 0) {
- 		error("ATT protocol error");
--		return;
-+		goto remove;
- 	}
- 
- 	if (value == HOG_PROTO_MODE_BOOT) {
-@@ -1142,6 +1187,9 @@ static void proto_mode_read_cb(guint8 status, const guint8 *pdu, guint16 plen,
- 						sizeof(nval), NULL, NULL);
- 	} else if (value == HOG_PROTO_MODE_REPORT)
- 		DBG("HoG is operating in Report Protocol Mode");
-+
-+remove:
-+	remove_gatt_req(req, status);
- }
- 
- static void char_discovered_cb(uint8_t status, GSList *chars, void *user_data)
-@@ -1155,14 +1203,12 @@ static void char_discovered_cb(uint8_t status, GSList *chars, void *user_data)
- 	GSList *l;
- 	uint16_t info_handle = 0, proto_mode_handle = 0;
- 
--	destroy_gatt_req(req);
--
- 	DBG("HoG inspecting characteristics");
- 
- 	if (status != 0) {
--		const char *str = att_ecode2str(status);
--		DBG("Discover all characteristics failed: %s", str);
--		return;
-+		DBG("Discover all characteristics failed: %s",
-+					att_ecode2str(status));
-+		goto remove;
- 	}
- 
- 	bt_uuid16_create(&report_uuid, HOG_REPORT_UUID);
-@@ -1211,6 +1257,9 @@ static void char_discovered_cb(uint8_t status, GSList *chars, void *user_data)
- 
- 	if (info_handle)
- 		read_char(hog, hog->attrib, info_handle, info_read_cb, hog);
-+
-+remove:
-+	remove_gatt_req(req, status);
- }
- 
- static void report_free(void *data)
-@@ -1221,10 +1270,12 @@ static void report_free(void *data)
- 	g_free(report);
- }
- 
--static void cancel_gatt_req(struct gatt_request *req)
-+static bool cancel_gatt_req(const void *data, const void *user_data)
- {
--	if (g_attrib_cancel(req->hog->attrib, req->id))
--		destroy_gatt_req(req);
-+	struct gatt_request *req = (void *) data;
-+	const struct bt_hog *hog = user_data;
-+
-+	return g_attrib_cancel(hog->attrib, req->id);
- }
- 
- static void hog_free(void *data)
-@@ -1386,13 +1437,9 @@ static void foreach_hog_chrc(struct gatt_db_attribute *attr, void *user_data)
- 			 * UHID to optimize reconnection.
- 			 */
- 			uhid_create(hog, report_map.value, report_map.length);
--		} else {
--			read_char(hog, hog->attrib, value_handle,
--						report_map_read_cb, hog);
- 		}
- 
- 		gatt_db_service_foreach_desc(attr, foreach_hog_external, hog);
--		return;
- 	}
- 
- 	bt_uuid16_create(&info_uuid, HOG_INFO_UUID);
-@@ -1552,12 +1599,9 @@ static void find_included_cb(uint8_t status, GSList *services, void *user_data)
- 
- 	DBG("");
- 
--	destroy_gatt_req(req);
--
- 	if (status) {
--		const char *str = att_ecode2str(status);
--		DBG("Find included failed: %s", str);
--		return;
-+		DBG("Find included failed: %s", att_ecode2str(status));
-+		goto remove;
- 	}
- 
- 	for (l = services; l; l = l->next) {
-@@ -1566,6 +1610,9 @@ static void find_included_cb(uint8_t status, GSList *services, void *user_data)
- 		DBG("included: handle %x, uuid %s",
- 			include->handle, include->uuid);
- 	}
-+
-+remove:
-+	remove_gatt_req(req, status);
- }
- 
- static void hog_attach_scpp(struct bt_hog *hog, struct gatt_primary *primary)
-@@ -1640,17 +1687,14 @@ static void primary_cb(uint8_t status, GSList *services, void *user_data)
- 
- 	DBG("");
- 
--	destroy_gatt_req(req);
--
- 	if (status) {
--		const char *str = att_ecode2str(status);
--		DBG("Discover primary failed: %s", str);
--		return;
-+		DBG("Discover primary failed: %s", att_ecode2str(status));
-+		goto remove;
- 	}
- 
- 	if (!services) {
- 		DBG("No primary service found");
--		return;
-+		goto remove;
- 	}
- 
- 	for (l = services; l; l = l->next) {
-@@ -1674,6 +1718,9 @@ static void primary_cb(uint8_t status, GSList *services, void *user_data)
- 		if (strcmp(primary->uuid, HOG_UUID) == 0)
- 			hog_attach_hog(hog, primary);
- 	}
-+
-+remove:
-+	remove_gatt_req(req, status);
- }
- 
- bool bt_hog_attach(struct bt_hog *hog, void *gatt)
-@@ -1790,7 +1837,7 @@ void bt_hog_detach(struct bt_hog *hog)
- 	if (hog->dis)
- 		bt_dis_detach(hog->dis);
- 
--	queue_foreach(hog->gatt_op, (void *) cancel_gatt_req, NULL);
-+	queue_remove_all(hog->gatt_op, cancel_gatt_req, hog, destroy_gatt_req);
- 	g_attrib_unref(hog->attrib);
- 	hog->attrib = NULL;
- 	uhid_destroy(hog);
--- 
-2.34.1
-

diff --git a/net-wireless/bluez/files/0002-hog-Add-input-queue-while-uhid-device-has-not-been-c-rediffed.patch b/net-wireless/bluez/files/0002-hog-Add-input-queue-while-uhid-device-has-not-been-c-rediffed.patch
deleted file mode 100644
index f39775785f4a..000000000000
--- a/net-wireless/bluez/files/0002-hog-Add-input-queue-while-uhid-device-has-not-been-c-rediffed.patch
+++ /dev/null
@@ -1,90 +0,0 @@
-From 33d13bbc5703185ab3f15e4429df324987f3f225 Mon Sep 17 00:00:00 2001
-From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
-Date: Wed, 12 Jan 2022 14:07:36 -0800
-Subject: [PATCH 2/2] hog: Add input queue while uhid device has not been
- created
-
-Since report map is only read after all reports it is possible to start
-receiving notifications before uhid has been created, so this adds a
-queue to store the events while the report map is pending and once uhid
-has been created dequeue the events.
----
- profiles/input/hog-lib.c | 32 +++++++++++++++++++++++++++++---
- 1 file changed, 29 insertions(+), 3 deletions(-)
-
-diff --git a/profiles/input/hog-lib.c b/profiles/input/hog-lib.c
-index beb19af70..0b375feb8 100644
---- a/profiles/input/hog-lib.c
-+++ b/profiles/input/hog-lib.c
-@@ -98,6 +98,7 @@ struct bt_hog {
- 	struct queue		*gatt_op;
- 	struct gatt_db		*gatt_db;
- 	struct gatt_db_attribute	*report_map_attr;
-+	struct queue		*input;
- };
- 
- struct report_map {
-@@ -355,11 +356,18 @@ static void report_value_cb(const guint8 *pdu, guint16 len, gpointer user_data)
- 		ev.u.input.size = len;
- 	}
- 
--	err = bt_uhid_send(hog->uhid, &ev);
--	if (err < 0) {
--		error("bt_uhid_send: %s (%d)", strerror(-err), -err);
-+	/* If uhid had not been created yet queue up the input */
-+	if (!hog->uhid_created) {
-+		if (!hog->input)
-+			hog->input = queue_new();
-+
-+		queue_push_tail(hog->input, g_memdup(&ev, sizeof(ev)));
- 		return;
- 	}
-+
-+	err = bt_uhid_send(hog->uhid, &ev);
-+	if (err < 0)
-+		error("bt_uhid_send: %s (%d)", strerror(-err), -err);
- }
- 
- static void report_ccc_written_cb(guint8 status, const guint8 *pdu,
-@@ -993,6 +1001,21 @@ static char *item2string(char *str, uint8_t *buf, uint8_t len)
- 	return str;
- }
- 
-+static bool input_dequeue(const void *data, const void *match_data)
-+{
-+	const struct uhid_event *ev = data;
-+	const struct bt_hog *hog = match_data;
-+	int err;
-+
-+	err = bt_uhid_send(hog->uhid, ev);
-+	if (err < 0) {
-+		error("bt_uhid_send: %s (%d)", strerror(-err), -err);
-+		return false;
-+	}
-+
-+	return true;
-+}
-+
- static void uhid_create(struct bt_hog *hog, uint8_t *report_map,
- 							ssize_t report_map_len)
- {
-@@ -1072,6 +1095,8 @@ static void uhid_create(struct bt_hog *hog, uint8_t *report_map,
- 	hog->uhid_created = true;
- 
- 	DBG("HoG created uHID device");
-+
-+	queue_remove_all(hog->input, input_dequeue, hog, free);
- }
- 
- static void db_report_map_write_value_cb(struct gatt_db_attribute *attr,
-@@ -1284,6 +1309,7 @@ static void hog_free(void *data)
- 
- 	bt_hog_detach(hog);
- 
-+	queue_destroy(hog->input, free);
- 	queue_destroy(hog->bas, (void *) bt_bas_unref);
- 	g_slist_free_full(hog->instances, hog_free);
- 
--- 
-2.34.1
-

diff --git a/net-wireless/bluez/files/bluez-5.62-fix-disconnecting.patch b/net-wireless/bluez/files/bluez-5.62-fix-disconnecting.patch
deleted file mode 100644
index 8eff9dc006dd..000000000000
--- a/net-wireless/bluez/files/bluez-5.62-fix-disconnecting.patch
+++ /dev/null
@@ -1,54 +0,0 @@
-From ebf2d7935690c00c7fd12768177e2023fc63c9fe Mon Sep 17 00:00:00 2001
-From: Javier de San Pedro <dev.git@javispedro.com>
-Date: Sat, 27 Nov 2021 23:21:36 +0100
-Subject: gatt-client: Fix disconnecting due to GattCharacteristic1.MTU
-
-After the MTU dbus property patches in 5.62 we are seeing bluetoothd
-terminate frequently with "Disconnected from D-Bus. Exiting." msgs.
-Apparently this is because bluetoothd sent an invalid reply to a D-Bus
-Property Get (for GattCharacteristic1's MTU).
-Multiple issues in bluez Github.com project reported similar behavior;
-at least #235 (see Fixes:), #219, and likely #238.
-
-When the Characteristic1 object is still cached/alive, but the
-underlying att connection is not (e.g. someone just called Disconnect),
-the property getter (characteristic_get_mtu) right now returns false.
-However, gdbus seems to ignore the return value and sends the empty reply
-message anyway (rather than a dbus error?), and this seems to cause
-the dbus connection to be terminated (due to the ill-formed reply?).
-bluetoothd then aborts.
-
-This patch makes the property value BT_ATT_DEFAULT_LE_MTU if the
-underlying att object does not exist, rather than returning an invalid
-message. This is consistent with the existing PropertyChanged signal
-behavior (we will emit a PropertyChange only if a larger MTU is
-exchanged), and fixes the issue on my machines.
-An alternative could be to change gdbus behavior, but I'm not sure if we
-are allowed to return an error here anyway without causing problems in
-other dbus libraries/wrappers.
-
-Fixes: aaa0c4996ae9 ("gatt: Add implementation of GattCharacteristic1.MTU")
-Fixes: https://github.com/bluez/bluez/issues/235
----
- src/gatt-client.c | 5 +----
- 1 file changed, 1 insertion(+), 4 deletions(-)
-
-diff --git a/src/gatt-client.c b/src/gatt-client.c
-index de18bea97..6ee984db9 100644
---- a/src/gatt-client.c
-+++ b/src/gatt-client.c
-@@ -883,10 +883,7 @@ static gboolean characteristic_get_mtu(const GDBusPropertyTable *property,
- 	uint16_t mtu;
- 
- 	att = bt_gatt_client_get_att(gatt);
--	if (!att)
--		return FALSE;
--
--	mtu = bt_att_get_mtu(att);
-+	mtu = att ? bt_att_get_mtu(att) : BT_ATT_DEFAULT_LE_MTU;
- 
- 	dbus_message_iter_append_basic(iter, DBUS_TYPE_UINT16, &mtu);
- 
--- 
-cgit 1.2.3-1.el7
-


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-wireless/bluez/, net-wireless/bluez/files/
@ 2022-09-11  7:50 Pacho Ramos
  0 siblings, 0 replies; 22+ messages in thread
From: Pacho Ramos @ 2022-09-11  7:50 UTC (permalink / raw
  To: gentoo-commits

commit:     6f545f9a5af1f3248db75d4853390eca6536d215
Author:     Pacho Ramos <pacho <AT> gentoo <DOT> org>
AuthorDate: Sun Sep 11 07:49:25 2022 +0000
Commit:     Pacho Ramos <pacho <AT> gentoo <DOT> org>
CommitDate: Sun Sep 11 07:50:30 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6f545f9a

net-wireless/bluez: Move big patch to dev space

Signed-off-by: Pacho Ramos <pacho <AT> gentoo.org>

 net-wireless/bluez/Manifest                        |   1 +
 net-wireless/bluez/bluez-5.65.ebuild               |   5 +-
 .../bluez/files/power-state-adapter-property.patch | 723 ---------------------
 3 files changed, 4 insertions(+), 725 deletions(-)

diff --git a/net-wireless/bluez/Manifest b/net-wireless/bluez/Manifest
index 1bf6ed310204..710de1c38b68 100644
--- a/net-wireless/bluez/Manifest
+++ b/net-wireless/bluez/Manifest
@@ -1,2 +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 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.ebuild
index 74ffae23b148..844d8a05a66a 100644
--- a/net-wireless/bluez/bluez-5.65.ebuild
+++ b/net-wireless/bluez/bluez-5.65.ebuild
@@ -8,7 +8,8 @@ inherit autotools linux-info python-single-r1 readme.gentoo-r1 systemd udev mult
 
 DESCRIPTION="Bluetooth Tools and System Daemons for Linux"
 HOMEPAGE="http://www.bluez.org"
-SRC_URI="https://www.kernel.org/pub/linux/bluetooth/${P}.tar.xz"
+SRC_URI="https://www.kernel.org/pub/linux/bluetooth/${P}.tar.xz
+	https://dev.gentoo.org/~pacho/${PN}/power-state-adapter-property.patch"
 
 LICENSE="GPL-2+ LGPL-2.1+"
 SLOT="0/3"
@@ -73,7 +74,7 @@ PATCHES=(
 
 	# Fixed in next release
 	"${FILESDIR}"/0001-adapter-Reset-pending-settings-when-receiving-MGMT-e.patch
-	"${FILESDIR}"/power-state-adapter-property.patch
+	"${DISTDIR}"/power-state-adapter-property.patch
 )
 
 pkg_setup() {

diff --git a/net-wireless/bluez/files/power-state-adapter-property.patch b/net-wireless/bluez/files/power-state-adapter-property.patch
deleted file mode 100644
index 1d6f2cd0ae7f..000000000000
--- a/net-wireless/bluez/files/power-state-adapter-property.patch
+++ /dev/null
@@ -1,723 +0,0 @@
-From a282944af40893fc79f0ae3aa1bf52031aa07ffe Mon Sep 17 00:00:00 2001
-From: Bastien Nocera <hadess@hadess.net>
-Date: Wed, 31 Aug 2022 10:56:06 +0200
-Subject: [PATCH 1/6] adapter: Keep track of whether the adapter is rfkill'ed
-
-Instead of only replying to D-Bus requests with an error saying the
-adapter is blocked, keep track of the rfkill being enabled or disabled
-so we know the rfkill state of the adapter at all times.
----
- src/adapter.c | 25 +++++++++++++--
- src/adapter.h |  1 +
- src/btd.h     |  1 +
- src/rfkill.c  | 89 ++++++++++++++++++++++++++++++++++++++-------------
- 4 files changed, 91 insertions(+), 25 deletions(-)
-
-diff --git a/src/adapter.c b/src/adapter.c
-index 51b099dae..7c11a688d 100644
---- a/src/adapter.c
-+++ b/src/adapter.c
-@@ -250,6 +250,7 @@ struct btd_adapter {
- 	uint32_t dev_class;		/* controller class of device */
- 	char *name;			/* controller device name */
- 	char *short_name;		/* controller short name */
-+	bool blocked;			/* whether rfkill is enabled */
- 	uint32_t supported_settings;	/* controller supported settings */
- 	uint32_t pending_settings;	/* pending controller settings */
- 	uint32_t current_settings;	/* current controller settings */
-@@ -654,6 +655,8 @@ static void set_mode_complete(uint8_t status, uint16_t length,
- 	if (status != MGMT_STATUS_SUCCESS) {
- 		btd_error(adapter->dev_id, "Failed to set mode: %s (0x%02x)",
- 						mgmt_errstr(status), status);
-+		if (status == MGMT_STATUS_RFKILLED)
-+			adapter->blocked = true;
- 		adapter->pending_settings &= ~data->setting;
- 		return;
- 	}
-@@ -2947,10 +2950,12 @@ static void property_set_mode_complete(uint8_t status, uint16_t length,
- 		btd_error(adapter->dev_id, "Failed to set mode: %s (0x%02x)",
- 						mgmt_errstr(status), status);
- 
--		if (status == MGMT_STATUS_RFKILLED)
-+		if (status == MGMT_STATUS_RFKILLED) {
- 			dbus_err = ERROR_INTERFACE ".Blocked";
--		else
-+			adapter->blocked = true;
-+		} else {
- 			dbus_err = ERROR_INTERFACE ".Failed";
-+		}
- 
- 		g_dbus_pending_property_error(data->id, dbus_err,
- 							mgmt_errstr(status));
-@@ -6681,6 +6686,7 @@ static void load_config(struct btd_adapter *adapter)
- static struct btd_adapter *btd_adapter_new(uint16_t index)
- {
- 	struct btd_adapter *adapter;
-+	int blocked;
- 
- 	adapter = g_try_new0(struct btd_adapter, 1);
- 	if (!adapter)
-@@ -6689,6 +6695,9 @@ static struct btd_adapter *btd_adapter_new(uint16_t index)
- 	adapter->dev_id = index;
- 	adapter->mgmt = mgmt_ref(mgmt_primary);
- 	adapter->pincode_requested = false;
-+	blocked = rfkill_get_blocked(index);
-+	if (blocked > 0)
-+		adapter->blocked = true;
- 
- 	/*
- 	 * Setup default configuration values. These are either adapter
-@@ -6714,6 +6723,8 @@ static struct btd_adapter *btd_adapter_new(uint16_t index)
- 	DBG("Modalias: %s", adapter->modalias);
- 	DBG("Discoverable timeout: %u seconds", adapter->discoverable_timeout);
- 	DBG("Pairable timeout: %u seconds", adapter->pairable_timeout);
-+	if (blocked > 0)
-+		DBG("Blocked: yes");
- 
- 	adapter->auths = g_queue_new();
- 	adapter->exps = queue_new();
-@@ -7581,6 +7592,9 @@ int btd_cancel_authorization(guint id)
- 
- int btd_adapter_restore_powered(struct btd_adapter *adapter)
- {
-+	if (adapter->blocked)
-+		adapter->blocked = false;
-+
- 	if (btd_adapter_get_powered(adapter))
- 		return 0;
- 
-@@ -7589,6 +7603,13 @@ int btd_adapter_restore_powered(struct btd_adapter *adapter)
- 	return 0;
- }
- 
-+int btd_adapter_set_blocked(struct btd_adapter *adapter)
-+{
-+	if (!adapter->blocked)
-+		adapter->blocked = true;
-+	return 0;
-+}
-+
- void btd_adapter_register_pin_cb(struct btd_adapter *adapter,
- 							btd_adapter_pin_cb_t cb)
- {
-diff --git a/src/adapter.h b/src/adapter.h
-index f38f473b7..78eb069ae 100644
---- a/src/adapter.h
-+++ b/src/adapter.h
-@@ -144,6 +144,7 @@ guint btd_request_authorization_cable_configured(const bdaddr_t *src, const bdad
- int btd_cancel_authorization(guint id);
- 
- int btd_adapter_restore_powered(struct btd_adapter *adapter);
-+int btd_adapter_set_blocked(struct btd_adapter *adapter);
- 
- typedef ssize_t (*btd_adapter_pin_cb_t) (struct btd_adapter *adapter,
- 			struct btd_device *dev, char *out, bool *display,
-diff --git a/src/btd.h b/src/btd.h
-index c02b2691e..63be6d8d4 100644
---- a/src/btd.h
-+++ b/src/btd.h
-@@ -144,6 +144,7 @@ void plugin_cleanup(void);
- 
- void rfkill_init(void);
- void rfkill_exit(void);
-+int rfkill_get_blocked(uint16_t index);
- 
- GKeyFile *btd_get_main_conf(void);
- bool btd_kernel_experimental_enabled(const char *uuid);
-diff --git a/src/rfkill.c b/src/rfkill.c
-index 2099c5ac5..a0a50d9e4 100644
---- a/src/rfkill.c
-+++ b/src/rfkill.c
-@@ -55,12 +55,71 @@ struct rfkill_event {
- };
- #define RFKILL_EVENT_SIZE_V1    8
- 
-+static int get_adapter_id_for_rfkill(int rfkill_id)
-+{
-+	char sysname[PATH_MAX];
-+	int namefd;
-+
-+	snprintf(sysname, sizeof(sysname) - 1,
-+			"/sys/class/rfkill/rfkill%u/name", rfkill_id);
-+
-+	namefd = open(sysname, O_RDONLY);
-+	if (namefd < 0)
-+		return -1;
-+
-+	memset(sysname, 0, sizeof(sysname));
-+
-+	if (read(namefd, sysname, sizeof(sysname) - 1) < 4) {
-+		close(namefd);
-+		return -1;
-+	}
-+
-+	close(namefd);
-+
-+	if (g_str_has_prefix(sysname, "hci") == FALSE)
-+		return -1;
-+
-+	return atoi(sysname + 3);
-+}
-+
-+int rfkill_get_blocked(uint16_t index)
-+{
-+	int fd;
-+	int blocked = -1;
-+
-+	fd = open("/dev/rfkill", O_RDWR);
-+	if (fd < 0) {
-+		DBG("Failed to open RFKILL control device");
-+		return -1;
-+	}
-+
-+	while (1) {
-+		struct rfkill_event event = { 0 };
-+		int id;
-+		ssize_t len;
-+
-+		len = read(fd, &event, sizeof(event));
-+		if (len < RFKILL_EVENT_SIZE_V1)
-+			break;
-+
-+		id = get_adapter_id_for_rfkill(event.idx);
-+
-+		if (index == id) {
-+			blocked = event.soft || event.hard;
-+			break;
-+		}
-+	}
-+	close(fd);
-+
-+	return blocked;
-+}
-+
- static gboolean rfkill_event(GIOChannel *chan,
- 				GIOCondition cond, gpointer data)
- {
- 	struct rfkill_event event = { 0 };
- 	struct btd_adapter *adapter;
--	char sysname[PATH_MAX];
-+	bool blocked = false;
- 	ssize_t len;
- 	int fd, id;
- 
-@@ -84,7 +143,7 @@ static gboolean rfkill_event(GIOChannel *chan,
- 						event.soft, event.hard);
- 
- 	if (event.soft || event.hard)
--		return TRUE;
-+		blocked = true;
- 
- 	if (event.op != RFKILL_OP_CHANGE)
- 		return TRUE;
-@@ -93,26 +152,7 @@ static gboolean rfkill_event(GIOChannel *chan,
- 					event.type != RFKILL_TYPE_ALL)
- 		return TRUE;
- 
--	snprintf(sysname, sizeof(sysname) - 1,
--			"/sys/class/rfkill/rfkill%u/name", event.idx);
--
--	fd = open(sysname, O_RDONLY);
--	if (fd < 0)
--		return TRUE;
--
--	memset(sysname, 0, sizeof(sysname));
--
--	if (read(fd, sysname, sizeof(sysname) - 1) < 4) {
--		close(fd);
--		return TRUE;
--	}
--
--	close(fd);
--
--	if (g_str_has_prefix(sysname, "hci") == FALSE)
--		return TRUE;
--
--	id = atoi(sysname + 3);
-+	id = get_adapter_id_for_rfkill(event.idx);
- 	if (id < 0)
- 		return TRUE;
- 
-@@ -122,7 +162,10 @@ static gboolean rfkill_event(GIOChannel *chan,
- 
- 	DBG("RFKILL unblock for hci%d", id);
- 
--	btd_adapter_restore_powered(adapter);
-+	if (blocked)
-+		btd_adapter_set_blocked(adapter);
-+	else
-+		btd_adapter_restore_powered(adapter);
- 
- 	return TRUE;
- }
--- 
-2.37.2
-
-
-From 7711e4081bf6096f2210f5b5d715f005d654abf1 Mon Sep 17 00:00:00 2001
-From: Bastien Nocera <hadess@hadess.net>
-Date: Wed, 31 Aug 2022 13:23:23 +0200
-Subject: [PATCH 2/6] adapter: Implement PowerState property
-
-This property should allow any program to show whether an adapter is in
-the process of being turned on.
-
-As turning on an adapter isn't instantaneous, it's important that the UI
-reflects the transitional state of the adapter's power, and doesn't
-assume the device is already turned on but not yet working, or still off
-despite having requested for it to be turned on, in both cases making
-the UI feel unresponsive.
-
-This can also not be implemented in front-ends directly as, then,
-the status of an adapter wouldn't be reflected correctly in the Settings
-window if it's turned on in the system menu. Implementing it in the
-front-ends would also preclude from having feedback about the state of
-the adapter when bluetoothd is the one powering up the adapter after the
-rfkill was unblocked.
-
-See https://gitlab.gnome.org/GNOME/gnome-bluetooth/-/issues/121
-and the original https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/5773
----
- src/adapter.c | 139 ++++++++++++++++++++++++++++++++++++++++++++++----
- 1 file changed, 128 insertions(+), 11 deletions(-)
-
-diff --git a/src/adapter.c b/src/adapter.c
-index 7c11a688d..59afbcb6d 100644
---- a/src/adapter.c
-+++ b/src/adapter.c
-@@ -239,6 +239,14 @@ struct btd_adapter_pin_cb_iter {
- 	/* When the iterator reaches the end, it is NULL and attempt is 0 */
- };
- 
-+enum {
-+	ADAPTER_POWER_STATE_OFF,
-+	ADAPTER_POWER_STATE_ON,
-+	ADAPTER_POWER_STATE_ON_DISABLING,
-+	ADAPTER_POWER_STATE_OFF_ENABLING,
-+	ADAPTER_POWER_STATE_OFF_BLOCKED,
-+};
-+
- struct btd_adapter {
- 	int ref_count;
- 
-@@ -250,9 +258,9 @@ struct btd_adapter {
- 	uint32_t dev_class;		/* controller class of device */
- 	char *name;			/* controller device name */
- 	char *short_name;		/* controller short name */
--	bool blocked;			/* whether rfkill is enabled */
- 	uint32_t supported_settings;	/* controller supported settings */
- 	uint32_t pending_settings;	/* pending controller settings */
-+	uint32_t power_state;		/* the power state */
- 	uint32_t current_settings;	/* current controller settings */
- 
- 	char *path;			/* adapter object path */
-@@ -326,6 +334,24 @@ struct btd_adapter {
- 	struct queue *exps;
- };
- 
-+static char *adapter_power_state_str(uint32_t power_state)
-+{
-+	switch (power_state) {
-+	case ADAPTER_POWER_STATE_OFF:
-+		return "off";
-+	case ADAPTER_POWER_STATE_ON:
-+		return "on";
-+	case ADAPTER_POWER_STATE_ON_DISABLING:
-+		return "on-disabling";
-+	case ADAPTER_POWER_STATE_OFF_ENABLING:
-+		return "off-enabling";
-+	case ADAPTER_POWER_STATE_OFF_BLOCKED:
-+		return "off-blocked";
-+	}
-+	DBG("Invalid power state %d", power_state);
-+	return "";
-+}
-+
- typedef enum {
- 	ADAPTER_AUTHORIZE_DISCONNECTED = 0,
- 	ADAPTER_AUTHORIZE_CHECK_CONNECTED
-@@ -619,6 +645,29 @@ static void settings_changed(struct btd_adapter *adapter, uint32_t settings)
- 	}
- }
- 
-+static void adapter_set_power_state(struct btd_adapter *adapter, uint32_t value)
-+{
-+	if (adapter->power_state == value)
-+		return;
-+
-+	DBG("%s", adapter_power_state_str(value));
-+	adapter->power_state = value;
-+	g_dbus_emit_property_changed(dbus_conn, adapter->path,
-+					ADAPTER_INTERFACE, "PowerState");
-+}
-+
-+static void reset_power_state_target(struct btd_adapter *adapter,
-+					uint32_t value)
-+{
-+	if (value &&
-+	    adapter->power_state == ADAPTER_POWER_STATE_OFF_ENABLING) {
-+		adapter_set_power_state(adapter, ADAPTER_POWER_STATE_ON);
-+	} else if (!value &&
-+		   adapter->power_state == ADAPTER_POWER_STATE_ON_DISABLING) {
-+		adapter_set_power_state(adapter, ADAPTER_POWER_STATE_OFF);
-+	}
-+}
-+
- static void new_settings_callback(uint16_t index, uint16_t length,
- 					const void *param, void *user_data)
- {
-@@ -636,6 +685,12 @@ static void new_settings_callback(uint16_t index, uint16_t length,
- 	if (settings == adapter->current_settings)
- 		return;
- 
-+	if ((adapter->current_settings ^ settings) & MGMT_SETTING_POWERED) {
-+		reset_power_state_target(adapter,
-+					settings & MGMT_SETTING_POWERED ?
-+					0x01 : 0x00);
-+	}
-+
- 	DBG("Settings: 0x%08x", settings);
- 
- 	settings_changed(adapter, settings);
-@@ -644,6 +699,7 @@ static void new_settings_callback(uint16_t index, uint16_t length,
- struct set_mode_data {
- 	struct btd_adapter *adapter;
- 	uint32_t setting;
-+	uint8_t value;
- };
- 
- static void set_mode_complete(uint8_t status, uint16_t length,
-@@ -656,8 +712,12 @@ static void set_mode_complete(uint8_t status, uint16_t length,
- 		btd_error(adapter->dev_id, "Failed to set mode: %s (0x%02x)",
- 						mgmt_errstr(status), status);
- 		if (status == MGMT_STATUS_RFKILLED)
--			adapter->blocked = true;
-+			adapter_set_power_state(adapter,
-+					ADAPTER_POWER_STATE_OFF_BLOCKED);
- 		adapter->pending_settings &= ~data->setting;
-+		if (status != MGMT_STATUS_RFKILLED &&
-+		    data->setting & MGMT_SETTING_POWERED)
-+			reset_power_state_target(adapter, data->value);
- 		return;
- 	}
- 
-@@ -695,6 +755,11 @@ static bool set_mode(struct btd_adapter *adapter, uint16_t opcode,
- 	switch (opcode) {
- 	case MGMT_OP_SET_POWERED:
- 		setting = MGMT_SETTING_POWERED;
-+		if (adapter->power_state != ADAPTER_POWER_STATE_OFF_BLOCKED) {
-+			adapter_set_power_state(adapter, mode ?
-+					ADAPTER_POWER_STATE_OFF_ENABLING :
-+					ADAPTER_POWER_STATE_ON_DISABLING);
-+		}
- 		break;
- 	case MGMT_OP_SET_CONNECTABLE:
- 		setting = MGMT_SETTING_CONNECTABLE;
-@@ -715,6 +780,7 @@ static bool set_mode(struct btd_adapter *adapter, uint16_t opcode,
- 	data = g_new0(struct set_mode_data, 1);
- 	data->adapter = adapter;
- 	data->setting = setting;
-+	data->value = mode;
- 
- 	if (mgmt_send(adapter->mgmt, opcode,
- 				adapter->dev_id, sizeof(cp), &cp,
-@@ -722,8 +788,13 @@ static bool set_mode(struct btd_adapter *adapter, uint16_t opcode,
- 		adapter->pending_settings |= setting;
- 		return true;
- 	}
--
- 	g_free(data);
-+	if (setting == MGMT_SETTING_POWERED) {
-+		/* cancel the earlier setting */
-+		adapter_set_power_state(adapter, mode ?
-+					ADAPTER_POWER_STATE_OFF :
-+					ADAPTER_POWER_STATE_ON);
-+	}
- 	btd_error(adapter->dev_id, "Failed to set mode for index %u",
- 							adapter->dev_id);
- 
-@@ -2934,6 +3005,7 @@ struct property_set_data {
- 	struct btd_adapter *adapter;
- 	uint32_t setting;
- 	GDBusPendingPropertySet id;
-+	uint8_t value;
- };
- 
- static void property_set_mode_complete(uint8_t status, uint16_t length,
-@@ -2952,7 +3024,8 @@ static void property_set_mode_complete(uint8_t status, uint16_t length,
- 
- 		if (status == MGMT_STATUS_RFKILLED) {
- 			dbus_err = ERROR_INTERFACE ".Blocked";
--			adapter->blocked = true;
-+			adapter_set_power_state(adapter,
-+					ADAPTER_POWER_STATE_OFF_BLOCKED);
- 		} else {
- 			dbus_err = ERROR_INTERFACE ".Failed";
- 		}
-@@ -2961,6 +3034,9 @@ static void property_set_mode_complete(uint8_t status, uint16_t length,
- 							mgmt_errstr(status));
- 
- 		adapter->pending_settings &= ~data->setting;
-+		if (status != MGMT_STATUS_RFKILLED &&
-+		    data->setting & MGMT_SETTING_POWERED)
-+			reset_power_state_target(adapter, data->value);
- 		return;
- 	}
- 
-@@ -3084,6 +3160,15 @@ static void property_set_mode(struct btd_adapter *adapter, uint32_t setting,
- 	data->adapter = adapter;
- 	data->setting = setting;
- 	data->id = id;
-+	data->setting = setting;
-+	data->value = mode;
-+
-+	if (setting == MGMT_SETTING_POWERED &&
-+	    adapter->power_state != ADAPTER_POWER_STATE_OFF_BLOCKED) {
-+		adapter_set_power_state(adapter, mode ?
-+					ADAPTER_POWER_STATE_OFF_ENABLING :
-+					ADAPTER_POWER_STATE_ON_DISABLING);
-+	}
- 
- 	if (mgmt_send(adapter->mgmt, opcode, adapter->dev_id, len, param,
- 			property_set_mode_complete, data, g_free) > 0) {
-@@ -3092,6 +3177,12 @@ static void property_set_mode(struct btd_adapter *adapter, uint32_t setting,
- 	}
- 
- 	g_free(data);
-+	if (setting == MGMT_SETTING_POWERED) {
-+		/* cancel the earlier setting */
-+		adapter_set_power_state(adapter, mode ?
-+					ADAPTER_POWER_STATE_OFF :
-+					ADAPTER_POWER_STATE_ON);
-+	}
- 
- failed:
- 	btd_error(adapter->dev_id, "Failed to set mode for index %u",
-@@ -3123,6 +3214,18 @@ static void property_set_powered(const GDBusPropertyTable *property,
- 	property_set_mode(adapter, MGMT_SETTING_POWERED, iter, id);
- }
- 
-+static gboolean property_get_power_state(const GDBusPropertyTable *property,
-+					DBusMessageIter *iter, void *user_data)
-+{
-+	struct btd_adapter *adapter = user_data;
-+	const char *str;
-+
-+	str = adapter_power_state_str(adapter->power_state);
-+	dbus_message_iter_append_basic(iter, DBUS_TYPE_STRING, &str);
-+
-+	return TRUE;
-+}
-+
- static gboolean property_get_discoverable(const GDBusPropertyTable *property,
- 					DBusMessageIter *iter, void *user_data)
- {
-@@ -3761,6 +3864,8 @@ 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 },
- 	{ "Discoverable", "b", property_get_discoverable,
- 					property_set_discoverable },
- 	{ "DiscoverableTimeout", "u", property_get_discoverable_timeout,
-@@ -5567,6 +5672,7 @@ static void adapter_start(struct btd_adapter *adapter)
- {
- 	g_dbus_emit_property_changed(dbus_conn, adapter->path,
- 						ADAPTER_INTERFACE, "Powered");
-+	adapter_set_power_state(adapter, ADAPTER_POWER_STATE_ON);
- 
- 	DBG("adapter %s has been enabled", adapter->path);
- 
-@@ -6697,7 +6803,7 @@ static struct btd_adapter *btd_adapter_new(uint16_t index)
- 	adapter->pincode_requested = false;
- 	blocked = rfkill_get_blocked(index);
- 	if (blocked > 0)
--		adapter->blocked = true;
-+		adapter->power_state = ADAPTER_POWER_STATE_OFF_BLOCKED;
- 
- 	/*
- 	 * Setup default configuration values. These are either adapter
-@@ -6724,7 +6830,8 @@ static struct btd_adapter *btd_adapter_new(uint16_t index)
- 	DBG("Discoverable timeout: %u seconds", adapter->discoverable_timeout);
- 	DBG("Pairable timeout: %u seconds", adapter->pairable_timeout);
- 	if (blocked > 0)
--		DBG("Blocked: yes");
-+		DBG("Power state: %s",
-+			adapter_power_state_str(adapter->power_state));
- 
- 	adapter->auths = g_queue_new();
- 	adapter->exps = queue_new();
-@@ -7316,6 +7423,9 @@ static void adapter_stop(struct btd_adapter *adapter)
- 
- 	g_dbus_emit_property_changed(dbus_conn, adapter->path,
- 						ADAPTER_INTERFACE, "Powered");
-+	g_dbus_emit_property_changed(dbus_conn, adapter->path,
-+						ADAPTER_INTERFACE,
-+						"PowerState");
- 
- 	DBG("adapter %s has been disabled", adapter->path);
- }
-@@ -7592,10 +7702,18 @@ int btd_cancel_authorization(guint id)
- 
- int btd_adapter_restore_powered(struct btd_adapter *adapter)
- {
--	if (adapter->blocked)
--		adapter->blocked = false;
-+	bool powered;
- 
--	if (btd_adapter_get_powered(adapter))
-+	powered = btd_adapter_get_powered(adapter);
-+	if (adapter->power_state == ADAPTER_POWER_STATE_OFF_BLOCKED &&
-+	    rfkill_get_blocked(adapter->dev_id) == 0) {
-+		adapter_set_power_state(adapter,
-+					powered ?
-+					ADAPTER_POWER_STATE_ON :
-+					ADAPTER_POWER_STATE_OFF);
-+	}
-+
-+	if (powered)
- 		return 0;
- 
- 	set_mode(adapter, MGMT_OP_SET_POWERED, 0x01);
-@@ -7605,8 +7723,7 @@ int btd_adapter_restore_powered(struct btd_adapter *adapter)
- 
- int btd_adapter_set_blocked(struct btd_adapter *adapter)
- {
--	if (!adapter->blocked)
--		adapter->blocked = true;
-+	adapter_set_power_state(adapter, ADAPTER_POWER_STATE_OFF_BLOCKED);
- 	return 0;
- }
- 
--- 
-2.37.2
-
-
-From f86d0c8092ca8f9fee7c140f5f4df3938ea1ec29 Mon Sep 17 00:00:00 2001
-From: Bastien Nocera <hadess@hadess.net>
-Date: Wed, 31 Aug 2022 11:01:22 +0200
-Subject: [PATCH 3/6] client: Print the PowerState property
-
----
- client/main.c | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/client/main.c b/client/main.c
-index 6773d5262..2816e880f 100644
---- a/client/main.c
-+++ b/client/main.c
-@@ -981,6 +981,7 @@ static void cmd_show(int argc, char *argv[])
- 	print_property(adapter->proxy, "Alias");
- 	print_property(adapter->proxy, "Class");
- 	print_property(adapter->proxy, "Powered");
-+	print_property(adapter->proxy, "PowerState");
- 	print_property(adapter->proxy, "Discoverable");
- 	print_property(adapter->proxy, "DiscoverableTimeout");
- 	print_property(adapter->proxy, "Pairable");
--- 
-2.37.2
-
-
-From 4b2587ecdb437f6c24d1c42576eb9d4ecb01a7f3 Mon Sep 17 00:00:00 2001
-From: Bastien Nocera <hadess@hadess.net>
-Date: Wed, 31 Aug 2022 11:01:44 +0200
-Subject: [PATCH 4/6] adapter-api: Add PowerState property documentation
-
----
- doc/adapter-api.txt | 15 +++++++++++++++
- 1 file changed, 15 insertions(+)
-
-diff --git a/doc/adapter-api.txt b/doc/adapter-api.txt
-index 48466ab75..9b2721c1b 100644
---- a/doc/adapter-api.txt
-+++ b/doc/adapter-api.txt
-@@ -269,6 +269,21 @@ Properties	string Address [readonly]
- 			restart or unplugging of the adapter it will reset
- 			back to false.
- 
-+		string PowerState [readonly, experimental]
-+
-+			The power state of an adapter.
-+
-+			The power state will show whether the adapter is
-+			turning off, or turning on, as well as being on
-+			or off.
-+
-+			Possible values:
-+				"on" - powered on
-+				"off" - powered off
-+				"off-enabling" - transitioning from "off" to "on"
-+				"on-disabling" - transitioning from "on" to "off"
-+				"off-blocked" - blocked by rfkill
-+
- 		boolean Discoverable [readwrite]
- 
- 			Switch an adapter to discoverable or non-discoverable
--- 
-2.37.2
-
-
-From 0e723ee0f8e9024b6319267637253e5d7f982ef1 Mon Sep 17 00:00:00 2001
-From: Bastien Nocera <hadess@hadess.net>
-Date: Wed, 31 Aug 2022 11:05:56 +0200
-Subject: [PATCH 5/6] adapter: Fix typo in function name
-
----
- src/adapter.c | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/src/adapter.c b/src/adapter.c
-index 59afbcb6d..8fb2acdc8 100644
---- a/src/adapter.c
-+++ b/src/adapter.c
-@@ -3511,7 +3511,7 @@ static gboolean property_get_experimental(const GDBusPropertyTable *property,
- 	return TRUE;
- }
- 
--static gboolean property_experimental_exits(const GDBusPropertyTable *property,
-+static gboolean property_experimental_exists(const GDBusPropertyTable *property,
- 								void *data)
- {
- 	struct btd_adapter *adapter = data;
-@@ -3879,7 +3879,7 @@ static const GDBusPropertyTable adapter_properties[] = {
- 					property_exists_modalias },
- 	{ "Roles", "as", property_get_roles },
- 	{ "ExperimentalFeatures", "as", property_get_experimental, NULL,
--					property_experimental_exits },
-+					property_experimental_exists },
- 	{ }
- };
- 
--- 
-2.37.2
-
-
-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
-


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-wireless/bluez/, net-wireless/bluez/files/
@ 2022-09-11  7:50 Pacho Ramos
  0 siblings, 0 replies; 22+ messages in thread
From: Pacho Ramos @ 2022-09-11  7:50 UTC (permalink / raw
  To: gentoo-commits

commit:     c7e05832f00875182becdba543cfdfd4a62ed26a
Author:     Pacho Ramos <pacho <AT> gentoo <DOT> org>
AuthorDate: Sun Sep 11 07:43:27 2022 +0000
Commit:     Pacho Ramos <pacho <AT> gentoo <DOT> org>
CommitDate: Sun Sep 11 07:50:30 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c7e05832

net-wireless/bluez: add 5.65

Thanks-to: Joakim Tjernlund
Closes: https://bugs.gentoo.org/866025
Signed-off-by: Pacho Ramos <pacho <AT> gentoo.org>

 net-wireless/bluez/Manifest                        |   1 +
 net-wireless/bluez/bluez-5.65.ebuild               | 297 +++++++++
 ...et-pending-settings-when-receiving-MGMT-e.patch | 170 +++++
 .../bluez/files/power-state-adapter-property.patch | 723 +++++++++++++++++++++
 4 files changed, 1191 insertions(+)

diff --git a/net-wireless/bluez/Manifest b/net-wireless/bluez/Manifest
index 1f5ef5199e6c..1bf6ed310204 100644
--- a/net-wireless/bluez/Manifest
+++ b/net-wireless/bluez/Manifest
@@ -1 +1,2 @@
 DIST bluez-5.64.tar.xz 2175148 BLAKE2B 828c620330d1993d5c5c2a865f2d27a29425e3583aac01a1a782290a805ee0fd6456b6832c804ad323dd8714fa9329487b2616ed08f1f491ea29403ee05dba2d SHA512 f11f9974b29c5c6fce3890d7e42425c1cb02e42c1b8f49c5cc4b249234e67b64317d0e5e82721e2fbf1b53269c8569a9c869d59ce42b5e927f6622f0753e53cd
+DIST bluez-5.65.tar.xz 2208100 BLAKE2B 9d2937e2e14d8d8945183c6436921d9d16a6d3bcb5dbe3e2493554fbc4972bb4c006aabc793c9fb8eae47a7e9f29ae9fdf47551dfc0a238e86f5a76ce7436ae2 SHA512 c20c09a1a75053c77d73b3ce15ac7fd321eb6df5ca1646d57c6848b87c0c9957908bc17dd928da4ef2aacfc8667877cbc7511c1ba43db839bfa9bf1fb8269907

diff --git a/net-wireless/bluez/bluez-5.65.ebuild b/net-wireless/bluez/bluez-5.65.ebuild
new file mode 100644
index 000000000000..74ffae23b148
--- /dev/null
+++ b/net-wireless/bluez/bluez-5.65.ebuild
@@ -0,0 +1,297 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+PYTHON_COMPAT=( python3_{8..10} )
+
+inherit autotools linux-info python-single-r1 readme.gentoo-r1 systemd udev multilib-minimal
+
+DESCRIPTION="Bluetooth Tools and System Daemons for Linux"
+HOMEPAGE="http://www.bluez.org"
+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"
+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
+# change in the future, hence, this REQUIRED_USE constraint could be dropped
+# again in the future.
+# btpclient needs mesh, bug #790587
+REQUIRED_USE="
+	btpclient? ( mesh )
+	extra-tools? ( deprecated readline )
+	test? ( ${PYTHON_REQUIRED_USE} )
+	test-programs? ( ${PYTHON_REQUIRED_USE} )
+"
+
+TEST_DEPS="${PYTHON_DEPS}
+	$(python_gen_cond_dep '
+		>=dev-python/dbus-python-1[${PYTHON_USEDEP}]
+		dev-python/pygobject:3[${PYTHON_USEDEP}]
+	')
+"
+BDEPEND="
+	dev-python/docutils
+	virtual/pkgconfig
+	test? ( ${TEST_DEPS} )
+"
+DEPEND="
+	>=dev-libs/glib-2.28:2[${MULTILIB_USEDEP}]
+	btpclient? ( >=dev-libs/ell-0.39 )
+	cups? ( net-print/cups:= )
+	mesh? (
+		>=dev-libs/ell-0.39
+		>=dev-libs/json-c-0.13:=
+		sys-libs/readline:0=
+	)
+	midi? ( media-libs/alsa-lib )
+	obex? ( dev-libs/libical:= )
+	readline? ( sys-libs/readline:0= )
+	systemd? ( sys-apps/systemd )
+	>=sys-apps/dbus-1.6:=
+	udev? ( >=virtual/udev-172 )
+"
+RDEPEND="${DEPEND}
+	selinux? ( sec-policy/selinux-bluetooth )
+	test-programs? ( ${TEST_DEPS} )
+"
+
+RESTRICT="!test? ( test )"
+
+PATCHES=(
+	# Try both udevadm paths to cover udev/systemd vs. eudev locations (#539844)
+	# http://www.spinics.net/lists/linux-bluetooth/msg58739.html
+	# https://bugs.gentoo.org/539844
+	# https://github.com/bluez/bluez/issues/268
+	"${FILESDIR}"/${PN}-udevadm-path-r1.patch
+
+	# Fedora patches
+	# http://www.spinics.net/lists/linux-bluetooth/msg40136.html
+	"${FILESDIR}"/0001-obex-Use-GLib-helper-function-to-manipulate-paths.patch
+
+	# Fixed in next release
+	"${FILESDIR}"/0001-adapter-Reset-pending-settings-when-receiving-MGMT-e.patch
+	"${FILESDIR}"/power-state-adapter-property.patch
+)
+
+pkg_setup() {
+	# From http://www.linuxfromscratch.org/blfs/view/svn/general/bluez.html
+	# to prevent bugs like:
+	# https://bugzilla.kernel.org/show_bug.cgi?id=196621
+	CONFIG_CHECK="~NET ~BT ~BT_RFCOMM ~BT_RFCOMM_TTY ~BT_BNEP ~BT_BNEP_MC_FILTER
+		~BT_BNEP_PROTO_FILTER ~BT_HIDP ~CRYPTO_USER_API_HASH ~CRYPTO_USER_API_SKCIPHER ~RFKILL"
+	# https://bugzilla.kernel.org/show_bug.cgi?id=196621
+	# https://bugzilla.kernel.org/show_bug.cgi?id=206815
+	if use mesh || use test; then
+		CONFIG_CHECK="${CONFIG_CHECK} ~CRYPTO_USER
+		~CRYPTO_USER_API ~CRYPTO_USER_API_AEAD ~CRYPTO_AES ~CRYPTO_CCM ~CRYPTO_AEAD ~CRYPTO_CMAC
+		~CRYPTO_MD5 ~CRYPTO_SHA1 ~KEY_DH_OPERATIONS"
+	fi
+	linux-info_pkg_setup
+
+	if use test || use test-programs; then
+		python-single-r1_pkg_setup
+	fi
+
+	if ! use udev; then
+		ewarn
+		ewarn "You are installing ${PN} with USE=-udev. This means various bluetooth"
+		ewarn "devices and adapters from Apple, Dell, Logitech etc. will not work,"
+		ewarn "and hid2hci will not be available."
+		ewarn
+	fi
+}
+
+src_prepare() {
+	default
+
+	# http://www.spinics.net/lists/linux-bluetooth/msg38490.html
+	if ! use systemd; then
+		eapply "${FILESDIR}"/0001-Allow-using-obexd-without-systemd-in-the-user-session-r2.patch
+	fi
+
+	eautoreconf
+
+	if use cups; then
+		# Only not .am to not need to run eautoreconf only because of this
+		sed -i \
+			-e "s:cupsdir = \$(libdir)/cups:cupsdir = $(cups-config --serverbin):" \
+			Makefile.{in,tools} || die
+	fi
+
+	multilib_copy_sources
+}
+
+multilib_src_configure() {
+	local myconf=(
+		# readline is automagic when client is enabled
+		# --enable-client always needs readline, bug #504038
+		# --enable-mesh is handled in the same way
+		ac_cv_header_readline_readline_h=$(multilib_native_usex readline)
+		ac_cv_header_readline_readline_h=$(multilib_native_usex mesh)
+	)
+
+	if ! multilib_is_native_abi; then
+		myconf+=(
+			# deps not used for the library
+			{DBUS,GLIB}_{CFLAGS,LIBS}=' '
+		)
+	fi
+
+	econf \
+		--localstatedir=/var \
+		--disable-android \
+		--enable-datafiles \
+		--enable-optimization \
+		$(use_enable debug) \
+		--enable-pie \
+		--enable-threads \
+		--enable-library \
+		--enable-tools \
+		--enable-manpages \
+		--enable-monitor \
+		--with-systemdsystemunitdir="$(systemd_get_systemunitdir)" \
+		--with-systemduserunitdir="$(systemd_get_userunitdir)" \
+		$(multilib_native_use_enable btpclient) \
+		$(multilib_native_use_enable btpclient external-ell) \
+		$(multilib_native_use_enable cups) \
+		$(multilib_native_use_enable deprecated) \
+		$(multilib_native_use_enable experimental) \
+		$(multilib_native_use_enable mesh) \
+		$(multilib_native_use_enable mesh external-ell) \
+		$(multilib_native_use_enable midi) \
+		$(multilib_native_use_enable obex) \
+		$(multilib_native_use_enable readline client) \
+		$(multilib_native_use_enable systemd) \
+		$(multilib_native_use_enable test-programs test) \
+		$(multilib_native_use_enable udev) \
+		$(multilib_native_use_enable udev hid2hci) \
+		$(multilib_native_use_enable udev sixaxis)
+}
+
+multilib_src_compile() {
+	if multilib_is_native_abi; then
+		default
+	else
+		emake -f Makefile -f - libs \
+			<<<'libs: $(lib_LTLIBRARIES)'
+	fi
+}
+
+multilib_src_test() {
+	multilib_is_native_abi && default
+}
+
+multilib_src_install() {
+	if multilib_is_native_abi; then
+		emake DESTDIR="${D}" install
+
+		# Only install extra-tools when relevant USE flag is enabled
+		if use extra-tools; then
+			ewarn "Upstream doesn't support using this tools and their bugs are"
+			ewarn "likely to be ignored forever, also they can break without"
+			ewarn "previous announcement."
+			ewarn "Upstream also states all this tools are not really needed,"
+			ewarn "then, if you still need to rely on them, you must ask them"
+			ewarn "to either install that tool by default or add the needed"
+			ewarn "functionality to the existing 'official' tools."
+			ewarn "Please report this issues to:"
+			ewarn "http://www.bluez.org/development/lists/"
+
+			# Upstream doesn't install this, bug #524640
+			# http://permalink.gmane.org/gmane.linux.bluez.kernel/53115
+			# http://comments.gmane.org/gmane.linux.bluez.kernel/54564
+			dobin tools/btmgmt
+			# gatttool is only built with readline, bug #530776
+			# https://bugzilla.redhat.com/show_bug.cgi?id=1141909
+			# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=720486
+			# https://bugs.archlinux.org/task/37686
+			dobin attrib/gatttool
+			# https://bugzilla.redhat.com/show_bug.cgi?id=1699680
+			dobin tools/avinfo
+		fi
+
+		# Not installed by default after being built, bug #666756
+		use btpclient && dobin tools/btpclient
+
+		# Unittests are not that useful once installed, so make them optional
+		if use test-programs; then
+			# Drop python2 only test tools
+			# https://bugzilla.kernel.org/show_bug.cgi?id=206819
+			rm "${ED}"/usr/$(get_libdir)/bluez/test/simple-player || die
+			# https://bugzilla.kernel.org/show_bug.cgi?id=206821
+			rm "${ED}"/usr/$(get_libdir)/bluez/test/test-hfp || die
+			# https://bugzilla.kernel.org/show_bug.cgi?id=206823
+			rm "${ED}"/usr/$(get_libdir)/bluez/test/test-sap-server	|| die
+
+			python_fix_shebang "${ED}"/usr/$(get_libdir)/bluez/test
+
+			for i in $(find "${ED}"/usr/$(get_libdir)/bluez/test -maxdepth 1 -type f ! -name "*.*"); do
+				dosym "${i}" /usr/bin/bluez-"${i##*/}"
+			done
+		fi
+	else
+		emake DESTDIR="${D}" \
+			install-pkgincludeHEADERS \
+			install-libLTLIBRARIES \
+			install-pkgconfigDATA
+	fi
+}
+
+multilib_src_install_all() {
+	# We need to ensure obexd can be spawned automatically by systemd
+	# when user-session is enabled:
+	# http://marc.info/?l=linux-bluetooth&m=148096094716386&w=2
+	# https://bugs.gentoo.org/show_bug.cgi?id=577842
+	# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=804908
+	# https://bugs.archlinux.org/task/45816
+	# https://bugzilla.redhat.com/show_bug.cgi?id=1318441
+	# https://bugzilla.redhat.com/show_bug.cgi?id=1389347
+	if use systemd; then
+		dosym obex.service /usr/lib/systemd/user/dbus-org.bluez.obex.service
+	fi
+
+	find "${D}" -name '*.la' -type f -delete || die
+
+	keepdir /var/lib/bluetooth
+
+	# Upstream don't want people to play with them
+	# But we keep installing them due to 'historical' reasons
+	insinto /etc/bluetooth
+	local d
+	for d in input network; do
+		doins profiles/${d}/${d}.conf
+	done
+	# Setup auto enable as Fedora does for allowing to use
+	# keyboards/mouse as soon as possible
+	sed -i 's/#\[Policy\]$/\[Policy\]/; s/#AutoEnable=false/AutoEnable=true/' src/main.conf || die
+	doins src/main.conf
+
+	newinitd "${FILESDIR}"/bluetooth-init.d-r5 bluetooth
+	newconfd "${FILESDIR}"/bluetooth-conf.d bluetooth
+
+	einstalldocs
+	use doc && dodoc doc/*.txt
+	# 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
+}
+
+pkg_postinst() {
+	use udev && udev_reload
+	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
+}
+
+pkg_postrm() {
+	use udev && udev_reload
+}

diff --git a/net-wireless/bluez/files/0001-adapter-Reset-pending-settings-when-receiving-MGMT-e.patch b/net-wireless/bluez/files/0001-adapter-Reset-pending-settings-when-receiving-MGMT-e.patch
new file mode 100644
index 000000000000..b9b432fadff0
--- /dev/null
+++ b/net-wireless/bluez/files/0001-adapter-Reset-pending-settings-when-receiving-MGMT-e.patch
@@ -0,0 +1,170 @@
+From ede7b915980fbc80eff80aa189c35ca016956c61 Mon Sep 17 00:00:00 2001
+From: Archie Pusaka <apusaka@chromium.org>
+Date: Tue, 23 Aug 2022 12:15:56 +0800
+Subject: [PATCH] adapter: Reset pending settings when receiving MGMT error
+
+We set the pending settings flag when sending MGMT_SETTING_*
+commands to the MGMT layer and clear them when receiving a
+successful reply, but we don't clear them when receiving an error
+reply. This might cause a setting to be stuck in pending state.
+
+Therefore, also clear the pending flag when receiving error.
+Furthermore, this patch also postpones setting the pending flag
+until we queue the MGMT command in order to avoid setting it too
+soon but we return early.
+
+This was caught during power off test, where MGMT_OP_SET_POWERED
+returns Authentication Failed because disconnection takes too long.
+Future attempts to switch power will then be ignored.
+
+< HCI Command: Disconnect (0x01|0x0006) plen 3   #17916 [hci0] 12.502908
+        Handle: 512
+        Reason: Remote Device Terminated due to Power Off (0x15)
+> HCI Event: Command Status (0x0f) plen 4        #17917 [hci0] 12.503185
+      Disconnect (0x01|0x0006) ncmd 1
+        Status: Success (0x00)
+@ MGMT Event: Command Status (0x0002) plen 3   {0x0001} [hci0] 14.519491
+      Set Powered (0x0005)
+        Status: Authentication Failed (0x05)
+= bluetoothd: Failed to set mode: Authentication Failed (0x05) 14.520042
+= bluetoothd: adapter /org/bluez/hci0 set power to 0           14.813533
+> HCI Event: Disconnect Complete (0x05) plen 4   #17918 [hci0] 16.509043
+        Status: Success (0x00)
+        Handle: 512
+        Reason: Connection Timeout (0x08)
+
+Reviewed-by: Sonny Sasaka <sonnysasaka@chromium.org>
+---
+ src/adapter.c | 39 +++++++++++++++++++++++++++++++--------
+ 1 file changed, 31 insertions(+), 8 deletions(-)
+
+diff --git a/src/adapter.c b/src/adapter.c
+index ec26aab1a..b453e86a0 100644
+--- a/src/adapter.c
++++ b/src/adapter.c
+@@ -640,14 +640,21 @@ static void new_settings_callback(uint16_t index, uint16_t length,
+ 	settings_changed(adapter, settings);
+ }
+ 
++struct set_mode_data {
++	struct btd_adapter *adapter;
++	uint32_t setting;
++};
++
+ static void set_mode_complete(uint8_t status, uint16_t length,
+ 					const void *param, void *user_data)
+ {
+-	struct btd_adapter *adapter = user_data;
++	struct set_mode_data *data = user_data;
++	struct btd_adapter *adapter = data->adapter;
+ 
+ 	if (status != MGMT_STATUS_SUCCESS) {
+ 		btd_error(adapter->dev_id, "Failed to set mode: %s (0x%02x)",
+ 						mgmt_errstr(status), status);
++		adapter->pending_settings &= ~data->setting;
+ 		return;
+ 	}
+ 
+@@ -677,6 +684,7 @@ static bool set_mode(struct btd_adapter *adapter, uint16_t opcode,
+ {
+ 	struct mgmt_mode cp;
+ 	uint32_t setting = 0;
++	struct set_mode_data *data;
+ 
+ 	memset(&cp, 0, sizeof(cp));
+ 	cp.val = mode;
+@@ -699,15 +707,20 @@ static bool set_mode(struct btd_adapter *adapter, uint16_t opcode,
+ 		break;
+ 	}
+ 
+-	adapter->pending_settings |= setting;
+-
+ 	DBG("sending set mode command for index %u", adapter->dev_id);
+ 
++	data = g_new0(struct set_mode_data, 1);
++	data->adapter = adapter;
++	data->setting = setting;
++
+ 	if (mgmt_send(adapter->mgmt, opcode,
+ 				adapter->dev_id, sizeof(cp), &cp,
+-				set_mode_complete, adapter, NULL) > 0)
++				set_mode_complete, data, g_free) > 0) {
++		adapter->pending_settings |= setting;
+ 		return true;
++	}
+ 
++	g_free(data);
+ 	btd_error(adapter->dev_id, "Failed to set mode for index %u",
+ 							adapter->dev_id);
+ 
+@@ -718,6 +731,7 @@ static bool set_discoverable(struct btd_adapter *adapter, uint8_t mode,
+ 							uint16_t timeout)
+ {
+ 	struct mgmt_cp_set_discoverable cp;
++	struct set_mode_data *data;
+ 
+ 	memset(&cp, 0, sizeof(cp));
+ 	cp.val = mode;
+@@ -734,11 +748,16 @@ static bool set_discoverable(struct btd_adapter *adapter, uint8_t mode,
+ 									mode);
+ 	}
+ 
++	data = g_new0(struct set_mode_data, 1);
++	data->adapter = adapter;
++	data->setting = 0;
++
+ 	if (mgmt_send(adapter->mgmt, MGMT_OP_SET_DISCOVERABLE,
+ 				adapter->dev_id, sizeof(cp), &cp,
+-				set_mode_complete, adapter, NULL) > 0)
++				set_mode_complete, data, g_free) > 0)
+ 		return true;
+ 
++	g_free(data);
+ 	btd_error(adapter->dev_id, "Failed to set mode for index %u",
+ 							adapter->dev_id);
+ 
+@@ -2877,6 +2896,7 @@ static gboolean property_get_mode(struct btd_adapter *adapter,
+ 
+ struct property_set_data {
+ 	struct btd_adapter *adapter;
++	uint32_t setting;
+ 	GDBusPendingPropertySet id;
+ };
+ 
+@@ -2901,6 +2921,8 @@ static void property_set_mode_complete(uint8_t status, uint16_t length,
+ 
+ 		g_dbus_pending_property_error(data->id, dbus_err,
+ 							mgmt_errstr(status));
++
++		adapter->pending_settings &= ~data->setting;
+ 		return;
+ 	}
+ 
+@@ -2969,8 +2991,6 @@ static void property_set_mode(struct btd_adapter *adapter, uint32_t setting,
+ 
+ 	mode = (enable == TRUE) ? 0x01 : 0x00;
+ 
+-	adapter->pending_settings |= setting;
+-
+ 	switch (setting) {
+ 	case MGMT_SETTING_POWERED:
+ 		opcode = MGMT_OP_SET_POWERED;
+@@ -3024,11 +3044,14 @@ static void property_set_mode(struct btd_adapter *adapter, uint32_t setting,
+ 		goto failed;
+ 
+ 	data->adapter = adapter;
++	data->setting = setting;
+ 	data->id = id;
+ 
+ 	if (mgmt_send(adapter->mgmt, opcode, adapter->dev_id, len, param,
+-			property_set_mode_complete, data, g_free) > 0)
++			property_set_mode_complete, data, g_free) > 0) {
++		adapter->pending_settings |= setting;
+ 		return;
++	}
+ 
+ 	g_free(data);
+ 
+-- 
+2.37.2
+

diff --git a/net-wireless/bluez/files/power-state-adapter-property.patch b/net-wireless/bluez/files/power-state-adapter-property.patch
new file mode 100644
index 000000000000..1d6f2cd0ae7f
--- /dev/null
+++ b/net-wireless/bluez/files/power-state-adapter-property.patch
@@ -0,0 +1,723 @@
+From a282944af40893fc79f0ae3aa1bf52031aa07ffe Mon Sep 17 00:00:00 2001
+From: Bastien Nocera <hadess@hadess.net>
+Date: Wed, 31 Aug 2022 10:56:06 +0200
+Subject: [PATCH 1/6] adapter: Keep track of whether the adapter is rfkill'ed
+
+Instead of only replying to D-Bus requests with an error saying the
+adapter is blocked, keep track of the rfkill being enabled or disabled
+so we know the rfkill state of the adapter at all times.
+---
+ src/adapter.c | 25 +++++++++++++--
+ src/adapter.h |  1 +
+ src/btd.h     |  1 +
+ src/rfkill.c  | 89 ++++++++++++++++++++++++++++++++++++++-------------
+ 4 files changed, 91 insertions(+), 25 deletions(-)
+
+diff --git a/src/adapter.c b/src/adapter.c
+index 51b099dae..7c11a688d 100644
+--- a/src/adapter.c
++++ b/src/adapter.c
+@@ -250,6 +250,7 @@ struct btd_adapter {
+ 	uint32_t dev_class;		/* controller class of device */
+ 	char *name;			/* controller device name */
+ 	char *short_name;		/* controller short name */
++	bool blocked;			/* whether rfkill is enabled */
+ 	uint32_t supported_settings;	/* controller supported settings */
+ 	uint32_t pending_settings;	/* pending controller settings */
+ 	uint32_t current_settings;	/* current controller settings */
+@@ -654,6 +655,8 @@ static void set_mode_complete(uint8_t status, uint16_t length,
+ 	if (status != MGMT_STATUS_SUCCESS) {
+ 		btd_error(adapter->dev_id, "Failed to set mode: %s (0x%02x)",
+ 						mgmt_errstr(status), status);
++		if (status == MGMT_STATUS_RFKILLED)
++			adapter->blocked = true;
+ 		adapter->pending_settings &= ~data->setting;
+ 		return;
+ 	}
+@@ -2947,10 +2950,12 @@ static void property_set_mode_complete(uint8_t status, uint16_t length,
+ 		btd_error(adapter->dev_id, "Failed to set mode: %s (0x%02x)",
+ 						mgmt_errstr(status), status);
+ 
+-		if (status == MGMT_STATUS_RFKILLED)
++		if (status == MGMT_STATUS_RFKILLED) {
+ 			dbus_err = ERROR_INTERFACE ".Blocked";
+-		else
++			adapter->blocked = true;
++		} else {
+ 			dbus_err = ERROR_INTERFACE ".Failed";
++		}
+ 
+ 		g_dbus_pending_property_error(data->id, dbus_err,
+ 							mgmt_errstr(status));
+@@ -6681,6 +6686,7 @@ static void load_config(struct btd_adapter *adapter)
+ static struct btd_adapter *btd_adapter_new(uint16_t index)
+ {
+ 	struct btd_adapter *adapter;
++	int blocked;
+ 
+ 	adapter = g_try_new0(struct btd_adapter, 1);
+ 	if (!adapter)
+@@ -6689,6 +6695,9 @@ static struct btd_adapter *btd_adapter_new(uint16_t index)
+ 	adapter->dev_id = index;
+ 	adapter->mgmt = mgmt_ref(mgmt_primary);
+ 	adapter->pincode_requested = false;
++	blocked = rfkill_get_blocked(index);
++	if (blocked > 0)
++		adapter->blocked = true;
+ 
+ 	/*
+ 	 * Setup default configuration values. These are either adapter
+@@ -6714,6 +6723,8 @@ static struct btd_adapter *btd_adapter_new(uint16_t index)
+ 	DBG("Modalias: %s", adapter->modalias);
+ 	DBG("Discoverable timeout: %u seconds", adapter->discoverable_timeout);
+ 	DBG("Pairable timeout: %u seconds", adapter->pairable_timeout);
++	if (blocked > 0)
++		DBG("Blocked: yes");
+ 
+ 	adapter->auths = g_queue_new();
+ 	adapter->exps = queue_new();
+@@ -7581,6 +7592,9 @@ int btd_cancel_authorization(guint id)
+ 
+ int btd_adapter_restore_powered(struct btd_adapter *adapter)
+ {
++	if (adapter->blocked)
++		adapter->blocked = false;
++
+ 	if (btd_adapter_get_powered(adapter))
+ 		return 0;
+ 
+@@ -7589,6 +7603,13 @@ int btd_adapter_restore_powered(struct btd_adapter *adapter)
+ 	return 0;
+ }
+ 
++int btd_adapter_set_blocked(struct btd_adapter *adapter)
++{
++	if (!adapter->blocked)
++		adapter->blocked = true;
++	return 0;
++}
++
+ void btd_adapter_register_pin_cb(struct btd_adapter *adapter,
+ 							btd_adapter_pin_cb_t cb)
+ {
+diff --git a/src/adapter.h b/src/adapter.h
+index f38f473b7..78eb069ae 100644
+--- a/src/adapter.h
++++ b/src/adapter.h
+@@ -144,6 +144,7 @@ guint btd_request_authorization_cable_configured(const bdaddr_t *src, const bdad
+ int btd_cancel_authorization(guint id);
+ 
+ int btd_adapter_restore_powered(struct btd_adapter *adapter);
++int btd_adapter_set_blocked(struct btd_adapter *adapter);
+ 
+ typedef ssize_t (*btd_adapter_pin_cb_t) (struct btd_adapter *adapter,
+ 			struct btd_device *dev, char *out, bool *display,
+diff --git a/src/btd.h b/src/btd.h
+index c02b2691e..63be6d8d4 100644
+--- a/src/btd.h
++++ b/src/btd.h
+@@ -144,6 +144,7 @@ void plugin_cleanup(void);
+ 
+ void rfkill_init(void);
+ void rfkill_exit(void);
++int rfkill_get_blocked(uint16_t index);
+ 
+ GKeyFile *btd_get_main_conf(void);
+ bool btd_kernel_experimental_enabled(const char *uuid);
+diff --git a/src/rfkill.c b/src/rfkill.c
+index 2099c5ac5..a0a50d9e4 100644
+--- a/src/rfkill.c
++++ b/src/rfkill.c
+@@ -55,12 +55,71 @@ struct rfkill_event {
+ };
+ #define RFKILL_EVENT_SIZE_V1    8
+ 
++static int get_adapter_id_for_rfkill(int rfkill_id)
++{
++	char sysname[PATH_MAX];
++	int namefd;
++
++	snprintf(sysname, sizeof(sysname) - 1,
++			"/sys/class/rfkill/rfkill%u/name", rfkill_id);
++
++	namefd = open(sysname, O_RDONLY);
++	if (namefd < 0)
++		return -1;
++
++	memset(sysname, 0, sizeof(sysname));
++
++	if (read(namefd, sysname, sizeof(sysname) - 1) < 4) {
++		close(namefd);
++		return -1;
++	}
++
++	close(namefd);
++
++	if (g_str_has_prefix(sysname, "hci") == FALSE)
++		return -1;
++
++	return atoi(sysname + 3);
++}
++
++int rfkill_get_blocked(uint16_t index)
++{
++	int fd;
++	int blocked = -1;
++
++	fd = open("/dev/rfkill", O_RDWR);
++	if (fd < 0) {
++		DBG("Failed to open RFKILL control device");
++		return -1;
++	}
++
++	while (1) {
++		struct rfkill_event event = { 0 };
++		int id;
++		ssize_t len;
++
++		len = read(fd, &event, sizeof(event));
++		if (len < RFKILL_EVENT_SIZE_V1)
++			break;
++
++		id = get_adapter_id_for_rfkill(event.idx);
++
++		if (index == id) {
++			blocked = event.soft || event.hard;
++			break;
++		}
++	}
++	close(fd);
++
++	return blocked;
++}
++
+ static gboolean rfkill_event(GIOChannel *chan,
+ 				GIOCondition cond, gpointer data)
+ {
+ 	struct rfkill_event event = { 0 };
+ 	struct btd_adapter *adapter;
+-	char sysname[PATH_MAX];
++	bool blocked = false;
+ 	ssize_t len;
+ 	int fd, id;
+ 
+@@ -84,7 +143,7 @@ static gboolean rfkill_event(GIOChannel *chan,
+ 						event.soft, event.hard);
+ 
+ 	if (event.soft || event.hard)
+-		return TRUE;
++		blocked = true;
+ 
+ 	if (event.op != RFKILL_OP_CHANGE)
+ 		return TRUE;
+@@ -93,26 +152,7 @@ static gboolean rfkill_event(GIOChannel *chan,
+ 					event.type != RFKILL_TYPE_ALL)
+ 		return TRUE;
+ 
+-	snprintf(sysname, sizeof(sysname) - 1,
+-			"/sys/class/rfkill/rfkill%u/name", event.idx);
+-
+-	fd = open(sysname, O_RDONLY);
+-	if (fd < 0)
+-		return TRUE;
+-
+-	memset(sysname, 0, sizeof(sysname));
+-
+-	if (read(fd, sysname, sizeof(sysname) - 1) < 4) {
+-		close(fd);
+-		return TRUE;
+-	}
+-
+-	close(fd);
+-
+-	if (g_str_has_prefix(sysname, "hci") == FALSE)
+-		return TRUE;
+-
+-	id = atoi(sysname + 3);
++	id = get_adapter_id_for_rfkill(event.idx);
+ 	if (id < 0)
+ 		return TRUE;
+ 
+@@ -122,7 +162,10 @@ static gboolean rfkill_event(GIOChannel *chan,
+ 
+ 	DBG("RFKILL unblock for hci%d", id);
+ 
+-	btd_adapter_restore_powered(adapter);
++	if (blocked)
++		btd_adapter_set_blocked(adapter);
++	else
++		btd_adapter_restore_powered(adapter);
+ 
+ 	return TRUE;
+ }
+-- 
+2.37.2
+
+
+From 7711e4081bf6096f2210f5b5d715f005d654abf1 Mon Sep 17 00:00:00 2001
+From: Bastien Nocera <hadess@hadess.net>
+Date: Wed, 31 Aug 2022 13:23:23 +0200
+Subject: [PATCH 2/6] adapter: Implement PowerState property
+
+This property should allow any program to show whether an adapter is in
+the process of being turned on.
+
+As turning on an adapter isn't instantaneous, it's important that the UI
+reflects the transitional state of the adapter's power, and doesn't
+assume the device is already turned on but not yet working, or still off
+despite having requested for it to be turned on, in both cases making
+the UI feel unresponsive.
+
+This can also not be implemented in front-ends directly as, then,
+the status of an adapter wouldn't be reflected correctly in the Settings
+window if it's turned on in the system menu. Implementing it in the
+front-ends would also preclude from having feedback about the state of
+the adapter when bluetoothd is the one powering up the adapter after the
+rfkill was unblocked.
+
+See https://gitlab.gnome.org/GNOME/gnome-bluetooth/-/issues/121
+and the original https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/5773
+---
+ src/adapter.c | 139 ++++++++++++++++++++++++++++++++++++++++++++++----
+ 1 file changed, 128 insertions(+), 11 deletions(-)
+
+diff --git a/src/adapter.c b/src/adapter.c
+index 7c11a688d..59afbcb6d 100644
+--- a/src/adapter.c
++++ b/src/adapter.c
+@@ -239,6 +239,14 @@ struct btd_adapter_pin_cb_iter {
+ 	/* When the iterator reaches the end, it is NULL and attempt is 0 */
+ };
+ 
++enum {
++	ADAPTER_POWER_STATE_OFF,
++	ADAPTER_POWER_STATE_ON,
++	ADAPTER_POWER_STATE_ON_DISABLING,
++	ADAPTER_POWER_STATE_OFF_ENABLING,
++	ADAPTER_POWER_STATE_OFF_BLOCKED,
++};
++
+ struct btd_adapter {
+ 	int ref_count;
+ 
+@@ -250,9 +258,9 @@ struct btd_adapter {
+ 	uint32_t dev_class;		/* controller class of device */
+ 	char *name;			/* controller device name */
+ 	char *short_name;		/* controller short name */
+-	bool blocked;			/* whether rfkill is enabled */
+ 	uint32_t supported_settings;	/* controller supported settings */
+ 	uint32_t pending_settings;	/* pending controller settings */
++	uint32_t power_state;		/* the power state */
+ 	uint32_t current_settings;	/* current controller settings */
+ 
+ 	char *path;			/* adapter object path */
+@@ -326,6 +334,24 @@ struct btd_adapter {
+ 	struct queue *exps;
+ };
+ 
++static char *adapter_power_state_str(uint32_t power_state)
++{
++	switch (power_state) {
++	case ADAPTER_POWER_STATE_OFF:
++		return "off";
++	case ADAPTER_POWER_STATE_ON:
++		return "on";
++	case ADAPTER_POWER_STATE_ON_DISABLING:
++		return "on-disabling";
++	case ADAPTER_POWER_STATE_OFF_ENABLING:
++		return "off-enabling";
++	case ADAPTER_POWER_STATE_OFF_BLOCKED:
++		return "off-blocked";
++	}
++	DBG("Invalid power state %d", power_state);
++	return "";
++}
++
+ typedef enum {
+ 	ADAPTER_AUTHORIZE_DISCONNECTED = 0,
+ 	ADAPTER_AUTHORIZE_CHECK_CONNECTED
+@@ -619,6 +645,29 @@ static void settings_changed(struct btd_adapter *adapter, uint32_t settings)
+ 	}
+ }
+ 
++static void adapter_set_power_state(struct btd_adapter *adapter, uint32_t value)
++{
++	if (adapter->power_state == value)
++		return;
++
++	DBG("%s", adapter_power_state_str(value));
++	adapter->power_state = value;
++	g_dbus_emit_property_changed(dbus_conn, adapter->path,
++					ADAPTER_INTERFACE, "PowerState");
++}
++
++static void reset_power_state_target(struct btd_adapter *adapter,
++					uint32_t value)
++{
++	if (value &&
++	    adapter->power_state == ADAPTER_POWER_STATE_OFF_ENABLING) {
++		adapter_set_power_state(adapter, ADAPTER_POWER_STATE_ON);
++	} else if (!value &&
++		   adapter->power_state == ADAPTER_POWER_STATE_ON_DISABLING) {
++		adapter_set_power_state(adapter, ADAPTER_POWER_STATE_OFF);
++	}
++}
++
+ static void new_settings_callback(uint16_t index, uint16_t length,
+ 					const void *param, void *user_data)
+ {
+@@ -636,6 +685,12 @@ static void new_settings_callback(uint16_t index, uint16_t length,
+ 	if (settings == adapter->current_settings)
+ 		return;
+ 
++	if ((adapter->current_settings ^ settings) & MGMT_SETTING_POWERED) {
++		reset_power_state_target(adapter,
++					settings & MGMT_SETTING_POWERED ?
++					0x01 : 0x00);
++	}
++
+ 	DBG("Settings: 0x%08x", settings);
+ 
+ 	settings_changed(adapter, settings);
+@@ -644,6 +699,7 @@ static void new_settings_callback(uint16_t index, uint16_t length,
+ struct set_mode_data {
+ 	struct btd_adapter *adapter;
+ 	uint32_t setting;
++	uint8_t value;
+ };
+ 
+ static void set_mode_complete(uint8_t status, uint16_t length,
+@@ -656,8 +712,12 @@ static void set_mode_complete(uint8_t status, uint16_t length,
+ 		btd_error(adapter->dev_id, "Failed to set mode: %s (0x%02x)",
+ 						mgmt_errstr(status), status);
+ 		if (status == MGMT_STATUS_RFKILLED)
+-			adapter->blocked = true;
++			adapter_set_power_state(adapter,
++					ADAPTER_POWER_STATE_OFF_BLOCKED);
+ 		adapter->pending_settings &= ~data->setting;
++		if (status != MGMT_STATUS_RFKILLED &&
++		    data->setting & MGMT_SETTING_POWERED)
++			reset_power_state_target(adapter, data->value);
+ 		return;
+ 	}
+ 
+@@ -695,6 +755,11 @@ static bool set_mode(struct btd_adapter *adapter, uint16_t opcode,
+ 	switch (opcode) {
+ 	case MGMT_OP_SET_POWERED:
+ 		setting = MGMT_SETTING_POWERED;
++		if (adapter->power_state != ADAPTER_POWER_STATE_OFF_BLOCKED) {
++			adapter_set_power_state(adapter, mode ?
++					ADAPTER_POWER_STATE_OFF_ENABLING :
++					ADAPTER_POWER_STATE_ON_DISABLING);
++		}
+ 		break;
+ 	case MGMT_OP_SET_CONNECTABLE:
+ 		setting = MGMT_SETTING_CONNECTABLE;
+@@ -715,6 +780,7 @@ static bool set_mode(struct btd_adapter *adapter, uint16_t opcode,
+ 	data = g_new0(struct set_mode_data, 1);
+ 	data->adapter = adapter;
+ 	data->setting = setting;
++	data->value = mode;
+ 
+ 	if (mgmt_send(adapter->mgmt, opcode,
+ 				adapter->dev_id, sizeof(cp), &cp,
+@@ -722,8 +788,13 @@ static bool set_mode(struct btd_adapter *adapter, uint16_t opcode,
+ 		adapter->pending_settings |= setting;
+ 		return true;
+ 	}
+-
+ 	g_free(data);
++	if (setting == MGMT_SETTING_POWERED) {
++		/* cancel the earlier setting */
++		adapter_set_power_state(adapter, mode ?
++					ADAPTER_POWER_STATE_OFF :
++					ADAPTER_POWER_STATE_ON);
++	}
+ 	btd_error(adapter->dev_id, "Failed to set mode for index %u",
+ 							adapter->dev_id);
+ 
+@@ -2934,6 +3005,7 @@ struct property_set_data {
+ 	struct btd_adapter *adapter;
+ 	uint32_t setting;
+ 	GDBusPendingPropertySet id;
++	uint8_t value;
+ };
+ 
+ static void property_set_mode_complete(uint8_t status, uint16_t length,
+@@ -2952,7 +3024,8 @@ static void property_set_mode_complete(uint8_t status, uint16_t length,
+ 
+ 		if (status == MGMT_STATUS_RFKILLED) {
+ 			dbus_err = ERROR_INTERFACE ".Blocked";
+-			adapter->blocked = true;
++			adapter_set_power_state(adapter,
++					ADAPTER_POWER_STATE_OFF_BLOCKED);
+ 		} else {
+ 			dbus_err = ERROR_INTERFACE ".Failed";
+ 		}
+@@ -2961,6 +3034,9 @@ static void property_set_mode_complete(uint8_t status, uint16_t length,
+ 							mgmt_errstr(status));
+ 
+ 		adapter->pending_settings &= ~data->setting;
++		if (status != MGMT_STATUS_RFKILLED &&
++		    data->setting & MGMT_SETTING_POWERED)
++			reset_power_state_target(adapter, data->value);
+ 		return;
+ 	}
+ 
+@@ -3084,6 +3160,15 @@ static void property_set_mode(struct btd_adapter *adapter, uint32_t setting,
+ 	data->adapter = adapter;
+ 	data->setting = setting;
+ 	data->id = id;
++	data->setting = setting;
++	data->value = mode;
++
++	if (setting == MGMT_SETTING_POWERED &&
++	    adapter->power_state != ADAPTER_POWER_STATE_OFF_BLOCKED) {
++		adapter_set_power_state(adapter, mode ?
++					ADAPTER_POWER_STATE_OFF_ENABLING :
++					ADAPTER_POWER_STATE_ON_DISABLING);
++	}
+ 
+ 	if (mgmt_send(adapter->mgmt, opcode, adapter->dev_id, len, param,
+ 			property_set_mode_complete, data, g_free) > 0) {
+@@ -3092,6 +3177,12 @@ static void property_set_mode(struct btd_adapter *adapter, uint32_t setting,
+ 	}
+ 
+ 	g_free(data);
++	if (setting == MGMT_SETTING_POWERED) {
++		/* cancel the earlier setting */
++		adapter_set_power_state(adapter, mode ?
++					ADAPTER_POWER_STATE_OFF :
++					ADAPTER_POWER_STATE_ON);
++	}
+ 
+ failed:
+ 	btd_error(adapter->dev_id, "Failed to set mode for index %u",
+@@ -3123,6 +3214,18 @@ static void property_set_powered(const GDBusPropertyTable *property,
+ 	property_set_mode(adapter, MGMT_SETTING_POWERED, iter, id);
+ }
+ 
++static gboolean property_get_power_state(const GDBusPropertyTable *property,
++					DBusMessageIter *iter, void *user_data)
++{
++	struct btd_adapter *adapter = user_data;
++	const char *str;
++
++	str = adapter_power_state_str(adapter->power_state);
++	dbus_message_iter_append_basic(iter, DBUS_TYPE_STRING, &str);
++
++	return TRUE;
++}
++
+ static gboolean property_get_discoverable(const GDBusPropertyTable *property,
+ 					DBusMessageIter *iter, void *user_data)
+ {
+@@ -3761,6 +3864,8 @@ 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 },
+ 	{ "Discoverable", "b", property_get_discoverable,
+ 					property_set_discoverable },
+ 	{ "DiscoverableTimeout", "u", property_get_discoverable_timeout,
+@@ -5567,6 +5672,7 @@ static void adapter_start(struct btd_adapter *adapter)
+ {
+ 	g_dbus_emit_property_changed(dbus_conn, adapter->path,
+ 						ADAPTER_INTERFACE, "Powered");
++	adapter_set_power_state(adapter, ADAPTER_POWER_STATE_ON);
+ 
+ 	DBG("adapter %s has been enabled", adapter->path);
+ 
+@@ -6697,7 +6803,7 @@ static struct btd_adapter *btd_adapter_new(uint16_t index)
+ 	adapter->pincode_requested = false;
+ 	blocked = rfkill_get_blocked(index);
+ 	if (blocked > 0)
+-		adapter->blocked = true;
++		adapter->power_state = ADAPTER_POWER_STATE_OFF_BLOCKED;
+ 
+ 	/*
+ 	 * Setup default configuration values. These are either adapter
+@@ -6724,7 +6830,8 @@ static struct btd_adapter *btd_adapter_new(uint16_t index)
+ 	DBG("Discoverable timeout: %u seconds", adapter->discoverable_timeout);
+ 	DBG("Pairable timeout: %u seconds", adapter->pairable_timeout);
+ 	if (blocked > 0)
+-		DBG("Blocked: yes");
++		DBG("Power state: %s",
++			adapter_power_state_str(adapter->power_state));
+ 
+ 	adapter->auths = g_queue_new();
+ 	adapter->exps = queue_new();
+@@ -7316,6 +7423,9 @@ static void adapter_stop(struct btd_adapter *adapter)
+ 
+ 	g_dbus_emit_property_changed(dbus_conn, adapter->path,
+ 						ADAPTER_INTERFACE, "Powered");
++	g_dbus_emit_property_changed(dbus_conn, adapter->path,
++						ADAPTER_INTERFACE,
++						"PowerState");
+ 
+ 	DBG("adapter %s has been disabled", adapter->path);
+ }
+@@ -7592,10 +7702,18 @@ int btd_cancel_authorization(guint id)
+ 
+ int btd_adapter_restore_powered(struct btd_adapter *adapter)
+ {
+-	if (adapter->blocked)
+-		adapter->blocked = false;
++	bool powered;
+ 
+-	if (btd_adapter_get_powered(adapter))
++	powered = btd_adapter_get_powered(adapter);
++	if (adapter->power_state == ADAPTER_POWER_STATE_OFF_BLOCKED &&
++	    rfkill_get_blocked(adapter->dev_id) == 0) {
++		adapter_set_power_state(adapter,
++					powered ?
++					ADAPTER_POWER_STATE_ON :
++					ADAPTER_POWER_STATE_OFF);
++	}
++
++	if (powered)
+ 		return 0;
+ 
+ 	set_mode(adapter, MGMT_OP_SET_POWERED, 0x01);
+@@ -7605,8 +7723,7 @@ int btd_adapter_restore_powered(struct btd_adapter *adapter)
+ 
+ int btd_adapter_set_blocked(struct btd_adapter *adapter)
+ {
+-	if (!adapter->blocked)
+-		adapter->blocked = true;
++	adapter_set_power_state(adapter, ADAPTER_POWER_STATE_OFF_BLOCKED);
+ 	return 0;
+ }
+ 
+-- 
+2.37.2
+
+
+From f86d0c8092ca8f9fee7c140f5f4df3938ea1ec29 Mon Sep 17 00:00:00 2001
+From: Bastien Nocera <hadess@hadess.net>
+Date: Wed, 31 Aug 2022 11:01:22 +0200
+Subject: [PATCH 3/6] client: Print the PowerState property
+
+---
+ client/main.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/client/main.c b/client/main.c
+index 6773d5262..2816e880f 100644
+--- a/client/main.c
++++ b/client/main.c
+@@ -981,6 +981,7 @@ static void cmd_show(int argc, char *argv[])
+ 	print_property(adapter->proxy, "Alias");
+ 	print_property(adapter->proxy, "Class");
+ 	print_property(adapter->proxy, "Powered");
++	print_property(adapter->proxy, "PowerState");
+ 	print_property(adapter->proxy, "Discoverable");
+ 	print_property(adapter->proxy, "DiscoverableTimeout");
+ 	print_property(adapter->proxy, "Pairable");
+-- 
+2.37.2
+
+
+From 4b2587ecdb437f6c24d1c42576eb9d4ecb01a7f3 Mon Sep 17 00:00:00 2001
+From: Bastien Nocera <hadess@hadess.net>
+Date: Wed, 31 Aug 2022 11:01:44 +0200
+Subject: [PATCH 4/6] adapter-api: Add PowerState property documentation
+
+---
+ doc/adapter-api.txt | 15 +++++++++++++++
+ 1 file changed, 15 insertions(+)
+
+diff --git a/doc/adapter-api.txt b/doc/adapter-api.txt
+index 48466ab75..9b2721c1b 100644
+--- a/doc/adapter-api.txt
++++ b/doc/adapter-api.txt
+@@ -269,6 +269,21 @@ Properties	string Address [readonly]
+ 			restart or unplugging of the adapter it will reset
+ 			back to false.
+ 
++		string PowerState [readonly, experimental]
++
++			The power state of an adapter.
++
++			The power state will show whether the adapter is
++			turning off, or turning on, as well as being on
++			or off.
++
++			Possible values:
++				"on" - powered on
++				"off" - powered off
++				"off-enabling" - transitioning from "off" to "on"
++				"on-disabling" - transitioning from "on" to "off"
++				"off-blocked" - blocked by rfkill
++
+ 		boolean Discoverable [readwrite]
+ 
+ 			Switch an adapter to discoverable or non-discoverable
+-- 
+2.37.2
+
+
+From 0e723ee0f8e9024b6319267637253e5d7f982ef1 Mon Sep 17 00:00:00 2001
+From: Bastien Nocera <hadess@hadess.net>
+Date: Wed, 31 Aug 2022 11:05:56 +0200
+Subject: [PATCH 5/6] adapter: Fix typo in function name
+
+---
+ src/adapter.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/adapter.c b/src/adapter.c
+index 59afbcb6d..8fb2acdc8 100644
+--- a/src/adapter.c
++++ b/src/adapter.c
+@@ -3511,7 +3511,7 @@ static gboolean property_get_experimental(const GDBusPropertyTable *property,
+ 	return TRUE;
+ }
+ 
+-static gboolean property_experimental_exits(const GDBusPropertyTable *property,
++static gboolean property_experimental_exists(const GDBusPropertyTable *property,
+ 								void *data)
+ {
+ 	struct btd_adapter *adapter = data;
+@@ -3879,7 +3879,7 @@ static const GDBusPropertyTable adapter_properties[] = {
+ 					property_exists_modalias },
+ 	{ "Roles", "as", property_get_roles },
+ 	{ "ExperimentalFeatures", "as", property_get_experimental, NULL,
+-					property_experimental_exits },
++					property_experimental_exists },
+ 	{ }
+ };
+ 
+-- 
+2.37.2
+
+
+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
+


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-wireless/bluez/, net-wireless/bluez/files/
@ 2023-01-31  5:56 Sam James
  0 siblings, 0 replies; 22+ messages in thread
From: Sam James @ 2023-01-31  5:56 UTC (permalink / raw
  To: gentoo-commits

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-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)


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-wireless/bluez/, net-wireless/bluez/files/
@ 2023-07-08 10:00 Pacho Ramos
  0 siblings, 0 replies; 22+ messages in thread
From: Pacho Ramos @ 2023-07-08 10:00 UTC (permalink / raw
  To: gentoo-commits

commit:     4c0d676de802c6993d63d9d3be70d14f47a03419
Author:     Pacho Ramos <pacho <AT> gentoo <DOT> org>
AuthorDate: Sat Jul  8 09:58:02 2023 +0000
Commit:     Pacho Ramos <pacho <AT> gentoo <DOT> org>
CommitDate: Sat Jul  8 09:59:25 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4c0d676d

net-wireless/bluez: add 5.68

Closes: https://bugs.gentoo.org/909741
Signed-off-by: Pacho Ramos <pacho <AT> gentoo.org>

 net-wireless/bluez/Manifest                        |   1 +
 net-wireless/bluez/bluez-5.68.ebuild               | 292 +++++++++++++++++++++
 .../bluez/files/bluez-5.68-bap-dettach-io.patch    | 101 +++++++
 .../bluez/files/bluez-5.68-bap-ebusy-fix.patch     | 206 +++++++++++++++
 .../bluez/files/bluez-5.68-bap-nonzero.patch       |  27 ++
 .../bluez/files/bluez-5.68-bap-resume.patch        | 187 +++++++++++++
 .../files/bluez-5.68-heap-use-after-free.patch     |  41 +++
 .../bluez/files/bluez-5.68-monitor-decoding.patch  |  45 ++++
 8 files changed, 900 insertions(+)

diff --git a/net-wireless/bluez/Manifest b/net-wireless/bluez/Manifest
index 590a5b58d4f6..bf90982bd86d 100644
--- a/net-wireless/bluez/Manifest
+++ b/net-wireless/bluez/Manifest
@@ -1 +1,2 @@
 DIST bluez-5.66.tar.xz 2257288 BLAKE2B af1911cf590461a874daa16bedb8a021a3b2c2af3254360c035d2180e0f355372651bd41da342c26e6d9631d726dd08e0d6a83a22069333b94b6fce6d546718c SHA512 ed0994932687eacf27207867366671b323671f5d5199daf36ea5eff8f254f2bc99ef989ef7df9883b35c06f2af60452be8bad0a06109428a4717cf2b247b4865
+DIST bluez-5.68.tar.xz 2319788 BLAKE2B 3beca78fadef4d66df6f237b7460f6ac4bf001d80c856b599faa2cc1232c4342c7945eace5a6667009b9d19f2368f9841e608f07bc826b30ce9112c43dd7e316 SHA512 1805fb68923a5e098777b69835d7593396f8f2bbf52e1cfe58e7447621497a700b23389c79e96b2d663c611335f6ea9df11efe8aa75a8842f6b73105f66e799c

diff --git a/net-wireless/bluez/bluez-5.68.ebuild b/net-wireless/bluez/bluez-5.68.ebuild
new file mode 100644
index 000000000000..e1bfed36ea31
--- /dev/null
+++ b/net-wireless/bluez/bluez-5.68.ebuild
@@ -0,0 +1,292 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+PYTHON_COMPAT=( python3_{9..12} )
+
+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"
+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 ~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
+# change in the future, hence, this REQUIRED_USE constraint could be dropped
+# again in the future.
+# btpclient needs mesh, bug #790587
+REQUIRED_USE="
+	btpclient? ( mesh )
+	extra-tools? ( deprecated readline )
+	test? ( ${PYTHON_REQUIRED_USE} )
+	test-programs? ( ${PYTHON_REQUIRED_USE} )
+"
+
+TEST_DEPS="${PYTHON_DEPS}
+	$(python_gen_cond_dep '
+		>=dev-python/dbus-python-1[${PYTHON_USEDEP}]
+		dev-python/pygobject:3[${PYTHON_USEDEP}]
+	')
+"
+BDEPEND="
+	dev-python/docutils
+	virtual/pkgconfig
+	test? ( ${TEST_DEPS} )
+"
+DEPEND="
+	>=dev-libs/glib-2.28:2[${MULTILIB_USEDEP}]
+	btpclient? ( >=dev-libs/ell-0.39 )
+	cups? ( net-print/cups:= )
+	mesh? (
+		>=dev-libs/ell-0.39
+		>=dev-libs/json-c-0.13:=
+		sys-libs/readline:0=
+	)
+	midi? ( media-libs/alsa-lib )
+	obex? ( dev-libs/libical:= )
+	readline? ( sys-libs/readline:0= )
+	systemd? ( sys-apps/systemd )
+	>=sys-apps/dbus-1.6:=
+	udev? ( >=virtual/udev-172 )
+"
+RDEPEND="${DEPEND}
+	selinux? ( sec-policy/selinux-bluetooth )
+	test-programs? ( ${TEST_DEPS} )
+"
+
+RESTRICT="!test? ( test )"
+
+PATCHES=(
+	# Try both udevadm paths to cover udev/systemd vs. eudev locations (#539844)
+	# http://www.spinics.net/lists/linux-bluetooth/msg58739.html
+	# https://bugs.gentoo.org/539844
+	# https://github.com/bluez/bluez/issues/268
+	"${FILESDIR}"/${PN}-udevadm-path-r1.patch
+
+	# Fedora patches
+	# 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}-bap-resume.patch
+	"${FILESDIR}"/${P}-bap-nonzero.patch
+	"${FILESDIR}"/${P}-bap-dettach-io.patch
+	"${FILESDIR}"/${P}-bap-ebusy-fix.patch
+	"${FILESDIR}"/${P}-monitor-decoding.patch
+	"${FILESDIR}"/${P}-heap-use-after-free.patch
+)
+
+pkg_setup() {
+	# From http://www.linuxfromscratch.org/blfs/view/svn/general/bluez.html
+	# to prevent bugs like:
+	# https://bugzilla.kernel.org/show_bug.cgi?id=196621
+	CONFIG_CHECK="~NET ~BT ~BT_RFCOMM ~BT_RFCOMM_TTY ~BT_BNEP ~BT_BNEP_MC_FILTER
+		~BT_BNEP_PROTO_FILTER ~BT_HIDP ~CRYPTO_USER_API_HASH ~CRYPTO_USER_API_SKCIPHER ~RFKILL"
+	# https://bugzilla.kernel.org/show_bug.cgi?id=196621
+	# https://bugzilla.kernel.org/show_bug.cgi?id=206815
+	if use mesh || use test; then
+		CONFIG_CHECK="${CONFIG_CHECK} ~CRYPTO_USER
+		~CRYPTO_USER_API ~CRYPTO_USER_API_AEAD ~CRYPTO_AES ~CRYPTO_CCM ~CRYPTO_AEAD ~CRYPTO_CMAC
+		~CRYPTO_MD5 ~CRYPTO_SHA1 ~KEY_DH_OPERATIONS"
+	fi
+	linux-info_pkg_setup
+
+	if use test || use test-programs; then
+		python-single-r1_pkg_setup
+	fi
+
+	if ! use udev; then
+		ewarn
+		ewarn "You are installing ${PN} with USE=-udev. This means various bluetooth"
+		ewarn "devices and adapters from Apple, Dell, Logitech etc. will not work,"
+		ewarn "and hid2hci will not be available."
+		ewarn
+	fi
+}
+
+src_prepare() {
+	default
+
+	# http://www.spinics.net/lists/linux-bluetooth/msg38490.html
+	if ! use systemd; then
+		eapply "${FILESDIR}"/0001-Allow-using-obexd-without-systemd-in-the-user-session-r2.patch
+	fi
+
+	eautoreconf
+
+	if use cups; then
+		# Only not .am to not need to run eautoreconf only because of this
+		sed -i \
+			-e "s:cupsdir = \$(libdir)/cups:cupsdir = $(cups-config --serverbin):" \
+			Makefile.{in,tools} || die
+	fi
+
+	multilib_copy_sources
+}
+
+multilib_src_configure() {
+	local myconf=(
+		# readline is automagic when client is enabled
+		# --enable-client always needs readline, bug #504038
+		# --enable-mesh is handled in the same way
+		ac_cv_header_readline_readline_h=$(multilib_native_usex readline)
+		ac_cv_header_readline_readline_h=$(multilib_native_usex mesh)
+	)
+
+	if ! multilib_is_native_abi; then
+		myconf+=(
+			# deps not used for the library
+			{DBUS,GLIB}_{CFLAGS,LIBS}=' '
+		)
+	fi
+
+	econf \
+		--localstatedir=/var \
+		--disable-android \
+		--enable-datafiles \
+		--enable-optimization \
+		$(use_enable debug) \
+		--enable-pie \
+		--enable-threads \
+		--enable-library \
+		--enable-tools \
+		--enable-manpages \
+		--enable-monitor \
+		--with-systemdsystemunitdir="$(systemd_get_systemunitdir)" \
+		--with-systemduserunitdir="$(systemd_get_userunitdir)" \
+		$(multilib_native_use_enable btpclient) \
+		$(multilib_native_use_enable btpclient external-ell) \
+		$(multilib_native_use_enable cups) \
+		$(multilib_native_use_enable deprecated) \
+		$(multilib_native_use_enable experimental) \
+		$(multilib_native_use_enable mesh) \
+		$(multilib_native_use_enable mesh external-ell) \
+		$(multilib_native_use_enable midi) \
+		$(multilib_native_use_enable obex) \
+		$(multilib_native_use_enable readline client) \
+		$(multilib_native_use_enable systemd) \
+		$(multilib_native_use_enable test-programs test) \
+		$(multilib_native_use_enable udev) \
+		$(multilib_native_use_enable udev hid2hci) \
+		$(multilib_native_use_enable udev sixaxis)
+}
+
+multilib_src_compile() {
+	if multilib_is_native_abi; then
+		default
+	else
+		emake -f Makefile -f - libs \
+			<<<'libs: $(lib_LTLIBRARIES)'
+	fi
+}
+
+multilib_src_test() {
+	multilib_is_native_abi && default
+}
+
+multilib_src_install() {
+	if multilib_is_native_abi; then
+		emake DESTDIR="${D}" install
+
+		# Only install extra-tools when relevant USE flag is enabled
+		if use extra-tools; then
+			ewarn "Upstream doesn't support using this tools and their bugs are"
+			ewarn "likely to be ignored forever, also they can break without"
+			ewarn "previous announcement."
+			ewarn "Upstream also states all this tools are not really needed,"
+			ewarn "then, if you still need to rely on them, you must ask them"
+			ewarn "to either install that tool by default or add the needed"
+			ewarn "functionality to the existing 'official' tools."
+			ewarn "Please report this issues to:"
+			ewarn "http://www.bluez.org/development/lists/"
+
+			# Upstream doesn't install this, bug #524640
+			# http://permalink.gmane.org/gmane.linux.bluez.kernel/53115
+			# http://comments.gmane.org/gmane.linux.bluez.kernel/54564
+			dobin tools/btmgmt
+			# gatttool is only built with readline, bug #530776
+			# https://bugzilla.redhat.com/show_bug.cgi?id=1141909
+			# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=720486
+			# https://bugs.archlinux.org/task/37686
+			dobin attrib/gatttool
+			# https://bugzilla.redhat.com/show_bug.cgi?id=1699680
+			dobin tools/avinfo
+		fi
+
+		# Not installed by default after being built, bug #666756
+		use btpclient && dobin tools/btpclient
+
+		# Unittests are not that useful once installed, so make them optional
+		if use test-programs; then
+			# Drop python2 only test tools
+			# https://bugzilla.kernel.org/show_bug.cgi?id=206819
+			rm "${ED}"/usr/$(get_libdir)/bluez/test/simple-player || die
+			# https://bugzilla.kernel.org/show_bug.cgi?id=206821
+			rm "${ED}"/usr/$(get_libdir)/bluez/test/test-hfp || die
+			# https://bugzilla.kernel.org/show_bug.cgi?id=206823
+			rm "${ED}"/usr/$(get_libdir)/bluez/test/test-sap-server	|| die
+
+			python_fix_shebang "${ED}"/usr/$(get_libdir)/bluez/test
+
+			for i in $(find "${ED}"/usr/$(get_libdir)/bluez/test -maxdepth 1 -type f ! -name "*.*"); do
+				dosym "${i}" /usr/bin/bluez-"${i##*/}"
+			done
+		fi
+	else
+		emake DESTDIR="${D}" \
+			install-pkgincludeHEADERS \
+			install-libLTLIBRARIES \
+			install-pkgconfigDATA
+	fi
+}
+
+multilib_src_install_all() {
+	# We need to ensure obexd can be spawned automatically by systemd
+	# when user-session is enabled:
+	# http://marc.info/?l=linux-bluetooth&m=148096094716386&w=2
+	# https://bugs.gentoo.org/show_bug.cgi?id=577842
+	# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=804908
+	# https://bugs.archlinux.org/task/45816
+	# https://bugzilla.redhat.com/show_bug.cgi?id=1318441
+	# https://bugzilla.redhat.com/show_bug.cgi?id=1389347
+	if use systemd; then
+		dosym obex.service /usr/lib/systemd/user/dbus-org.bluez.obex.service
+	fi
+
+	find "${D}" -name '*.la' -type f -delete || die
+
+	keepdir /var/lib/bluetooth
+
+	# Upstream don't want people to play with them
+	# But we keep installing them due to 'historical' reasons
+	insinto /etc/bluetooth
+	local d
+	for d in input network; do
+		doins profiles/${d}/${d}.conf
+	done
+	# Setup auto enable as Fedora does for allowing to use
+	# keyboards/mouse as soon as possible
+	sed -i 's/#\[Policy\]$/\[Policy\]/; s/#AutoEnable=false/AutoEnable=true/' src/main.conf || die
+	doins src/main.conf
+
+	newinitd "${FILESDIR}"/bluetooth-init.d-r5 bluetooth
+	newconfd "${FILESDIR}"/bluetooth-conf.d bluetooth
+
+	einstalldocs
+	use doc && dodoc doc/*.txt
+}
+
+pkg_postinst() {
+	use udev && udev_reload
+	systemd_reenable bluetooth.service
+
+	has_version net-dialup/ppp || elog "To use dial up networking you must install net-dialup/ppp"
+}
+
+pkg_postrm() {
+	use udev && udev_reload
+}

diff --git a/net-wireless/bluez/files/bluez-5.68-bap-dettach-io.patch b/net-wireless/bluez/files/bluez-5.68-bap-dettach-io.patch
new file mode 100644
index 000000000000..bb79fc42734b
--- /dev/null
+++ b/net-wireless/bluez/files/bluez-5.68-bap-dettach-io.patch
@@ -0,0 +1,101 @@
+From 7b10e72de6f41585f087e6fc338106b44d3e69c9 Mon Sep 17 00:00:00 2001
+From: Pauli Virtanen <pav@iki.fi>
+Date: Sun, 2 Jul 2023 21:43:04 +0300
+Subject: shared/bap: detach io for source ASEs only after Stop Ready
+
+The Client may terminate a CIS when sink is in QOS and source in
+Disabling states (BAP v1.0.1 Sec 5.6.5).  It may also terminate it when
+Receiver Stop Ready has completed successfully (BAP v1.0.1 Sec 5.6.5.1).
+
+It appears Samsung Galaxy Buds2 Pro (R510XXUOAWA5) ignores the Receiver
+Stop Ready command if CIS is already disconnected, and then gets stuck
+in disabling state. It works if CIS is disconnected after Receiver Stop
+Ready.
+
+For better compatibility as client for this device, and since it
+shouldn't matter for us in which order we do it, disconnect CIS after
+completion of Receiver Stop Ready, instead of immediately in Disabling.
+
+We disconnect also if Receiver Stop Ready fails, given that
+disconnecting in Disabled state should be OK.
+
+Link: https://github.com/bluez/bluez/issues/516
+---
+ src/shared/bap.c | 33 +++++++++++++++------------------
+ 1 file changed, 15 insertions(+), 18 deletions(-)
+
+diff --git a/src/shared/bap.c b/src/shared/bap.c
+index a0f5a0ae3c..72ce67c086 100644
+--- a/src/shared/bap.c
++++ b/src/shared/bap.c
+@@ -1168,18 +1168,6 @@ static bool match_stream_io(const void *data, const void *user_data)
+ 	return stream->io == io;
+ }
+ 
+-static void stream_stop_disabling(void *data, void *user_data)
+-{
+-	struct bt_bap_stream *stream = data;
+-
+-	if (stream->io || stream->ep->state != BT_ASCS_ASE_STATE_DISABLING)
+-		return;
+-
+-	DBG(stream->bap, "stream %p", stream);
+-
+-	bt_bap_stream_stop(stream, NULL, NULL);
+-}
+-
+ static bool bap_stream_io_detach(struct bt_bap_stream *stream)
+ {
+ 	struct bt_bap_stream *link;
+@@ -1198,9 +1186,6 @@ static bool bap_stream_io_detach(struct bt_bap_stream *stream)
+ 		/* Detach link if in QoS state */
+ 		if (link->ep->state == BT_ASCS_ASE_STATE_QOS)
+ 			bap_stream_io_detach(link);
+-	} else {
+-		/* Links without IO on disabling state shall be stopped. */
+-		queue_foreach(stream->links, stream_stop_disabling, NULL);
+ 	}
+ 
+ 	stream_io_unref(io);
+@@ -1244,6 +1229,15 @@ static struct bt_bap *bt_bap_ref_safe(struct bt_bap *bap)
+ 	return bt_bap_ref(bap);
+ }
+ 
++static void stream_stop_complete(struct bt_bap_stream *stream, uint8_t code,
++					uint8_t reason,	void *user_data)
++{
++	DBG(stream->bap, "stream %p stop 0x%02x 0x%02x", stream, code, reason);
++
++	if (stream->ep->state == BT_ASCS_ASE_STATE_DISABLING)
++		bap_stream_io_detach(stream);
++}
++
+ static void bap_stream_state_changed(struct bt_bap_stream *stream)
+ {
+ 	struct bt_bap *bap = stream->bap;
+@@ -1271,7 +1265,9 @@ static void bap_stream_state_changed(struct bt_bap_stream *stream)
+ 		bap_stream_update_io_links(stream);
+ 		break;
+ 	case BT_ASCS_ASE_STATE_DISABLING:
+-		bap_stream_io_detach(stream);
++		/* As client, we detach after Receiver Stop Ready */
++		if (!stream->client)
++			bap_stream_io_detach(stream);
+ 		break;
+ 	case BT_ASCS_ASE_STATE_QOS:
+ 		if (stream->io && !stream->io->connecting)
+@@ -1305,8 +1301,9 @@ static void bap_stream_state_changed(struct bt_bap_stream *stream)
+ 			bt_bap_stream_start(stream, NULL, NULL);
+ 		break;
+ 	case BT_ASCS_ASE_STATE_DISABLING:
+-		if (!bt_bap_stream_get_io(stream))
+-			bt_bap_stream_stop(stream, NULL, NULL);
++		/* Send Stop Ready, and detach IO after remote replies */
++		if (stream->client)
++			bt_bap_stream_stop(stream, stream_stop_complete, NULL);
+ 		break;
+ 	}
+ 
+-- 
+cgit 
+

diff --git a/net-wireless/bluez/files/bluez-5.68-bap-ebusy-fix.patch b/net-wireless/bluez/files/bluez-5.68-bap-ebusy-fix.patch
new file mode 100644
index 000000000000..72b875ba4b6f
--- /dev/null
+++ b/net-wireless/bluez/files/bluez-5.68-bap-ebusy-fix.patch
@@ -0,0 +1,206 @@
+From 8c3170190d6f626869f1f382138caf3a16030462 Mon Sep 17 00:00:00 2001
+From: Pauli Virtanen <pav@iki.fi>
+Date: Sun, 2 Jul 2023 21:43:05 +0300
+Subject: bap: wait for CIG to become configurable before recreating CIS
+
+ISO sockets cannot be reconnected before all sockets in the same CIG
+have been closed, if the CIG was previously active.
+
+Keep track which endpoints have active CIG, and postpone connecting CIS
+until their CIG is no longer active.
+
+This addresses getting EBUSY from connect() when multiple CIS in the
+same CIG move streaming -> qos at the same time, which disconnects CIS
+and recreates them.  The EBUSY originates from COMMAND_DISALLOWED
+response to Set CIG Parameters.
+
+This requires the kernel side do the Disconnect CIS / Remove CIG / Set
+CIG Parameters HCI command steps in the right order, when all old
+sockets are closed first before connecting new ones.
+---
+ profiles/audio/bap.c | 107 ++++++++++++++++++++++++++++++++++++++++++++++-----
+ 1 file changed, 97 insertions(+), 10 deletions(-)
+
+diff --git a/profiles/audio/bap.c b/profiles/audio/bap.c
+index 8e2fc1556a..d7ce9e0389 100644
+--- a/profiles/audio/bap.c
++++ b/profiles/audio/bap.c
+@@ -68,6 +68,7 @@ struct bap_ep {
+ 	GIOChannel *io;
+ 	unsigned int io_id;
+ 	bool recreate;
++	bool cig_active;
+ 	struct iovec *caps;
+ 	struct iovec *metadata;
+ 	struct bt_bap_qos qos;
+@@ -525,6 +526,7 @@ static void bap_io_close(struct bap_ep *ep)
+ 
+ 	g_io_channel_unref(ep->io);
+ 	ep->io = NULL;
++	ep->cig_active = false;
+ }
+ 
+ static DBusMessage *set_configuration(DBusConnection *conn, DBusMessage *msg,
+@@ -988,7 +990,7 @@ drop:
+ 	g_io_channel_shutdown(io, TRUE, NULL);
+ }
+ 
+-static void bap_accept_io(struct bap_data *data, struct bt_bap_stream *stream,
++static void bap_accept_io(struct bap_ep *ep, struct bt_bap_stream *stream,
+ 							int fd, int defer)
+ {
+ 	char c;
+@@ -1025,12 +1027,52 @@ static void bap_accept_io(struct bap_data *data, struct bt_bap_stream *stream,
+ 		}
+ 	}
+ 
++	ep->cig_active = true;
++
+ 	return;
+ 
+ fail:
+ 	close(fd);
+ }
+ 
++struct cig_busy_data {
++	struct btd_adapter *adapter;
++	uint8_t cig;
++};
++
++static bool cig_busy_ep(const void *data, const void *match_data)
++{
++	const struct bap_ep *ep = data;
++	const struct cig_busy_data *info = match_data;
++
++	return (ep->qos.ucast.cig_id == info->cig) && ep->cig_active;
++}
++
++static bool cig_busy_session(const void *data, const void *match_data)
++{
++	const struct bap_data *session = data;
++	const struct cig_busy_data *info = match_data;
++
++	if (device_get_adapter(session->device) != info->adapter)
++		return false;
++
++	return queue_find(session->snks, cig_busy_ep, match_data) ||
++			queue_find(session->srcs, cig_busy_ep, match_data);
++}
++
++static bool is_cig_busy(struct bap_data *data, uint8_t cig)
++{
++	struct cig_busy_data info;
++
++	if (cig == BT_ISO_QOS_CIG_UNSET)
++		return false;
++
++	info.adapter = device_get_adapter(data->device);
++	info.cig = cig;
++
++	return queue_find(sessions, cig_busy_session, &info);
++}
++
+ static void bap_create_io(struct bap_data *data, struct bap_ep *ep,
+ 				struct bt_bap_stream *stream, int defer);
+ 
+@@ -1047,6 +1089,48 @@ static gboolean bap_io_recreate(void *user_data)
+ 	return FALSE;
+ }
+ 
++static void recreate_cig_ep(void *data, void *match_data)
++{
++	struct bap_ep *ep = (struct bap_ep *)data;
++	struct cig_busy_data *info = match_data;
++
++	if (ep->qos.ucast.cig_id != info->cig || !ep->recreate || ep->io_id)
++		return;
++
++	ep->recreate = false;
++	ep->io_id = g_idle_add(bap_io_recreate, ep);
++}
++
++static void recreate_cig_session(void *data, void *match_data)
++{
++	struct bap_data *session = data;
++	struct cig_busy_data *info = match_data;
++
++	if (device_get_adapter(session->device) != info->adapter)
++		return;
++
++	queue_foreach(session->snks, recreate_cig_ep, match_data);
++	queue_foreach(session->srcs, recreate_cig_ep, match_data);
++}
++
++static void recreate_cig(struct bap_ep *ep)
++{
++	struct bap_data *data = ep->data;
++	struct cig_busy_data info;
++
++	info.adapter = device_get_adapter(data->device);
++	info.cig = ep->qos.ucast.cig_id;
++
++	DBG("adapter %p ep %p recreate CIG %d", info.adapter, ep, info.cig);
++
++	if (ep->qos.ucast.cig_id == BT_ISO_QOS_CIG_UNSET) {
++		recreate_cig_ep(ep, &info);
++		return;
++	}
++
++	queue_foreach(sessions, recreate_cig_session, &info);
++}
++
+ static gboolean bap_io_disconnected(GIOChannel *io, GIOCondition cond,
+ 							gpointer user_data)
+ {
+@@ -1059,10 +1143,8 @@ static gboolean bap_io_disconnected(GIOChannel *io, GIOCondition cond,
+ 	bap_io_close(ep);
+ 
+ 	/* Check if connecting recreate IO */
+-	if (ep->recreate) {
+-		ep->recreate = false;
+-		ep->io_id = g_idle_add(bap_io_recreate, ep);
+-	}
++	if (!is_cig_busy(ep->data, ep->qos.ucast.cig_id))
++		recreate_cig(ep);
+ 
+ 	return FALSE;
+ }
+@@ -1087,18 +1169,22 @@ static void bap_connect_io(struct bap_data *data, struct bap_ep *ep,
+ 	int fd;
+ 
+ 	/* If IO already set skip creating it again */
+-	if (bt_bap_stream_get_io(stream))
++	if (bt_bap_stream_get_io(stream)) {
++		DBG("ep %p stream %p has existing io", ep, stream);
+ 		return;
++	}
+ 
+ 	if (bt_bap_stream_io_is_connecting(stream, &fd)) {
+-		bap_accept_io(data, stream, fd, defer);
++		bap_accept_io(ep, stream, fd, defer);
+ 		return;
+ 	}
+ 
+-	/* If IO channel still up wait for it to be disconnected and then
+-	 * recreate.
++	/* If IO channel still up or CIG is busy, wait for it to be
++	 * disconnected and then recreate.
+ 	 */
+-	if (ep->io) {
++	if (ep->io || is_cig_busy(data, ep->qos.ucast.cig_id)) {
++		DBG("ep %p stream %p defer %s wait recreate", ep, stream,
++						defer ? "true" : "false");
+ 		ep->recreate = true;
+ 		return;
+ 	}
+@@ -1131,6 +1217,7 @@ static void bap_connect_io(struct bap_data *data, struct bap_ep *ep,
+ 						bap_io_disconnected, ep);
+ 
+ 	ep->io = io;
++	ep->cig_active = !defer;
+ 
+ 	bt_bap_stream_io_connecting(stream, g_io_channel_unix_get_fd(io));
+ }
+-- 
+cgit 
+

diff --git a/net-wireless/bluez/files/bluez-5.68-bap-nonzero.patch b/net-wireless/bluez/files/bluez-5.68-bap-nonzero.patch
new file mode 100644
index 000000000000..3a7ddd3c6f2a
--- /dev/null
+++ b/net-wireless/bluez/files/bluez-5.68-bap-nonzero.patch
@@ -0,0 +1,27 @@
+From 8fd0c76b41d35e24e10e45fcf57262482cb978a2 Mon Sep 17 00:00:00 2001
+From: Pauli Virtanen <pav@iki.fi>
+Date: Sun, 2 Jul 2023 22:34:19 +0300
+Subject: shared/bap: use only nonzero req->id
+
+In bap_req_new, use same pattern as elsewhere to not use zero as
+a valid id.
+---
+ src/shared/bap.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/shared/bap.c b/src/shared/bap.c
+index cf5d810bba..a0f5a0ae3c 100644
+--- a/src/shared/bap.c
++++ b/src/shared/bap.c
+@@ -4306,7 +4306,7 @@ static struct bt_bap_req *bap_req_new(struct bt_bap_stream *stream,
+ 	static unsigned int id;
+ 
+ 	req = new0(struct bt_bap_req, 1);
+-	req->id = ++id;
++	req->id = ++id ? id : ++id;
+ 	req->stream = stream;
+ 	req->op = op;
+ 	req->iov = util_iov_dup(iov, len);
+-- 
+cgit 
+

diff --git a/net-wireless/bluez/files/bluez-5.68-bap-resume.patch b/net-wireless/bluez/files/bluez-5.68-bap-resume.patch
new file mode 100644
index 000000000000..fbc2eeda89cc
--- /dev/null
+++ b/net-wireless/bluez/files/bluez-5.68-bap-resume.patch
@@ -0,0 +1,187 @@
+From 466fce0209a3878512672159168943047a9e2323 Mon Sep 17 00:00:00 2001
+From: Pauli Virtanen <pav@iki.fi>
+Date: Sun, 2 Jul 2023 22:34:18 +0300
+Subject: transport: handle BAP Enabling state correctly when resuming
+
+If BAP stream is in Enabling state when transport acquire is attempted,
+we should wait for bap_state_changed to emit the completion event.
+
+transport->resume() is only called with new owner with no
+owner->pending, and shall return nonzero completion id on success.
+Currently if BAP stream is Enabling, it returns zero which fails the
+acquire operation.
+
+To fix this, return valid completion id in this case instead.  Also keep
+track of the g_idle_add resume id, so that we don't try to give it to
+bt_bap_stream_cancel.
+
+Fixes sound server getting spurious Not Authorized errors when trying to
+acquire a pending transport.  This can happen on BAP server: linked
+transports become pending when the first of the two enters Streaming. If
+sound server tries to acquire the other linked transport whose stream is
+still Enabling, the acquire fails (media_owner_free +
+btd_error_not_authorized).
+
+Log:
+===============================================================
+profiles/audio/transport.c:bap_state_changed() stream 0x25c2880: qos(2) -> enabling(3)
+...
+profiles/audio/transport.c:bap_state_changed() stream 0x25cc590: qos(2) -> enabling(3)
+...
+src/shared/bap.c:bap_stream_state_changed() stream 0x25cc590 dir 0x01: enabling -> streaming
+profiles/audio/bap.c:bap_state() stream 0x25cc590: enabling(3) -> streaming(4)
+profiles/audio/transport.c:bap_state_changed() stream 0x25cc590: enabling(3) -> streaming(4)
+/org/bluez/hci0/dev_XX_XX_XX_XX_XX_XX/fd1: fd(36) ready
+profiles/audio/transport.c:transport_update_playing() /org/bluez/hci0/dev_XX_XX_XX_XX_XX_XX/fd1 State=TRANSPORT_STATE_IDLE Playing=1
+profiles/audio/transport.c:transport_set_state() State changed /org/bluez/hci0/dev_XX_XX_XX_XX_XX_XX/fd1: TRANSPORT_STATE_IDLE -> TRANSPORT_STATE_PENDING
+profiles/audio/transport.c:transport_set_state() State changed /org/bluez/hci0/dev_XX_XX_XX_XX_XX_XX/fd0: TRANSPORT_STATE_IDLE -> TRANSPORT_STATE_PENDING
+profiles/audio/transport.c:media_owner_create() Owner created: sender=:1.1242
+profiles/audio/transport.c:media_owner_free() Owner :1.1242
+===============================================================
+---
+ profiles/audio/transport.c | 67 +++++++++++++++++++++++++++++++++++++---------
+ 1 file changed, 55 insertions(+), 12 deletions(-)
+
+diff --git a/profiles/audio/transport.c b/profiles/audio/transport.c
+index 77216e10b3..aa3a718b0f 100644
+--- a/profiles/audio/transport.c
++++ b/profiles/audio/transport.c
+@@ -86,6 +86,7 @@ struct bap_transport {
+ 	unsigned int		state_id;
+ 	bool			linked;
+ 	struct bt_bap_qos	qos;
++	guint			resume_id;
+ };
+ 
+ struct media_transport {
+@@ -1191,17 +1192,27 @@ static void bap_enable_complete(struct bt_bap_stream *stream,
+ 		media_transport_remove_owner(owner->transport);
+ }
+ 
+-static gboolean resume_complete(void *data)
++static void bap_resume_complete(struct media_transport *transport)
+ {
+-	struct media_transport *transport = data;
++	struct bap_transport *bap = transport->data;
+ 	struct media_owner *owner = transport->owner;
+ 
++	DBG("stream %p owner %p resume complete", bap->stream, owner);
++
++	if (bap->resume_id) {
++		g_source_remove(bap->resume_id);
++		bap->resume_id = 0;
++	}
++
+ 	if (!owner)
+-		return FALSE;
++		return;
++
++	if (owner->pending)
++		owner->pending->id = 0;
+ 
+ 	if (transport->fd < 0) {
+ 		media_transport_remove_owner(transport);
+-		return FALSE;
++		return;
+ 	}
+ 
+ 	if (owner->pending) {
+@@ -1215,15 +1226,13 @@ static gboolean resume_complete(void *data)
+ 						DBUS_TYPE_INVALID);
+ 		if (!ret) {
+ 			media_transport_remove_owner(transport);
+-			return FALSE;
++			return;
+ 		}
+ 	}
+ 
+ 	media_owner_remove(owner);
+ 
+ 	transport_set_state(transport, TRANSPORT_STATE_ACTIVE);
+-
+-	return FALSE;
+ }
+ 
+ static void bap_update_links(const struct media_transport *transport);
+@@ -1306,6 +1315,32 @@ static void bap_update_qos(const struct media_transport *transport)
+ 			"Delay");
+ }
+ 
++static gboolean bap_resume_complete_cb(void *data)
++{
++	struct media_transport *transport = data;
++	struct bap_transport *bap = transport->data;
++
++	bap->resume_id = 0;
++	bap_resume_complete(transport);
++	return FALSE;
++}
++
++static gboolean bap_resume_wait_cb(void *data)
++{
++	struct media_transport *transport = data;
++	struct bap_transport *bap = transport->data;
++	struct media_owner *owner = transport->owner;
++
++	/* bap_state_changed will call completion callback when ready */
++	DBG("stream %p owner %p resume wait", bap->stream, owner);
++
++	bap->resume_id = 0;
++	if (owner && owner->pending)
++		owner->pending->id = 0;
++
++	return FALSE;
++}
++
+ static guint resume_bap(struct media_transport *transport,
+ 				struct media_owner *owner)
+ {
+@@ -1315,17 +1350,19 @@ static guint resume_bap(struct media_transport *transport,
+ 
+ 	if (!bap->stream)
+ 		return 0;
++	if (bap->resume_id)
++		return 0;
+ 
+ 	bap_update_links(transport);
+ 
+ 	switch (bt_bap_stream_get_state(bap->stream)) {
+ 	case BT_BAP_STREAM_STATE_ENABLING:
+ 		bap_enable_complete(bap->stream, 0x00, 0x00, owner);
+-		if (owner->pending)
+-			return owner->pending->id;
+-		return 0;
++		bap->resume_id = g_idle_add(bap_resume_wait_cb, transport);
++		return bap->resume_id;
+ 	case BT_BAP_STREAM_STATE_STREAMING:
+-		return g_idle_add(resume_complete, transport);
++		bap->resume_id = g_idle_add(bap_resume_complete_cb, transport);
++		return bap->resume_id;
+ 	}
+ 
+ 	meta = bt_bap_stream_get_metadata(bap->stream);
+@@ -1389,6 +1426,12 @@ static void cancel_bap(struct media_transport *transport, guint id)
+ {
+ 	struct bap_transport *bap = transport->data;
+ 
++	if (id == bap->resume_id && bap->resume_id) {
++		g_source_remove(bap->resume_id);
++		bap->resume_id = 0;
++		return;
++	}
++
+ 	if (!bap->stream)
+ 		return;
+ 
+@@ -1491,7 +1534,7 @@ static void bap_state_changed(struct bt_bap_stream *stream, uint8_t old_state,
+ 	transport_update_playing(transport, TRUE);
+ 
+ done:
+-	resume_complete(transport);
++	bap_resume_complete(transport);
+ }
+ 
+ static void bap_connecting(struct bt_bap_stream *stream, bool state, int fd,
+-- 
+cgit 
+

diff --git a/net-wireless/bluez/files/bluez-5.68-heap-use-after-free.patch b/net-wireless/bluez/files/bluez-5.68-heap-use-after-free.patch
new file mode 100644
index 000000000000..3cc6733634a5
--- /dev/null
+++ b/net-wireless/bluez/files/bluez-5.68-heap-use-after-free.patch
@@ -0,0 +1,41 @@
+From b741460688925448807c7532fe96182e4d32ec42 Mon Sep 17 00:00:00 2001
+From: Vlad Pruteanu <vlad.pruteanu@nxp.com>
+Date: Tue, 4 Jul 2023 08:56:43 +0300
+Subject: plugins/admin: Fix heap-use-after-free when using 2 controllers
+
+This commit fixes the heap-use-after-free error when connecting 2
+controllers. When a controller is connected
+admin_policy_adapter_probe is called. If policy_data was already
+allocated it gets freed, if not, it only gets allocated. Eventually
+add_interface is called. Here policy_data is put in the "data" variable
+(specific for each controller) and the process_changes task is called
+with idle priority. This function ultimately accesses policy_data from
+the "data" variable.
+
+When Bluez crashes the flow is:
+1)first controller is attached
+2)admin_policy_adapter_probe is called and policy_data is allocated
+4)second controller is attached
+5)admin_policy_adapter_probe is called and policy_data is freed, then
+allocated again
+6)process_changes runs and the policy_data for the first controller is
+read, but it was already freed, thus the crash
+---
+ plugins/admin.c | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/plugins/admin.c b/plugins/admin.c
+index 68e9237d3f..16b74cfbf0 100644
+--- a/plugins/admin.c
++++ b/plugins/admin.c
+@@ -502,7 +502,6 @@ static int admin_policy_adapter_probe(struct btd_adapter *adapter)
+ 	if (policy_data) {
+ 		btd_warn(policy_data->adapter_id,
+ 						"Policy data already exists");
+-		admin_policy_free(policy_data);
+ 		policy_data = NULL;
+ 	}
+ 
+-- 
+cgit 
+

diff --git a/net-wireless/bluez/files/bluez-5.68-monitor-decoding.patch b/net-wireless/bluez/files/bluez-5.68-monitor-decoding.patch
new file mode 100644
index 000000000000..6d5c6306ccd3
--- /dev/null
+++ b/net-wireless/bluez/files/bluez-5.68-monitor-decoding.patch
@@ -0,0 +1,45 @@
+From f9557931ad361e08f1f1537ea670fedd1dd0138d Mon Sep 17 00:00:00 2001
+From: Claudia Draghicescu <claudia.rosu@nxp.com>
+Date: Tue, 4 Jul 2023 10:41:44 +0300
+Subject: monitor: Add decoding support for Sync Receiver events
+
+This commit adds decoding support for PA Sync Established,
+BIG Sync Established and BIG Sync Lost events.
+---
+ lib/mgmt.h       | 3 +++
+ monitor/packet.c | 5 +++++
+ 2 files changed, 8 insertions(+)
+
+diff --git a/lib/mgmt.h b/lib/mgmt.h
+index 062fa02712..8f92b77315 100644
+--- a/lib/mgmt.h
++++ b/lib/mgmt.h
+@@ -1238,6 +1238,9 @@ static const char *mgmt_ev[] = {
+ 	"Advertisement Monitor Device Lost",
+ 	"Mesh Packet Found",
+ 	"Mesh Packet Complete",
++	"PA Sync Established",
++	"BIG Sync Established",
++	"BIG Sync Lost",
+ };
+ 
+ static const char *mgmt_status[] = {
+diff --git a/monitor/packet.c b/monitor/packet.c
+index a871c7f272..f2167fb52a 100644
+--- a/monitor/packet.c
++++ b/monitor/packet.c
+@@ -3093,6 +3093,11 @@ static const struct bitfield_data events_le_table[] = {
+ 	{ 27, "LE Terminate BIG Complete"		},
+ 	{ 28, "LE BIG Sync Estabilished Complete"	},
+ 	{ 29, "LE BIG Sync Lost"			},
++	{ 30, "LE Request Peer SCA Complete"},
++	{ 31, "LE Path Loss Threshold"		},
++	{ 32, "LE Transmit Power Reporting"	},
++	{ 33, "LE BIG Info Advertising Report"	},
++	{ 34, "LE Subrate Change"			},
+ 	{ }
+ };
+ 
+-- 
+cgit 
+


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-wireless/bluez/, net-wireless/bluez/files/
@ 2023-08-23 14:49 Pacho Ramos
  0 siblings, 0 replies; 22+ messages in thread
From: Pacho Ramos @ 2023-08-23 14:49 UTC (permalink / raw
  To: gentoo-commits

commit:     1b355098341147c4b48ccec16186a7a157a7cbfd
Author:     Pacho Ramos <pacho <AT> gentoo <DOT> org>
AuthorDate: Wed Aug 23 14:27:39 2023 +0000
Commit:     Pacho Ramos <pacho <AT> gentoo <DOT> org>
CommitDate: Wed Aug 23 14:48:34 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1b355098

net-wireless/bluez: Fix compilation with clang

Thanks-to: Luca Santarelli
Closes: https://bugs.gentoo.org/912464
Signed-off-by: Pacho Ramos <pacho <AT> gentoo.org>

 net-wireless/bluez/bluez-5.68.ebuild               |  1 +
 .../bluez/files/bluez-5.68-clang-midi.patch        | 83 ++++++++++++++++++++++
 2 files changed, 84 insertions(+)

diff --git a/net-wireless/bluez/bluez-5.68.ebuild b/net-wireless/bluez/bluez-5.68.ebuild
index ef9003114ac9..37f02d578577 100644
--- a/net-wireless/bluez/bluez-5.68.ebuild
+++ b/net-wireless/bluez/bluez-5.68.ebuild
@@ -78,6 +78,7 @@ PATCHES=(
 	"${FILESDIR}"/${P}-bap-ebusy-fix.patch
 	"${FILESDIR}"/${P}-monitor-decoding.patch
 	"${FILESDIR}"/${P}-heap-use-after-free.patch
+	"${FILESDIR}"/${P}-clang-midi.patch
 )
 
 pkg_setup() {

diff --git a/net-wireless/bluez/files/bluez-5.68-clang-midi.patch b/net-wireless/bluez/files/bluez-5.68-clang-midi.patch
new file mode 100644
index 000000000000..f62d9f395944
--- /dev/null
+++ b/net-wireless/bluez/files/bluez-5.68-clang-midi.patch
@@ -0,0 +1,83 @@
+From b9e93e01161cf5392f0cbea3400cfa2dae54643d Mon Sep 17 00:00:00 2001
+From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
+Date: Mon, 17 Jul 2023 12:36:15 -0700
+Subject: midi: Fix build errors
+
+This fixes the following build errors:
+
+unit/test-midi.c:541:82: error: function definition is not allowed here
+void compare_events_cb(const struct midi_write_parser *parser,
+					void *user_data) {
+							 ^
+unit/test-midi.c:587:17: error: use of undeclared identifier
+'compare_events_cb'; did you mean 'compare_events'?
+                                     compare_events_cb, &midi_data);
+                                     ^~~~~~~~~~~~~~~~~
+                                     compare_events
+
+profiles/midi/midi.c:61:75: error: function definition is not allowed
+here
+void foreach_cb(const struct midi_write_parser *parser, void *user_data) {
+                                                                         ^
+profiles/midi/midi.c:78:40: error: use of undeclared identifier 'foreach_cb'
+                midi_read_ev(&midi->midi_out, event, foreach_cb, midi);
+                                                     ^
+---
+ profiles/midi/midi.c | 27 ++++++++++++++-------------
+ 1 file changed, 14 insertions(+), 13 deletions(-)
+
+(limited to 'profiles/midi/midi.c')
+
+diff --git a/profiles/midi/midi.c b/profiles/midi/midi.c
+index 40064df3ae..bab309bca7 100644
+--- a/profiles/midi/midi.c
++++ b/profiles/midi/midi.c
+@@ -53,20 +53,21 @@ struct midi {
+ 	struct midi_write_parser midi_out;
+ };
+ 
++static void foreach_cb(const struct midi_write_parser *parser, void *user_data)
++{
++	struct midi *midi = user_data;
++
++	bt_gatt_client_write_without_response(midi->client,
++						midi->midi_io_handle, false,
++						midi_write_data(parser),
++						midi_write_data_size(parser));
++}
++
+ static bool midi_write_cb(struct io *io, void *user_data)
+ {
+ 	struct midi *midi = user_data;
+ 	int err;
+ 
+-	void foreach_cb(const struct midi_write_parser *parser, void *user_data) {
+-		struct midi *midi = user_data;
+-		bt_gatt_client_write_without_response(midi->client,
+-		                                      midi->midi_io_handle,
+-		                                      false,
+-		                                      midi_write_data(parser),
+-		                                      midi_write_data_size(parser));
+-	};
+-
+ 	do {
+ 		snd_seq_event_t *event = NULL;
+ 
+@@ -81,10 +82,10 @@ static bool midi_write_cb(struct io *io, void *user_data)
+ 
+ 	if (midi_write_has_data(&midi->midi_out))
+ 		bt_gatt_client_write_without_response(midi->client,
+-		                                      midi->midi_io_handle,
+-		                                      false,
+-		                                      midi_write_data(&midi->midi_out),
+-		                                      midi_write_data_size(&midi->midi_out));
++					midi->midi_io_handle,
++					false,
++					midi_write_data(&midi->midi_out),
++					midi_write_data_size(&midi->midi_out));
+ 
+ 	midi_write_reset(&midi->midi_out);
+ 
+-- 
+cgit 
+


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-wireless/bluez/, net-wireless/bluez/files/
@ 2024-06-16 11:40 Pacho Ramos
  0 siblings, 0 replies; 22+ messages in thread
From: Pacho Ramos @ 2024-06-16 11:40 UTC (permalink / raw
  To: gentoo-commits

commit:     35d1d500096a15b18a8ad9b22df93af5419d9a9b
Author:     Pacho Ramos <pacho <AT> gentoo <DOT> org>
AuthorDate: Sun Jun 16 11:40:21 2024 +0000
Commit:     Pacho Ramos <pacho <AT> gentoo <DOT> org>
CommitDate: Sun Jun 16 11:40:33 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=35d1d500

net-wireless/bluez: drop 5.72, 5.73-r1, 5.75

Signed-off-by: Pacho Ramos <pacho <AT> gentoo.org>

 net-wireless/bluez/Manifest                        |   3 -
 net-wireless/bluez/bluez-5.72.ebuild               | 288 ---------------------
 net-wireless/bluez/bluez-5.73-r1.ebuild            | 278 --------------------
 net-wireless/bluez/bluez-5.75.ebuild               | 278 --------------------
 ...xd-without-systemd-in-the-user-session-r2.patch |  58 -----
 .../bluez-5.66-power-state-adapter-property.patch  |  28 --
 6 files changed, 933 deletions(-)

diff --git a/net-wireless/bluez/Manifest b/net-wireless/bluez/Manifest
index ef6d8301439d..822822529f6c 100644
--- a/net-wireless/bluez/Manifest
+++ b/net-wireless/bluez/Manifest
@@ -1,4 +1 @@
-DIST bluez-5.72.tar.xz 2390792 BLAKE2B b5d1bc290c9bad5aa32de16433c34d0ac5aed7164077ef941a0bf90eddc5e22a6cf19f972bcae33061b41e3c344f7abeb65a11b6013c13fd53059ac93d83240a SHA512 1c6560f60ac0654d7c25ed8ab2f0f3a3a9ca8688ee28e1c476ffc7ae38737e739d27bbb88789c86b03fc600a8a68496d90a7b395ec393dd2bbf69be62357991a
-DIST bluez-5.73.tar.xz 2408088 BLAKE2B 69c5b8c23039108403631da86c29d62869f2311bb34eeb471779fae094bbf8738193389fb8792b779b10eaeca5b02723c86f2b98c435bbd2c23a3d317df76070 SHA512 20090da036d3d614706b14a757b02acf138859d8f0476aa7f68d57635dfb3632ce7d8bb3456320904d72333d1314a5fe14dcb8ece307e6d31ce6d2d516de25e8
-DIST bluez-5.75.tar.xz 2414552 BLAKE2B 5100995421114d850c1b1bd19188f7ee193c262dd79b45788de5d9ba0f260c3c096c724b1077f7cf6e846d13fd2f0a8a7c7a5014457c2928e5acbaa73ba40853 SHA512 f5fdad3824ed094d944d33f3d116c045e69d593a2b4dae5e57feeb5625a13e024e2433a3178921d2f8e1bd8261794ecdfc25ff3e52672e6e8d42e85b33a735a4
 DIST bluez-5.76.tar.xz 2418848 BLAKE2B 658e67ec3ac568fd4d8bdc434eabfc63fd8cddd287f7cf6a8967771673e79fe95c509be654ae2495d1b3aedb1e23ca710d545f5ded281a64fd44058b0cdf7afe SHA512 30dc3faef74a2225fd6027178376dca4166082d1ed5188021e13d13582db5846aef60b753f173d525bfd0c040f26c3e7dab0283ecafbd34c4a06855d13abb389

diff --git a/net-wireless/bluez/bluez-5.72.ebuild b/net-wireless/bluez/bluez-5.72.ebuild
deleted file mode 100644
index 06b68087328b..000000000000
--- a/net-wireless/bluez/bluez-5.72.ebuild
+++ /dev/null
@@ -1,288 +0,0 @@
-# Copyright 1999-2024 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-PYTHON_COMPAT=( python3_{9..12} )
-
-inherit autotools flag-o-matic 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 https://github.com/bluez/bluez"
-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 ~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
-# change in the future, hence, this REQUIRED_USE constraint could be dropped
-# again in the future.
-# btpclient needs mesh, bug #790587
-REQUIRED_USE="
-	btpclient? ( mesh )
-	extra-tools? ( deprecated readline )
-	test? ( ${PYTHON_REQUIRED_USE} )
-	test-programs? ( ${PYTHON_REQUIRED_USE} )
-"
-
-TEST_DEPS="${PYTHON_DEPS}
-	$(python_gen_cond_dep '
-		>=dev-python/dbus-python-1[${PYTHON_USEDEP}]
-		dev-python/pygobject:3[${PYTHON_USEDEP}]
-	')
-"
-BDEPEND="
-	dev-python/docutils
-	virtual/pkgconfig
-	test? ( ${TEST_DEPS} )
-"
-DEPEND="
-	>=dev-libs/glib-2.28:2[${MULTILIB_USEDEP}]
-	btpclient? ( >=dev-libs/ell-0.39 )
-	cups? ( net-print/cups:= )
-	mesh? (
-		>=dev-libs/ell-0.39
-		>=dev-libs/json-c-0.13:=
-		sys-libs/readline:0=
-	)
-	midi? ( media-libs/alsa-lib )
-	obex? ( dev-libs/libical:= )
-	readline? ( sys-libs/readline:0= )
-	systemd? ( sys-apps/systemd )
-	>=sys-apps/dbus-1.6:=
-	udev? ( >=virtual/udev-172 )
-"
-RDEPEND="${DEPEND}
-	selinux? ( sec-policy/selinux-bluetooth )
-	test-programs? ( ${TEST_DEPS} )
-"
-
-RESTRICT="!test? ( test )"
-
-PATCHES=(
-	# Try both udevadm paths to cover udev/systemd vs. eudev locations (#539844)
-	# http://www.spinics.net/lists/linux-bluetooth/msg58739.html
-	# https://bugs.gentoo.org/539844
-	# https://github.com/bluez/bluez/issues/268
-	"${FILESDIR}"/${PN}-udevadm-path-r1.patch
-
-	# Fedora patches
-	# https://lore.kernel.org/linux-bluetooth/20220901110719.176944-1-hadess@hadess.net/T/#m9c08d004cd5422783ee1d93154f42303bba9169f
-	"${FILESDIR}"/${PN}-5.66-power-state-adapter-property.patch
-)
-
-pkg_setup() {
-	# From http://www.linuxfromscratch.org/blfs/view/svn/general/bluez.html
-	# to prevent bugs like:
-	# https://bugzilla.kernel.org/show_bug.cgi?id=196621
-	CONFIG_CHECK="~NET ~BT ~BT_RFCOMM ~BT_RFCOMM_TTY ~BT_BNEP ~BT_BNEP_MC_FILTER
-		~BT_BNEP_PROTO_FILTER ~BT_HIDP ~CRYPTO_USER_API_HASH ~CRYPTO_USER_API_SKCIPHER
-		~UHID ~RFKILL"
-	# https://bugzilla.kernel.org/show_bug.cgi?id=196621
-	# https://bugzilla.kernel.org/show_bug.cgi?id=206815
-	if use mesh || use test; then
-		CONFIG_CHECK="${CONFIG_CHECK} ~CRYPTO_USER
-		~CRYPTO_USER_API ~CRYPTO_USER_API_AEAD ~CRYPTO_AES ~CRYPTO_CCM ~CRYPTO_AEAD ~CRYPTO_CMAC
-		~CRYPTO_MD5 ~CRYPTO_SHA1 ~KEY_DH_OPERATIONS"
-	fi
-	linux-info_pkg_setup
-
-	if use test || use test-programs; then
-		python-single-r1_pkg_setup
-	fi
-
-	if ! use udev; then
-		ewarn
-		ewarn "You are installing ${PN} with USE=-udev. This means various bluetooth"
-		ewarn "devices and adapters from Apple, Dell, Logitech etc. will not work,"
-		ewarn "and hid2hci will not be available."
-		ewarn
-	fi
-}
-
-src_prepare() {
-	default
-
-	# http://www.spinics.net/lists/linux-bluetooth/msg38490.html
-	if ! use systemd; then
-		eapply "${FILESDIR}"/0001-Allow-using-obexd-without-systemd-in-the-user-session-r2.patch
-	fi
-
-	eautoreconf
-
-	if use cups; then
-		# Only not .am to not need to run eautoreconf only because of this
-		sed -i \
-			-e "s:cupsdir = \$(libdir)/cups:cupsdir = $(cups-config --serverbin):" \
-			Makefile.{in,tools} || die
-	fi
-
-	multilib_copy_sources
-}
-
-multilib_src_configure() {
-	# unit/test-vcp test fails with LTO (bug #925745)
-	filter-lto
-
-	local myconf=(
-		# readline is automagic when client is enabled
-		# --enable-client always needs readline, bug #504038
-		# --enable-mesh is handled in the same way
-		ac_cv_header_readline_readline_h=$(multilib_native_usex readline)
-		ac_cv_header_readline_readline_h=$(multilib_native_usex mesh)
-	)
-
-	if ! multilib_is_native_abi; then
-		myconf+=(
-			# deps not used for the library
-			{DBUS,GLIB}_{CFLAGS,LIBS}=' '
-		)
-	fi
-
-	econf \
-		--localstatedir=/var \
-		--disable-android \
-		--enable-datafiles \
-		--enable-optimization \
-		$(use_enable debug) \
-		--enable-pie \
-		--enable-threads \
-		--enable-library \
-		--enable-tools \
-		--enable-manpages \
-		--enable-monitor \
-		--with-systemdsystemunitdir="$(systemd_get_systemunitdir)" \
-		--with-systemduserunitdir="$(systemd_get_userunitdir)" \
-		$(multilib_native_use_enable btpclient) \
-		$(multilib_native_use_enable btpclient external-ell) \
-		$(multilib_native_use_enable cups) \
-		$(multilib_native_use_enable deprecated) \
-		$(multilib_native_use_enable experimental) \
-		$(multilib_native_use_enable mesh) \
-		$(multilib_native_use_enable mesh external-ell) \
-		$(multilib_native_use_enable midi) \
-		$(multilib_native_use_enable obex) \
-		$(multilib_native_use_enable readline client) \
-		$(multilib_native_use_enable systemd) \
-		$(multilib_native_use_enable test-programs test) \
-		$(multilib_native_use_enable udev) \
-		$(multilib_native_use_enable udev hid2hci) \
-		$(multilib_native_use_enable udev sixaxis)
-}
-
-multilib_src_compile() {
-	if multilib_is_native_abi; then
-		default
-	else
-		emake -f Makefile -f - libs \
-			<<<'libs: $(lib_LTLIBRARIES)'
-	fi
-}
-
-multilib_src_test() {
-	multilib_is_native_abi && default
-}
-
-multilib_src_install() {
-	if multilib_is_native_abi; then
-		emake DESTDIR="${D}" install
-
-		# Only install extra-tools when relevant USE flag is enabled
-		if use extra-tools; then
-			ewarn "Upstream doesn't support using this tools and their bugs are"
-			ewarn "likely to be ignored forever, also they can break without"
-			ewarn "previous announcement."
-			ewarn "Upstream also states all this tools are not really needed,"
-			ewarn "then, if you still need to rely on them, you must ask them"
-			ewarn "to either install that tool by default or add the needed"
-			ewarn "functionality to the existing 'official' tools."
-			ewarn "Please report this issues to:"
-			ewarn "http://www.bluez.org/development/lists/"
-
-			# Upstream doesn't install this, bug #524640
-			# http://permalink.gmane.org/gmane.linux.bluez.kernel/53115
-			# http://comments.gmane.org/gmane.linux.bluez.kernel/54564
-			dobin tools/btmgmt
-			# gatttool is only built with readline, bug #530776
-			# https://bugzilla.redhat.com/show_bug.cgi?id=1141909
-			# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=720486
-			# https://bugs.archlinux.org/task/37686
-			dobin attrib/gatttool
-			# https://bugzilla.redhat.com/show_bug.cgi?id=1699680
-			dobin tools/avinfo
-		fi
-
-		# Not installed by default after being built, bug #666756
-		use btpclient && dobin tools/btpclient
-
-		# Unittests are not that useful once installed, so make them optional
-		if use test-programs; then
-			# Drop python2 only test tools
-			# https://bugzilla.kernel.org/show_bug.cgi?id=206819
-			rm "${ED}"/usr/$(get_libdir)/bluez/test/simple-player || die
-			# https://bugzilla.kernel.org/show_bug.cgi?id=206821
-			rm "${ED}"/usr/$(get_libdir)/bluez/test/test-hfp || die
-			# https://bugzilla.kernel.org/show_bug.cgi?id=206823
-			rm "${ED}"/usr/$(get_libdir)/bluez/test/test-sap-server	|| die
-
-			python_fix_shebang "${ED}"/usr/$(get_libdir)/bluez/test
-
-			for i in $(find "${ED}"/usr/$(get_libdir)/bluez/test -maxdepth 1 -type f ! -name "*.*"); do
-				dosym "${i}" /usr/bin/bluez-"${i##*/}"
-			done
-		fi
-	else
-		emake DESTDIR="${D}" \
-			install-pkgincludeHEADERS \
-			install-libLTLIBRARIES \
-			install-pkgconfigDATA
-	fi
-}
-
-multilib_src_install_all() {
-	# We need to ensure obexd can be spawned automatically by systemd
-	# when user-session is enabled:
-	# http://marc.info/?l=linux-bluetooth&m=148096094716386&w=2
-	# https://bugs.gentoo.org/show_bug.cgi?id=577842
-	# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=804908
-	# https://bugs.archlinux.org/task/45816
-	# https://bugzilla.redhat.com/show_bug.cgi?id=1318441
-	# https://bugzilla.redhat.com/show_bug.cgi?id=1389347
-	if use systemd; then
-		dosym obex.service /usr/lib/systemd/user/dbus-org.bluez.obex.service
-	fi
-
-	find "${D}" -name '*.la' -type f -delete || die
-
-	keepdir /var/lib/bluetooth
-
-	# Upstream don't want people to play with them
-	# But we keep installing them due to 'historical' reasons
-	insinto /etc/bluetooth
-	local d
-	for d in input network; do
-		doins profiles/${d}/${d}.conf
-	done
-	# Setup auto enable as Fedora does for allowing to use
-	# keyboards/mouse as soon as possible
-	sed -i 's/#\[Policy\]$/\[Policy\]/; s/#AutoEnable=false/AutoEnable=true/' src/main.conf || die
-	doins src/main.conf
-
-	newinitd "${FILESDIR}"/bluetooth-init.d-r5 bluetooth
-	newconfd "${FILESDIR}"/bluetooth-conf.d bluetooth
-
-	einstalldocs
-	use doc && dodoc doc/*.txt
-}
-
-pkg_postinst() {
-	use udev && udev_reload
-	systemd_reenable bluetooth.service
-
-	has_version net-dialup/ppp || elog "To use dial up networking you must install net-dialup/ppp"
-}
-
-pkg_postrm() {
-	use udev && udev_reload
-}

diff --git a/net-wireless/bluez/bluez-5.73-r1.ebuild b/net-wireless/bluez/bluez-5.73-r1.ebuild
deleted file mode 100644
index d67e578fb3ef..000000000000
--- a/net-wireless/bluez/bluez-5.73-r1.ebuild
+++ /dev/null
@@ -1,278 +0,0 @@
-# Copyright 1999-2024 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-PYTHON_COMPAT=( python3_{9..12} )
-
-inherit autotools flag-o-matic 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 https://github.com/bluez/bluez"
-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 ~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
-# change in the future, hence, this REQUIRED_USE constraint could be dropped
-# again in the future.
-# btpclient needs mesh, bug #790587
-REQUIRED_USE="
-	btpclient? ( mesh )
-	extra-tools? ( deprecated readline )
-	test? ( ${PYTHON_REQUIRED_USE} )
-	test-programs? ( ${PYTHON_REQUIRED_USE} )
-"
-
-TEST_DEPS="${PYTHON_DEPS}
-	$(python_gen_cond_dep '
-		>=dev-python/dbus-python-1[${PYTHON_USEDEP}]
-		dev-python/pygobject:3[${PYTHON_USEDEP}]
-	')
-"
-BDEPEND="
-	dev-python/docutils
-	virtual/pkgconfig
-	test? ( ${TEST_DEPS} )
-"
-DEPEND="
-	>=dev-libs/glib-2.28:2[${MULTILIB_USEDEP}]
-	btpclient? ( >=dev-libs/ell-0.39 )
-	cups? ( net-print/cups:= )
-	mesh? (
-		>=dev-libs/ell-0.39
-		>=dev-libs/json-c-0.13:=
-		sys-libs/readline:0=
-	)
-	midi? ( media-libs/alsa-lib )
-	obex? ( dev-libs/libical:= )
-	readline? ( sys-libs/readline:0= )
-	systemd? ( sys-apps/systemd )
-	>=sys-apps/dbus-1.6:=
-	udev? ( >=virtual/udev-196 )
-"
-RDEPEND="${DEPEND}
-	selinux? ( sec-policy/selinux-bluetooth )
-	test-programs? ( ${TEST_DEPS} )
-"
-
-RESTRICT="!test? ( test )"
-
-PATCHES=(
-	# Try both udevadm paths to cover udev/systemd vs. eudev locations (#539844)
-	# http://www.spinics.net/lists/linux-bluetooth/msg58739.html
-	# https://bugs.gentoo.org/539844
-	# https://github.com/bluez/bluez/issues/268
-	"${FILESDIR}"/${PN}-udevadm-path-r1.patch
-)
-
-pkg_setup() {
-	# From http://www.linuxfromscratch.org/blfs/view/svn/general/bluez.html
-	# to prevent bugs like:
-	# https://bugzilla.kernel.org/show_bug.cgi?id=196621
-	CONFIG_CHECK="~NET ~BT ~BT_RFCOMM ~BT_RFCOMM_TTY ~BT_BNEP ~BT_BNEP_MC_FILTER
-		~BT_BNEP_PROTO_FILTER ~BT_HIDP ~CRYPTO_USER_API_HASH ~CRYPTO_USER_API_SKCIPHER
-		~UHID ~RFKILL"
-	# https://bugzilla.kernel.org/show_bug.cgi?id=196621
-	# https://bugzilla.kernel.org/show_bug.cgi?id=206815
-	if use mesh || use test; then
-		CONFIG_CHECK="${CONFIG_CHECK} ~CRYPTO_USER
-		~CRYPTO_USER_API ~CRYPTO_USER_API_AEAD ~CRYPTO_AES ~CRYPTO_CCM ~CRYPTO_AEAD ~CRYPTO_CMAC
-		~CRYPTO_MD5 ~CRYPTO_SHA1 ~KEY_DH_OPERATIONS"
-	fi
-	linux-info_pkg_setup
-
-	if use test || use test-programs; then
-		python-single-r1_pkg_setup
-	fi
-
-	if ! use udev; then
-		ewarn
-		ewarn "You are installing ${PN} with USE=-udev. This means various bluetooth"
-		ewarn "devices and adapters from Apple, Dell, Logitech etc. will not work,"
-		ewarn "and hid2hci will not be available."
-		ewarn
-	fi
-}
-
-src_prepare() {
-	default
-
-	# https://github.com/bluez/bluez/issues/773
-	eapply "${FILESDIR}"/${P}-configure-cups.patch
-
-	# https://github.com/bluez/bluez/issues/806
-	eapply "${FILESDIR}"/0001-Allow-using-obexd-without-systemd-in-the-user-session-r3.patch
-
-	eautoreconf
-
-	multilib_copy_sources
-}
-
-multilib_src_configure() {
-	# unit/test-vcp test fails with LTO (bug #925745)
-	filter-lto
-
-	local myconf=(
-		# readline is automagic when client is enabled
-		# --enable-client always needs readline, bug #504038
-		# --enable-mesh is handled in the same way
-		ac_cv_header_readline_readline_h=$(multilib_native_usex readline)
-		ac_cv_header_readline_readline_h=$(multilib_native_usex mesh)
-	)
-
-	if ! multilib_is_native_abi; then
-		myconf+=(
-			# deps not used for the library
-			{DBUS,GLIB}_{CFLAGS,LIBS}=' '
-		)
-	fi
-
-	econf \
-		--localstatedir=/var \
-		--disable-android \
-		--enable-datafiles \
-		--enable-optimization \
-		$(use_enable debug) \
-		--enable-pie \
-		--enable-threads \
-		--enable-library \
-		--enable-tools \
-		--enable-manpages \
-		--enable-monitor \
-		--with-systemdsystemunitdir="$(systemd_get_systemunitdir)" \
-		--with-systemduserunitdir="$(systemd_get_userunitdir)" \
-		$(multilib_native_use_enable btpclient) \
-		$(multilib_native_use_enable btpclient external-ell) \
-		$(multilib_native_use_enable cups) \
-		$(multilib_native_use_enable deprecated) \
-		$(multilib_native_use_enable experimental) \
-		$(multilib_native_use_enable mesh) \
-		$(multilib_native_use_enable mesh external-ell) \
-		$(multilib_native_use_enable midi) \
-		$(multilib_native_use_enable obex) \
-		$(multilib_native_use_enable readline client) \
-		$(multilib_native_use_enable systemd) \
-		$(multilib_native_use_enable test-programs test) \
-		$(multilib_native_use_enable udev) \
-		$(multilib_native_use_enable udev hid2hci) \
-		$(multilib_native_use_enable udev sixaxis)
-}
-
-multilib_src_compile() {
-	if multilib_is_native_abi; then
-		default
-	else
-		emake -f Makefile -f - libs \
-			<<<'libs: $(lib_LTLIBRARIES)'
-	fi
-}
-
-multilib_src_test() {
-	multilib_is_native_abi && default
-}
-
-multilib_src_install() {
-	if multilib_is_native_abi; then
-		emake DESTDIR="${D}" install
-
-		# Only install extra-tools when relevant USE flag is enabled
-		if use extra-tools; then
-			ewarn "Upstream doesn't support using this tools and their bugs are"
-			ewarn "likely to be ignored forever, also they can break without"
-			ewarn "previous announcement."
-			ewarn "Upstream also states all this tools are not really needed,"
-			ewarn "then, if you still need to rely on them, you must ask them"
-			ewarn "to either install that tool by default or add the needed"
-			ewarn "functionality to the existing 'official' tools."
-			ewarn "Please report this issues to:"
-			ewarn "http://www.bluez.org/development/lists/"
-
-			# Upstream doesn't install this, bug #524640
-			# http://permalink.gmane.org/gmane.linux.bluez.kernel/53115
-			# http://comments.gmane.org/gmane.linux.bluez.kernel/54564
-			dobin tools/btmgmt
-			# gatttool is only built with readline, bug #530776
-			# https://bugzilla.redhat.com/show_bug.cgi?id=1141909
-			# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=720486
-			# https://bugs.archlinux.org/task/37686
-			dobin attrib/gatttool
-			# https://bugzilla.redhat.com/show_bug.cgi?id=1699680
-			dobin tools/avinfo
-		fi
-
-		# Not installed by default after being built, bug #666756
-		use btpclient && dobin tools/btpclient
-
-		# Unittests are not that useful once installed, so make them optional
-		if use test-programs; then
-			# Drop python2 only test tools
-			# https://bugzilla.kernel.org/show_bug.cgi?id=206819
-			rm "${ED}"/usr/$(get_libdir)/bluez/test/simple-player || die
-			# https://bugzilla.kernel.org/show_bug.cgi?id=206821
-			rm "${ED}"/usr/$(get_libdir)/bluez/test/test-hfp || die
-			# https://bugzilla.kernel.org/show_bug.cgi?id=206823
-			rm "${ED}"/usr/$(get_libdir)/bluez/test/test-sap-server	|| die
-
-			python_fix_shebang "${ED}"/usr/$(get_libdir)/bluez/test
-
-			for i in $(find "${ED}"/usr/$(get_libdir)/bluez/test -maxdepth 1 -type f ! -name "*.*"); do
-				dosym "${i}" /usr/bin/bluez-"${i##*/}"
-			done
-		fi
-	else
-		emake DESTDIR="${D}" \
-			install-pkgincludeHEADERS \
-			install-libLTLIBRARIES \
-			install-pkgconfigDATA
-	fi
-}
-
-multilib_src_install_all() {
-	# We need to ensure obexd can be spawned automatically by systemd
-	# when user-session is enabled:
-	# http://marc.info/?l=linux-bluetooth&m=148096094716386&w=2
-	# https://bugs.gentoo.org/show_bug.cgi?id=577842
-	# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=804908
-	# https://bugs.archlinux.org/task/45816
-	# https://bugzilla.redhat.com/show_bug.cgi?id=1318441
-	# https://bugzilla.redhat.com/show_bug.cgi?id=1389347
-	if use systemd; then
-		dosym obex.service /usr/lib/systemd/user/dbus-org.bluez.obex.service
-	fi
-
-	find "${D}" -name '*.la' -type f -delete || die
-
-	keepdir /var/lib/bluetooth
-
-	# Upstream don't want people to play with them
-	# But we keep installing them due to 'historical' reasons
-	insinto /etc/bluetooth
-	local d
-	for d in input network; do
-		doins profiles/${d}/${d}.conf
-	done
-	# Setup auto enable as Fedora does for allowing to use
-	# keyboards/mouse as soon as possible
-	sed -i 's/#\[Policy\]$/\[Policy\]/; s/#AutoEnable=false/AutoEnable=true/' src/main.conf || die
-	doins src/main.conf
-
-	newinitd "${FILESDIR}"/bluetooth-init.d-r5 bluetooth
-	newconfd "${FILESDIR}"/bluetooth-conf.d bluetooth
-
-	einstalldocs
-	use doc && dodoc doc/*.txt
-}
-
-pkg_postinst() {
-	use udev && udev_reload
-	systemd_reenable bluetooth.service
-
-	has_version net-dialup/ppp || elog "To use dial up networking you must install net-dialup/ppp"
-}
-
-pkg_postrm() {
-	use udev && udev_reload
-}

diff --git a/net-wireless/bluez/bluez-5.75.ebuild b/net-wireless/bluez/bluez-5.75.ebuild
deleted file mode 100644
index 5903ae635e78..000000000000
--- a/net-wireless/bluez/bluez-5.75.ebuild
+++ /dev/null
@@ -1,278 +0,0 @@
-# Copyright 1999-2024 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-PYTHON_COMPAT=( python3_{9..12} )
-
-inherit autotools flag-o-matic 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 https://github.com/bluez/bluez"
-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 ~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
-# change in the future, hence, this REQUIRED_USE constraint could be dropped
-# again in the future.
-# btpclient needs mesh, bug #790587
-REQUIRED_USE="
-	btpclient? ( mesh )
-	extra-tools? ( deprecated readline )
-	test? ( ${PYTHON_REQUIRED_USE} )
-	test-programs? ( ${PYTHON_REQUIRED_USE} )
-"
-
-TEST_DEPS="${PYTHON_DEPS}
-	$(python_gen_cond_dep '
-		>=dev-python/dbus-python-1[${PYTHON_USEDEP}]
-		dev-python/pygobject:3[${PYTHON_USEDEP}]
-	')
-"
-BDEPEND="
-	dev-python/docutils
-	virtual/pkgconfig
-	test? ( ${TEST_DEPS} )
-"
-DEPEND="
-	>=dev-libs/glib-2.28:2[${MULTILIB_USEDEP}]
-	btpclient? ( >=dev-libs/ell-0.39 )
-	cups? ( net-print/cups:= )
-	mesh? (
-		>=dev-libs/ell-0.39
-		>=dev-libs/json-c-0.13:=
-		sys-libs/readline:0=
-	)
-	midi? ( media-libs/alsa-lib )
-	obex? ( dev-libs/libical:= )
-	readline? ( sys-libs/readline:0= )
-	systemd? ( sys-apps/systemd )
-	>=sys-apps/dbus-1.6:=
-	udev? ( >=virtual/udev-196 )
-"
-RDEPEND="${DEPEND}
-	selinux? ( sec-policy/selinux-bluetooth )
-	test-programs? ( ${TEST_DEPS} )
-"
-
-RESTRICT="!test? ( test )"
-
-PATCHES=(
-	# Try both udevadm paths to cover udev/systemd vs. eudev locations (#539844)
-	# http://www.spinics.net/lists/linux-bluetooth/msg58739.html
-	# https://bugs.gentoo.org/539844
-	# https://github.com/bluez/bluez/issues/268
-	"${FILESDIR}"/${PN}-udevadm-path-r1.patch
-)
-
-pkg_setup() {
-	# From http://www.linuxfromscratch.org/blfs/view/svn/general/bluez.html
-	# to prevent bugs like:
-	# https://bugzilla.kernel.org/show_bug.cgi?id=196621
-	CONFIG_CHECK="~NET ~BT ~BT_RFCOMM ~BT_RFCOMM_TTY ~BT_BNEP ~BT_BNEP_MC_FILTER
-		~BT_BNEP_PROTO_FILTER ~BT_HIDP ~CRYPTO_USER_API_HASH ~CRYPTO_USER_API_SKCIPHER
-		~UHID ~RFKILL"
-	# https://bugzilla.kernel.org/show_bug.cgi?id=196621
-	# https://bugzilla.kernel.org/show_bug.cgi?id=206815
-	if use mesh || use test; then
-		CONFIG_CHECK="${CONFIG_CHECK} ~CRYPTO_USER
-		~CRYPTO_USER_API ~CRYPTO_USER_API_AEAD ~CRYPTO_AES ~CRYPTO_CCM ~CRYPTO_AEAD ~CRYPTO_CMAC
-		~CRYPTO_MD5 ~CRYPTO_SHA1 ~KEY_DH_OPERATIONS"
-	fi
-	linux-info_pkg_setup
-
-	if use test || use test-programs; then
-		python-single-r1_pkg_setup
-	fi
-
-	if ! use udev; then
-		ewarn
-		ewarn "You are installing ${PN} with USE=-udev. This means various bluetooth"
-		ewarn "devices and adapters from Apple, Dell, Logitech etc. will not work,"
-		ewarn "and hid2hci will not be available."
-		ewarn
-	fi
-}
-
-src_prepare() {
-	default
-
-	# https://github.com/bluez/bluez/issues/773
-	eapply "${FILESDIR}"/${PN}-5.73-configure-cups.patch
-
-	# https://github.com/bluez/bluez/issues/806
-	eapply "${FILESDIR}"/0001-Allow-using-obexd-without-systemd-in-the-user-session-r3.patch
-
-	eautoreconf
-
-	multilib_copy_sources
-}
-
-multilib_src_configure() {
-	# unit/test-vcp test fails with LTO (bug #925745)
-	filter-lto
-
-	local myconf=(
-		# readline is automagic when client is enabled
-		# --enable-client always needs readline, bug #504038
-		# --enable-mesh is handled in the same way
-		ac_cv_header_readline_readline_h=$(multilib_native_usex readline)
-		ac_cv_header_readline_readline_h=$(multilib_native_usex mesh)
-	)
-
-	if ! multilib_is_native_abi; then
-		myconf+=(
-			# deps not used for the library
-			{DBUS,GLIB}_{CFLAGS,LIBS}=' '
-		)
-	fi
-
-	econf \
-		--localstatedir=/var \
-		--disable-android \
-		--enable-datafiles \
-		--enable-optimization \
-		$(use_enable debug) \
-		--enable-pie \
-		--enable-threads \
-		--enable-library \
-		--enable-tools \
-		--enable-manpages \
-		--enable-monitor \
-		--with-systemdsystemunitdir="$(systemd_get_systemunitdir)" \
-		--with-systemduserunitdir="$(systemd_get_userunitdir)" \
-		$(multilib_native_use_enable btpclient) \
-		$(multilib_native_use_enable btpclient external-ell) \
-		$(multilib_native_use_enable cups) \
-		$(multilib_native_use_enable deprecated) \
-		$(multilib_native_use_enable experimental) \
-		$(multilib_native_use_enable mesh) \
-		$(multilib_native_use_enable mesh external-ell) \
-		$(multilib_native_use_enable midi) \
-		$(multilib_native_use_enable obex) \
-		$(multilib_native_use_enable readline client) \
-		$(multilib_native_use_enable systemd) \
-		$(multilib_native_use_enable test-programs test) \
-		$(multilib_native_use_enable udev) \
-		$(multilib_native_use_enable udev hid2hci) \
-		$(multilib_native_use_enable udev sixaxis)
-}
-
-multilib_src_compile() {
-	if multilib_is_native_abi; then
-		default
-	else
-		emake -f Makefile -f - libs \
-			<<<'libs: $(lib_LTLIBRARIES)'
-	fi
-}
-
-multilib_src_test() {
-	multilib_is_native_abi && default
-}
-
-multilib_src_install() {
-	if multilib_is_native_abi; then
-		emake DESTDIR="${D}" install
-
-		# Only install extra-tools when relevant USE flag is enabled
-		if use extra-tools; then
-			ewarn "Upstream doesn't support using this tools and their bugs are"
-			ewarn "likely to be ignored forever, also they can break without"
-			ewarn "previous announcement."
-			ewarn "Upstream also states all this tools are not really needed,"
-			ewarn "then, if you still need to rely on them, you must ask them"
-			ewarn "to either install that tool by default or add the needed"
-			ewarn "functionality to the existing 'official' tools."
-			ewarn "Please report this issues to:"
-			ewarn "http://www.bluez.org/development/lists/"
-
-			# Upstream doesn't install this, bug #524640
-			# http://permalink.gmane.org/gmane.linux.bluez.kernel/53115
-			# http://comments.gmane.org/gmane.linux.bluez.kernel/54564
-			dobin tools/btmgmt
-			# gatttool is only built with readline, bug #530776
-			# https://bugzilla.redhat.com/show_bug.cgi?id=1141909
-			# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=720486
-			# https://bugs.archlinux.org/task/37686
-			dobin attrib/gatttool
-			# https://bugzilla.redhat.com/show_bug.cgi?id=1699680
-			dobin tools/avinfo
-		fi
-
-		# Not installed by default after being built, bug #666756
-		use btpclient && dobin tools/btpclient
-
-		# Unittests are not that useful once installed, so make them optional
-		if use test-programs; then
-			# Drop python2 only test tools
-			# https://bugzilla.kernel.org/show_bug.cgi?id=206819
-			rm "${ED}"/usr/$(get_libdir)/bluez/test/simple-player || die
-			# https://bugzilla.kernel.org/show_bug.cgi?id=206821
-			rm "${ED}"/usr/$(get_libdir)/bluez/test/test-hfp || die
-			# https://bugzilla.kernel.org/show_bug.cgi?id=206823
-			rm "${ED}"/usr/$(get_libdir)/bluez/test/test-sap-server	|| die
-
-			python_fix_shebang "${ED}"/usr/$(get_libdir)/bluez/test
-
-			for i in $(find "${ED}"/usr/$(get_libdir)/bluez/test -maxdepth 1 -type f ! -name "*.*"); do
-				dosym "${i}" /usr/bin/bluez-"${i##*/}"
-			done
-		fi
-	else
-		emake DESTDIR="${D}" \
-			install-pkgincludeHEADERS \
-			install-libLTLIBRARIES \
-			install-pkgconfigDATA
-	fi
-}
-
-multilib_src_install_all() {
-	# We need to ensure obexd can be spawned automatically by systemd
-	# when user-session is enabled:
-	# http://marc.info/?l=linux-bluetooth&m=148096094716386&w=2
-	# https://bugs.gentoo.org/show_bug.cgi?id=577842
-	# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=804908
-	# https://bugs.archlinux.org/task/45816
-	# https://bugzilla.redhat.com/show_bug.cgi?id=1318441
-	# https://bugzilla.redhat.com/show_bug.cgi?id=1389347
-	if use systemd; then
-		dosym obex.service /usr/lib/systemd/user/dbus-org.bluez.obex.service
-	fi
-
-	find "${D}" -name '*.la' -type f -delete || die
-
-	keepdir /var/lib/bluetooth
-
-	# Upstream don't want people to play with them
-	# But we keep installing them due to 'historical' reasons
-	insinto /etc/bluetooth
-	local d
-	for d in input network; do
-		doins profiles/${d}/${d}.conf
-	done
-	# Setup auto enable as Fedora does for allowing to use
-	# keyboards/mouse as soon as possible
-	sed -i 's/#\[Policy\]$/\[Policy\]/; s/#AutoEnable=false/AutoEnable=true/' src/main.conf || die
-	doins src/main.conf
-
-	newinitd "${FILESDIR}"/bluetooth-init.d-r5 bluetooth
-	newconfd "${FILESDIR}"/bluetooth-conf.d bluetooth
-
-	einstalldocs
-	use doc && dodoc doc/*.txt
-}
-
-pkg_postinst() {
-	use udev && udev_reload
-	systemd_reenable bluetooth.service
-
-	has_version net-dialup/ppp || elog "To use dial up networking you must install net-dialup/ppp"
-}
-
-pkg_postrm() {
-	use udev && udev_reload
-}

diff --git a/net-wireless/bluez/files/0001-Allow-using-obexd-without-systemd-in-the-user-session-r2.patch b/net-wireless/bluez/files/0001-Allow-using-obexd-without-systemd-in-the-user-session-r2.patch
deleted file mode 100644
index dcebaa007bc1..000000000000
--- a/net-wireless/bluez/files/0001-Allow-using-obexd-without-systemd-in-the-user-session-r2.patch
+++ /dev/null
@@ -1,58 +0,0 @@
-From 3027cb7141fb65cf3eeda69c688db8c4045e2d3f Mon Sep 17 00:00:00 2001
-From: Giovanni Campagna <gcampagna-cNUdlRotFMnNLxjTenLetw@public.gmane.org>
-Date: Sat, 12 Oct 2013 17:45:25 +0200
-Subject: [PATCH] Allow using obexd without systemd in the user session
-
-Not all sessions run systemd --user (actually, the majority
-doesn't), so the dbus daemon must be able to spawn obexd
-directly, and to do so it needs the full path of the daemon.
----
- Makefile.obexd                      | 4 ++--
- obexd/src/org.bluez.obex.service    | 4 ----
- obexd/src/org.bluez.obex.service.in | 4 ++++
- 3 files changed, 6 insertions(+), 6 deletions(-)
- delete mode 100644 obexd/src/org.bluez.obex.service
- create mode 100644 obexd/src/org.bluez.obex.service.in
-
-diff --git a/Makefile.obexd b/Makefile.obexd
-index 3760867..142e7c3 100644
---- a/Makefile.obexd
-+++ b/Makefile.obexd
-@@ -2,12 +2,12 @@
- if SYSTEMD
- systemduserunitdir = $(SYSTEMD_USERUNITDIR)
- systemduserunit_DATA = obexd/src/obex.service
-+endif
- 
- dbussessionbusdir = $(DBUS_SESSIONBUSDIR)
- dbussessionbus_DATA = obexd/src/org.bluez.obex.service
--endif
- 
--EXTRA_DIST += obexd/src/obex.service.in obexd/src/org.bluez.obex.service
-+EXTRA_DIST += obexd/src/obex.service.in obexd/src/org.bluez.obex.service.in
- 
- obex_plugindir = $(libdir)/obex/plugins
- 
-diff --git a/obexd/src/org.bluez.obex.service b/obexd/src/org.bluez.obex.service
-deleted file mode 100644
-index a538088..0000000
---- a/obexd/src/org.bluez.obex.service
-+++ /dev/null
-@@ -1,4 +0,0 @@
--[D-BUS Service]
--Name=org.bluez.obex
--Exec=/bin/false
--SystemdService=dbus-org.bluez.obex.service
-diff --git a/obexd/src/org.bluez.obex.service.in b/obexd/src/org.bluez.obex.service.in
-new file mode 100644
-index 0000000..9c815f2
---- /dev/null
-+++ b/obexd/src/org.bluez.obex.service.in
-@@ -0,0 +1,4 @@
-+[D-BUS Service]
-+Name=org.bluez.obex
-+Exec=@pkglibexecdir@/obexd
-+SystemdService=dbus-org.bluez.obex.service
--- 
-1.8.3.1
-

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
deleted file mode 100644
index 566d7c08b591..000000000000
--- a/net-wireless/bluez/files/bluez-5.66-power-state-adapter-property.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-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
-


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-wireless/bluez/, net-wireless/bluez/files/
@ 2024-09-15 11:41 Pacho Ramos
  0 siblings, 0 replies; 22+ messages in thread
From: Pacho Ramos @ 2024-09-15 11:41 UTC (permalink / raw
  To: gentoo-commits

commit:     d1292c72a788ccd60c4cc6cbb189afcb323fcbb4
Author:     Pacho Ramos <pacho <AT> gentoo <DOT> org>
AuthorDate: Sun Sep 15 11:36:51 2024 +0000
Commit:     Pacho Ramos <pacho <AT> gentoo <DOT> org>
CommitDate: Sun Sep 15 11:36:51 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d1292c72

net-wireless/bluez: drop 5.76-r1

Signed-off-by: Pacho Ramos <pacho <AT> gentoo.org>

 net-wireless/bluez/Manifest                        |   1 -
 net-wireless/bluez/bluez-5.76-r1.ebuild            | 279 ---------------------
 .../bluez/files/bluez-5.73-configure-cups.patch    |  35 ---
 3 files changed, 315 deletions(-)

diff --git a/net-wireless/bluez/Manifest b/net-wireless/bluez/Manifest
index e860cb340fac..3b658b7e6cc2 100644
--- a/net-wireless/bluez/Manifest
+++ b/net-wireless/bluez/Manifest
@@ -1,3 +1,2 @@
-DIST bluez-5.76.tar.xz 2418848 BLAKE2B 658e67ec3ac568fd4d8bdc434eabfc63fd8cddd287f7cf6a8967771673e79fe95c509be654ae2495d1b3aedb1e23ca710d545f5ded281a64fd44058b0cdf7afe SHA512 30dc3faef74a2225fd6027178376dca4166082d1ed5188021e13d13582db5846aef60b753f173d525bfd0c040f26c3e7dab0283ecafbd34c4a06855d13abb389
 DIST bluez-5.77.tar.xz 2432176 BLAKE2B 9c1a8c78ad11a79080af12333338a6b75189ac51f8c49545de9eede8544fea531a7d8f50676f6e26c84289828fe8327bbc3e5b50ad4d9c08822cf0353a82ecaf SHA512 cf0faba4ddbfe6cc3c2d86cbd809483ed82327cbd7e4970ef53cf19053de7b355a505cab88844aebe7a6aa1947ec7a366250d3cbf48cf309db413d287289ff99
 DIST bluez-5.78.tar.xz 2441672 BLAKE2B 7fe65e926b2a692fcf96bb9c694c42ad8c0bd2d19bf534427128bfbd1eb4d9e3e63f2bdc4659ee8654967a0ac7866a561bc4bd4656d19e0dcb7cc5ce976eb6b2 SHA512 0c591a42742c167ff51e088d898b751f11cb4808ec2f17d9a85bc247a32d4fe18fa17503d188ffad6d9393ad590574518055abe5beeb788aca07d5ba957e4e4d

diff --git a/net-wireless/bluez/bluez-5.76-r1.ebuild b/net-wireless/bluez/bluez-5.76-r1.ebuild
deleted file mode 100644
index 47eb7a23592b..000000000000
--- a/net-wireless/bluez/bluez-5.76-r1.ebuild
+++ /dev/null
@@ -1,279 +0,0 @@
-# Copyright 1999-2024 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-PYTHON_COMPAT=( python3_{9..12} )
-
-inherit autotools flag-o-matic 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 https://github.com/bluez/bluez"
-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 ~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
-# change in the future, hence, this REQUIRED_USE constraint could be dropped
-# again in the future.
-# btpclient needs mesh, bug #790587
-REQUIRED_USE="
-	btpclient? ( mesh )
-	extra-tools? ( deprecated readline )
-	test? ( ${PYTHON_REQUIRED_USE} )
-	test-programs? ( ${PYTHON_REQUIRED_USE} )
-"
-
-TEST_DEPS="${PYTHON_DEPS}
-	$(python_gen_cond_dep '
-		>=dev-python/dbus-python-1[${PYTHON_USEDEP}]
-		dev-python/pygobject:3[${PYTHON_USEDEP}]
-	')
-"
-BDEPEND="
-	dev-python/docutils
-	virtual/pkgconfig
-	test? ( ${TEST_DEPS} )
-"
-DEPEND="
-	>=dev-libs/glib-2.28:2[${MULTILIB_USEDEP}]
-	btpclient? ( >=dev-libs/ell-0.39 )
-	cups? ( net-print/cups:= )
-	mesh? (
-		>=dev-libs/ell-0.39
-		>=dev-libs/json-c-0.13:=
-		sys-libs/readline:0=
-	)
-	midi? ( media-libs/alsa-lib )
-	obex? ( dev-libs/libical:= )
-	readline? ( sys-libs/readline:0= )
-	systemd? ( sys-apps/systemd )
-	>=sys-apps/dbus-1.6:=
-	udev? ( >=virtual/udev-196 )
-"
-RDEPEND="${DEPEND}
-	selinux? ( sec-policy/selinux-bluetooth )
-	test-programs? ( ${TEST_DEPS} )
-"
-
-RESTRICT="!test? ( test )"
-
-PATCHES=(
-	# Try both udevadm paths to cover udev/systemd vs. eudev locations (#539844)
-	# http://www.spinics.net/lists/linux-bluetooth/msg58739.html
-	# https://bugs.gentoo.org/539844
-	# https://github.com/bluez/bluez/issues/268
-	"${FILESDIR}"/${PN}-udevadm-path-r1.patch
-)
-
-pkg_setup() {
-	# From http://www.linuxfromscratch.org/blfs/view/svn/general/bluez.html
-	# to prevent bugs like:
-	# https://bugzilla.kernel.org/show_bug.cgi?id=196621
-	CONFIG_CHECK="~NET ~BT ~BT_RFCOMM ~BT_RFCOMM_TTY ~BT_BNEP ~BT_BNEP_MC_FILTER
-		~BT_BNEP_PROTO_FILTER ~BT_HIDP ~CRYPTO_USER_API_HASH ~CRYPTO_USER_API_SKCIPHER
-		~UHID ~RFKILL"
-	# https://bugzilla.kernel.org/show_bug.cgi?id=196621
-	# https://bugzilla.kernel.org/show_bug.cgi?id=206815
-	if use mesh || use test; then
-		CONFIG_CHECK="${CONFIG_CHECK} ~CRYPTO_USER
-		~CRYPTO_USER_API ~CRYPTO_USER_API_AEAD ~CRYPTO_AES ~CRYPTO_CCM ~CRYPTO_AEAD ~CRYPTO_CMAC
-		~CRYPTO_MD5 ~CRYPTO_SHA1 ~KEY_DH_OPERATIONS"
-	fi
-	linux-info_pkg_setup
-
-	if use test || use test-programs; then
-		python-single-r1_pkg_setup
-	fi
-
-	if ! use udev; then
-		ewarn
-		ewarn "You are installing ${PN} with USE=-udev. This means various bluetooth"
-		ewarn "devices and adapters from Apple, Dell, Logitech etc. will not work,"
-		ewarn "and hid2hci will not be available."
-		ewarn
-	fi
-}
-
-src_prepare() {
-	default
-
-	# https://github.com/bluez/bluez/issues/773
-	eapply "${FILESDIR}"/${PN}-5.73-configure-cups.patch
-
-	# https://github.com/bluez/bluez/issues/806
-	eapply "${FILESDIR}"/0001-Allow-using-obexd-without-systemd-in-the-user-session-r3.patch
-
-	eautoreconf
-
-	multilib_copy_sources
-}
-
-multilib_src_configure() {
-	# unit/test-vcp test fails with LTO (bug #925745)
-	filter-lto
-
-	local myconf=(
-		# readline is automagic when client is enabled
-		# --enable-client always needs readline, bug #504038
-		# --enable-mesh is handled in the same way
-		ac_cv_header_readline_readline_h=$(multilib_native_usex readline)
-		ac_cv_header_readline_readline_h=$(multilib_native_usex mesh)
-	)
-
-	if ! multilib_is_native_abi; then
-		myconf+=(
-			# deps not used for the library
-			{DBUS,GLIB}_{CFLAGS,LIBS}=' '
-		)
-	fi
-
-	econf \
-		--localstatedir=/var \
-		--disable-android \
-		--enable-datafiles \
-		--enable-optimization \
-		$(use_enable debug) \
-		--enable-pie \
-		--enable-threads \
-		--enable-library \
-		--enable-tools \
-		--enable-manpages \
-		--enable-monitor \
-		--with-systemdsystemunitdir="$(systemd_get_systemunitdir)" \
-		--with-systemduserunitdir="$(systemd_get_userunitdir)" \
-		$(multilib_native_use_enable btpclient) \
-		$(multilib_native_use_enable btpclient external-ell) \
-		$(multilib_native_use_enable cups) \
-		$(multilib_native_use_enable deprecated) \
-		$(multilib_native_use_enable experimental) \
-		$(multilib_native_use_enable mesh) \
-		$(multilib_native_use_enable mesh external-ell) \
-		$(multilib_native_use_enable midi) \
-		$(multilib_native_use_enable obex) \
-		$(multilib_native_use_enable readline client) \
-		$(multilib_native_use_enable systemd) \
-		$(multilib_native_use_enable test-programs test) \
-		$(multilib_native_use_enable udev) \
-		$(multilib_native_use_enable udev hid2hci) \
-		$(multilib_native_use_enable udev sixaxis)
-}
-
-multilib_src_compile() {
-	if multilib_is_native_abi; then
-		default
-	else
-		emake -f Makefile -f - libs \
-			<<<'libs: $(lib_LTLIBRARIES)'
-	fi
-}
-
-multilib_src_test() {
-	multilib_is_native_abi && default
-}
-
-multilib_src_install() {
-	if multilib_is_native_abi; then
-		emake DESTDIR="${D}" install
-
-		# Only install extra-tools when relevant USE flag is enabled
-		if use extra-tools; then
-			ewarn "Upstream doesn't support using this tools and their bugs are"
-			ewarn "likely to be ignored forever, also they can break without"
-			ewarn "previous announcement."
-			ewarn "Upstream also states all this tools are not really needed,"
-			ewarn "then, if you still need to rely on them, you must ask them"
-			ewarn "to either install that tool by default or add the needed"
-			ewarn "functionality to the existing 'official' tools."
-			ewarn "Please report this issues to:"
-			ewarn "http://www.bluez.org/development/lists/"
-
-			# Upstream doesn't install this, bug #524640
-			# http://permalink.gmane.org/gmane.linux.bluez.kernel/53115
-			# http://comments.gmane.org/gmane.linux.bluez.kernel/54564
-			dobin tools/btmgmt
-			# gatttool is only built with readline, bug #530776
-			# https://bugzilla.redhat.com/show_bug.cgi?id=1141909
-			# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=720486
-			# https://bugs.archlinux.org/task/37686
-			dobin attrib/gatttool
-			# https://bugzilla.redhat.com/show_bug.cgi?id=1699680
-			dobin tools/avinfo
-		fi
-
-		# Not installed by default after being built, bug #666756
-		use btpclient && dobin tools/btpclient
-
-		# Unittests are not that useful once installed, so make them optional
-		if use test-programs; then
-			# Drop python2 only test tools
-			# https://bugzilla.kernel.org/show_bug.cgi?id=206819
-			rm "${ED}"/usr/$(get_libdir)/bluez/test/simple-player || die
-			# https://bugzilla.kernel.org/show_bug.cgi?id=206821
-			rm "${ED}"/usr/$(get_libdir)/bluez/test/test-hfp || die
-			# https://bugzilla.kernel.org/show_bug.cgi?id=206823
-			rm "${ED}"/usr/$(get_libdir)/bluez/test/test-sap-server	|| die
-
-			python_fix_shebang "${ED}"/usr/$(get_libdir)/bluez/test
-
-			for i in $(find "${ED}"/usr/$(get_libdir)/bluez/test -maxdepth 1 -type f ! -name "*.*"); do
-				dosym "${i}" /usr/bin/bluez-"${i##*/}"
-			done
-		fi
-	else
-		emake DESTDIR="${D}" \
-			install-pkgincludeHEADERS \
-			install-libLTLIBRARIES \
-			install-pkgconfigDATA
-	fi
-}
-
-multilib_src_install_all() {
-	# We need to ensure obexd can be spawned automatically by systemd
-	# when user-session is enabled:
-	# http://marc.info/?l=linux-bluetooth&m=148096094716386&w=2
-	# https://bugs.gentoo.org/show_bug.cgi?id=577842
-	# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=804908
-	# https://bugs.archlinux.org/task/45816
-	# https://bugzilla.redhat.com/show_bug.cgi?id=1318441
-	# https://bugzilla.redhat.com/show_bug.cgi?id=1389347
-	if use systemd; then
-		dosym obex.service /usr/lib/systemd/user/dbus-org.bluez.obex.service
-	fi
-
-	find "${D}" -name '*.la' -type f -delete || die
-
-	# Setup auto enable as Fedora does for allowing to use
-	# keyboards/mouse as soon as possible
-	sed -i 's/#\[Policy\]$/\[Policy\]/; s/#AutoEnable=false/AutoEnable=true/' src/main.conf || die
-	insinto /etc/bluetooth
-	doins src/main.conf
-
-	newinitd "${FILESDIR}"/bluetooth-init.d-r5 bluetooth
-	newconfd "${FILESDIR}"/bluetooth-conf.d bluetooth
-
-	einstalldocs
-	use doc && dodoc doc/*.txt
-
-	# https://bugs.gentoo.org/929017
-	fperms 0555 /etc/bluetooth
-
-	# https://bugs.gentoo.org/932172
-	if ! use systemd; then
-		keepdir /var/lib/bluetooth
-		fperms 0700 /var/lib/bluetooth
-	fi
-}
-
-pkg_postinst() {
-	use udev && udev_reload
-	systemd_reenable bluetooth.service
-
-	has_version net-dialup/ppp || elog "To use dial up networking you must install net-dialup/ppp"
-}
-
-pkg_postrm() {
-	use udev && udev_reload
-}

diff --git a/net-wireless/bluez/files/bluez-5.73-configure-cups.patch b/net-wireless/bluez/files/bluez-5.73-configure-cups.patch
deleted file mode 100644
index 1ab1f96915ee..000000000000
--- a/net-wireless/bluez/files/bluez-5.73-configure-cups.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-From b2237fe8efed9aee25a46934f028373cd0632daa Mon Sep 17 00:00:00 2001
-From: Lars Wendler <polynomial-c@gmx.de>
-Date: Fri, 22 Mar 2024 09:08:24 +0100
-Subject: [PATCH] configure.ac: Fix --disable-cups
-
-or else we get:
-  configure: error: conditional "CUPS_SERVERBIN" was never defined.
-  Usually this means the macro was only invoked conditionally.
-
-Fixes: #773
----
- configure.ac | 8 ++++----
- 1 file changed, 4 insertions(+), 4 deletions(-)
-
-diff --git a/configure.ac b/configure.ac
-index 9ebc250cf..047ec1a7f 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -249,12 +249,12 @@ AM_CONDITIONAL(CUPS, test "${enable_cups}" != "no")
- if (test "${enable_cups}" != "no"); then
- 	AC_MSG_CHECKING([cups directory])
- 	cups_serverbin=`$PKG_CONFIG cups --variable=cups_serverbin`
--	AM_CONDITIONAL(CUPS_SERVERBIN, test "${cups_serverbin}" != "")
--	if (test "${cups_serverbin}" != ""); then
--		AC_SUBST(CUPS_SERVERBIN, ${cups_serverbin})
--	fi
- 	AC_MSG_RESULT([${cups_serverbin}])
- fi
-+AM_CONDITIONAL(CUPS_SERVERBIN, test "${cups_serverbin}" != "")
-+AS_IF([test "${cups_serverbin}" != ""],[
-+	AC_SUBST(CUPS_SERVERBIN, ${cups_serverbin})
-+])
- 
- AC_ARG_ENABLE(mesh, AS_HELP_STRING([--enable-mesh],
- 		[enable Mesh profile support]), [enable_mesh=${enableval}])


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-wireless/bluez/, net-wireless/bluez/files/
@ 2024-09-24  6:12 Sam James
  0 siblings, 0 replies; 22+ messages in thread
From: Sam James @ 2024-09-24  6:12 UTC (permalink / raw
  To: gentoo-commits

commit:     c5d8c3399a48d1eadc97063b7c538c06aa065a01
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Tue Sep 24 06:11:17 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Tue Sep 24 06:11:17 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c5d8c339

net-wireless/bluez: fix musl build

Closes: https://bugs.gentoo.org/926344
Signed-off-by: Sam James <sam <AT> gentoo.org>

 net-wireless/bluez/bluez-5.78.ebuild               |   3 +
 .../bluez/files/bluez-5.78-musl-1.2.5.patch        | 312 +++++++++++++++++++++
 2 files changed, 315 insertions(+)

diff --git a/net-wireless/bluez/bluez-5.78.ebuild b/net-wireless/bluez/bluez-5.78.ebuild
index 9caf41f57bcf..fd91fb2295c3 100644
--- a/net-wireless/bluez/bluez-5.78.ebuild
+++ b/net-wireless/bluez/bluez-5.78.ebuild
@@ -66,6 +66,9 @@ PATCHES=(
 	# https://bugs.gentoo.org/539844
 	# https://github.com/bluez/bluez/issues/268
 	"${FILESDIR}"/${PN}-udevadm-path-r1.patch
+	# bug #926344
+	# https://github.com/bluez/bluez/issues/843
+	"${FILESDIR}"/${PN}-5.78-musl-1.2.5.patch
 )
 
 pkg_setup() {

diff --git a/net-wireless/bluez/files/bluez-5.78-musl-1.2.5.patch b/net-wireless/bluez/files/bluez-5.78-musl-1.2.5.patch
new file mode 100644
index 000000000000..0ee929faa3e4
--- /dev/null
+++ b/net-wireless/bluez/files/bluez-5.78-musl-1.2.5.patch
@@ -0,0 +1,312 @@
+https://bugs.gentoo.org/926344
+
+hex2hcd: https://github.com/bluez/bluez/pull/897 (https://lore.kernel.org/linux-bluetooth/20240710123002.5639-1-rahul@sandhuservices.dev/)
+rpl:
+ 1) https://github.com/bluez/bluez/commit/690eccbe8562cc33f33503af67beb313ca737817
+ 2) https://github.com/bluez/bluez/issues/843#issuecomment-2354143400
+
+From e2f12111385dc4c21e2ef435025e1ddf8c386fa2 Mon Sep 17 00:00:00 2001
+From: Rahul Sandhu <rahul@sandhuservices.dev>
+Date: Wed, 10 Jul 2024 11:12:30 +0100
+Subject: [PATCH] tools/hex2hcd: fix musl compatibility
+
+The call to basename() relies on a GNU extension
+to take a const char * vs a char *. Let's define
+a trivial helper function to ensure compatibility
+with musl.
+
+Downstream gentoo bug: https://bugs.gentoo.org/926344
+Fixes: #843
+Signed-off-by: Rahul Sandhu <rahul@sandhuservices.dev>
+---
+ tools/hex2hcd.c | 7 ++++++-
+ 1 file changed, 6 insertions(+), 1 deletion(-)
+
+diff --git a/tools/hex2hcd.c b/tools/hex2hcd.c
+index e6dca5a810..42c95b759b 100644
+--- a/tools/hex2hcd.c
++++ b/tools/hex2hcd.c
+@@ -285,6 +285,11 @@ static void ver_parse_file(const char *pathname)
+ 	prev->next = ver;
+ }
+ 
++static const char *helper_basename(const char *path) {
++  const char *base = strrchr(path, '/');
++  return base ? base + 1 : path;
++}
++
+ static void ver_parse_entry(const char *pathname)
+ {
+ 	struct stat st;
+@@ -302,7 +307,7 @@ static void ver_parse_entry(const char *pathname)
+ 	}
+ 
+ 	if (S_ISREG(st.st_mode)) {
+-		ver_parse_file(basename(pathname));
++		ver_parse_file(helper_basename(pathname));
+ 		goto done;
+ 	}
+ 
+From 690eccbe8562cc33f33503af67beb313ca737817 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 27 Aug 2024 23:09:26 -0700
+Subject: [PATCH] mesh: Provide GNU basename compatible implementation
+
+Call to basename() relies on a GNU extension
+to take a const char * vs a char *. Let's define
+a trivial helper function to ensure compatibility
+with musl.
+
+Fixes: https://github.com/bluez/bluez/issues/843
+---
+ configure.ac            | 11 ++++++++++-
+ mesh/mesh-config-json.c |  4 +++-
+ mesh/missing.h          | 21 +++++++++++++++++++++
+ mesh/rpl.c              |  1 +
+ tools/hex2hcd.c         |  1 +
+ tools/missing.h         | 21 +++++++++++++++++++++
+ 6 files changed, 57 insertions(+), 2 deletions(-)
+ create mode 100644 mesh/missing.h
+ create mode 100644 tools/missing.h
+
+diff --git a/configure.ac b/configure.ac
+index 790a19560d..7093e41ff7 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -70,7 +70,16 @@ AC_CHECK_LIB(pthread, pthread_create, dummy=yes,
+ AC_CHECK_LIB(dl, dlopen, dummy=yes,
+ 			AC_MSG_ERROR(dynamic linking loader is required))
+ 
+-AC_CHECK_HEADERS(linux/types.h linux/if_alg.h linux/uinput.h linux/uhid.h sys/random.h)
++AC_CHECK_HEADERS(string.h linux/types.h linux/if_alg.h linux/uinput.h linux/uhid.h sys/random.h)
++
++# basename may be only available in libgen.h with the POSIX behavior,
++# not desired here
++AC_CHECK_DECLS([basename], [],
++				AC_MSG_WARN([GNU basename extension not found]),
++				[#define _GNU_SOURCE 1
++				 #include <string.h>
++				 ])
++
+ 
+ PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.28)
+ 
+diff --git a/mesh/mesh-config-json.c b/mesh/mesh-config-json.c
+index c198627c6f..a17a48b6d1 100644
+--- a/mesh/mesh-config-json.c
++++ b/mesh/mesh-config-json.c
+@@ -28,6 +28,7 @@
+ #include <ell/ell.h>
+ #include <json-c/json.h>
+ 
++#include "mesh/missing.h"
+ #include "mesh/mesh-defs.h"
+ #include "mesh/util.h"
+ #include "mesh/mesh-config.h"
+@@ -2694,7 +2695,8 @@ bool mesh_config_load_nodes(const char *cfgdir_name, mesh_config_node_func_t cb,
+ 
+ void mesh_config_destroy_nvm(struct mesh_config *cfg)
+ {
+-	char *node_dir, *node_name;
++	char *node_dir;
++	const char *node_name;
+ 	char uuid[33];
+ 
+ 	if (!cfg)
+diff --git a/mesh/missing.h b/mesh/missing.h
+new file mode 100644
+index 0000000000..464df9b1c3
+--- /dev/null
++++ b/mesh/missing.h
+@@ -0,0 +1,21 @@
++// SPDX-License-Identifier: LGPL-2.1-or-later
++/*
++ *
++ *  BlueZ - Bluetooth protocol stack for Linux
++ *
++ *  Copyright (C) 2024  Khem Raj <raj.khem@gmail.com>
++ *
++ */
++
++#ifdef HAVE_CONFIG_H
++#include <config.h>
++#endif
++#if !HAVE_DECL_BASENAME
++#include <string.h>
++static inline const char *basename(const char *path)
++{
++	const char *base = strrchr(path, '/');
++
++	return base ? base + 1 : path;
++}
++#endif
+diff --git a/mesh/rpl.c b/mesh/rpl.c
+index fb225dddd6..2fa17d72f6 100644
+--- a/mesh/rpl.c
++++ b/mesh/rpl.c
+@@ -24,6 +24,7 @@
+ 
+ #include <ell/ell.h>
+ 
++#include "mesh/missing.h"
+ #include "mesh/mesh-defs.h"
+ 
+ #include "mesh/node.h"
+diff --git a/tools/hex2hcd.c b/tools/hex2hcd.c
+index e6dca5a810..452ab2beb5 100644
+--- a/tools/hex2hcd.c
++++ b/tools/hex2hcd.c
+@@ -24,6 +24,7 @@
+ #include <stdlib.h>
+ #include <stdbool.h>
+ #include <sys/stat.h>
++#include "tools/missing.h"
+ 
+ static ssize_t process_record(int fd, const char *line, uint16_t *upper_addr)
+ {
+diff --git a/tools/missing.h b/tools/missing.h
+new file mode 100644
+index 0000000000..464df9b1c3
+--- /dev/null
++++ b/tools/missing.h
+@@ -0,0 +1,21 @@
++// SPDX-License-Identifier: LGPL-2.1-or-later
++/*
++ *
++ *  BlueZ - Bluetooth protocol stack for Linux
++ *
++ *  Copyright (C) 2024  Khem Raj <raj.khem@gmail.com>
++ *
++ */
++
++#ifdef HAVE_CONFIG_H
++#include <config.h>
++#endif
++#if !HAVE_DECL_BASENAME
++#include <string.h>
++static inline const char *basename(const char *path)
++{
++	const char *base = strrchr(path, '/');
++
++	return base ? base + 1 : path;
++}
++#endif
+
+From e882342db836d267a9ca4d0886e6828a2aba67b4 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 16 Sep 2024 15:11:01 -0700
+Subject: [PATCH] mesh: Move local basename into utility file
+
+Defining an override via a missing.h can prove difficult when a file
+needs to use basename and dirname both the APIs and needs to include
+libgen.h for them, in such situations there will be signature clash
+for basename function.
+---
+ mesh/mesh-config-json.c |  3 +--
+ mesh/missing.h          | 21 ---------------------
+ mesh/rpl.c              |  3 +--
+ mesh/util.c             | 10 ++++++++++
+ mesh/util.h             |  5 +++++
+ 5 files changed, 17 insertions(+), 25 deletions(-)
+ delete mode 100644 mesh/missing.h
+
+diff --git a/mesh/mesh-config-json.c b/mesh/mesh-config-json.c
+index a17a48b6d..5372130d7 100644
+--- a/mesh/mesh-config-json.c
++++ b/mesh/mesh-config-json.c
+@@ -28,7 +28,6 @@
+ #include <ell/ell.h>
+ #include <json-c/json.h>
+ 
+-#include "mesh/missing.h"
+ #include "mesh/mesh-defs.h"
+ #include "mesh/util.h"
+ #include "mesh/mesh-config.h"
+@@ -2708,7 +2707,7 @@ void mesh_config_destroy_nvm(struct mesh_config *cfg)
+ 	if (!hex2str(cfg->uuid, 16, uuid, sizeof(uuid)))
+ 		return;
+ 
+-	node_name = basename(node_dir);
++	node_name = mesh_basename(node_dir);
+ 
+ 	/* Make sure path name of node follows expected guidelines */
+ 	if (strcmp(node_name, uuid))
+diff --git a/mesh/missing.h b/mesh/missing.h
+deleted file mode 100644
+index 464df9b1c..000000000
+--- a/mesh/missing.h
++++ /dev/null
+@@ -1,21 +0,0 @@
+-// SPDX-License-Identifier: LGPL-2.1-or-later
+-/*
+- *
+- *  BlueZ - Bluetooth protocol stack for Linux
+- *
+- *  Copyright (C) 2024  Khem Raj <raj.khem@gmail.com>
+- *
+- */
+-
+-#ifdef HAVE_CONFIG_H
+-#include <config.h>
+-#endif
+-#if !HAVE_DECL_BASENAME
+-#include <string.h>
+-static inline const char *basename(const char *path)
+-{
+-	const char *base = strrchr(path, '/');
+-
+-	return base ? base + 1 : path;
+-}
+-#endif
+diff --git a/mesh/rpl.c b/mesh/rpl.c
+index 2fa17d72f..69533bf43 100644
+--- a/mesh/rpl.c
++++ b/mesh/rpl.c
+@@ -24,7 +24,6 @@
+ 
+ #include <ell/ell.h>
+ 
+-#include "mesh/missing.h"
+ #include "mesh/mesh-defs.h"
+ 
+ #include "mesh/node.h"
+@@ -147,7 +146,7 @@ static void get_entries(const char *iv_path, struct l_queue *rpl_list)
+ 	if (!dir)
+ 		return;
+ 
+-	iv_txt = basename(iv_path);
++	iv_txt = mesh_basename(iv_path);
+ 	if (sscanf(iv_txt, "%08x", &iv_index) != 1) {
+ 		closedir(dir);
+ 		return;
+diff --git a/mesh/util.c b/mesh/util.c
+index 82b57f642..73f13aab7 100644
+--- a/mesh/util.c
++++ b/mesh/util.c
+@@ -161,3 +161,13 @@ void enable_debug(void)
+ 	debug_enabled = true;
+ 	l_debug_enable("*");
+ }
++
++#if !HAVE_DECL_BASENAME
++#include <string.h>
++const char *mesh_basename(const char *path)
++{
++	const char *base = strrchr(path, '/');
++
++	return base ? base + 1 : path;
++}
++#endif
+diff --git a/mesh/util.h b/mesh/util.h
+index 085ec3330..bb417dc40 100644
+--- a/mesh/util.h
++++ b/mesh/util.h
+@@ -16,3 +16,8 @@ void print_packet(const char *label, const void *data, uint16_t size);
+ int create_dir(const char *dir_name);
+ void del_path(const char *path);
+ void enable_debug(void);
++#if !HAVE_DECL_BASENAME
++const char *mesh_basename(const char *path);
++#else
++#define mesh_basename basename
++#endif


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-wireless/bluez/, net-wireless/bluez/files/
@ 2024-11-08 15:51 Pacho Ramos
  0 siblings, 0 replies; 22+ messages in thread
From: Pacho Ramos @ 2024-11-08 15:51 UTC (permalink / raw
  To: gentoo-commits

commit:     a41d74c444480b6e643a972327387785785d15ce
Author:     Pacho Ramos <pacho <AT> gentoo <DOT> org>
AuthorDate: Fri Nov  8 15:48:07 2024 +0000
Commit:     Pacho Ramos <pacho <AT> gentoo <DOT> org>
CommitDate: Fri Nov  8 15:51:35 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a41d74c4

net-wireless/bluez: add 5.79

Also make manpages building optional to skip docutils dependency.

Closes: https://bugs.gentoo.org/928365
Closes: https://bugs.gentoo.org/941413
Signed-off-by: Pacho Ramos <pacho <AT> gentoo.org>

 net-wireless/bluez/Manifest                        |   1 +
 net-wireless/bluez/bluez-5.79.ebuild               | 283 +++++++++++++++++++++
 ...xd-without-systemd-in-the-user-session-r4.patch |  20 ++
 .../bluez/files/bluez-5.79-musl-gdbus.patch        |  27 ++
 .../bluez/files/bluez-disable-test-vcp.patch       |  24 ++
 5 files changed, 355 insertions(+)

diff --git a/net-wireless/bluez/Manifest b/net-wireless/bluez/Manifest
index 3b658b7e6cc2..baaa70468cf6 100644
--- a/net-wireless/bluez/Manifest
+++ b/net-wireless/bluez/Manifest
@@ -1,2 +1,3 @@
 DIST bluez-5.77.tar.xz 2432176 BLAKE2B 9c1a8c78ad11a79080af12333338a6b75189ac51f8c49545de9eede8544fea531a7d8f50676f6e26c84289828fe8327bbc3e5b50ad4d9c08822cf0353a82ecaf SHA512 cf0faba4ddbfe6cc3c2d86cbd809483ed82327cbd7e4970ef53cf19053de7b355a505cab88844aebe7a6aa1947ec7a366250d3cbf48cf309db413d287289ff99
 DIST bluez-5.78.tar.xz 2441672 BLAKE2B 7fe65e926b2a692fcf96bb9c694c42ad8c0bd2d19bf534427128bfbd1eb4d9e3e63f2bdc4659ee8654967a0ac7866a561bc4bd4656d19e0dcb7cc5ce976eb6b2 SHA512 0c591a42742c167ff51e088d898b751f11cb4808ec2f17d9a85bc247a32d4fe18fa17503d188ffad6d9393ad590574518055abe5beeb788aca07d5ba957e4e4d
+DIST bluez-5.79.tar.xz 2457612 BLAKE2B e908bc000b45832845a09ea7e906d39e107e4934fef4efc9a78b278b7f8ae914ed3a573ef53512de7076a3b1ca8115634fb502cb8d1d0c8516febe05f9e059f8 SHA512 74d47b1eb9b9904798f5c8093674743a14a509d22c33003cf253a1ab0c11a564e6a10a808e087e3fb7f3589d3cba1868ec9bf2923703cdc36a293c95af1d0d76

diff --git a/net-wireless/bluez/bluez-5.79.ebuild b/net-wireless/bluez/bluez-5.79.ebuild
new file mode 100644
index 000000000000..10e45dfb6fca
--- /dev/null
+++ b/net-wireless/bluez/bluez-5.79.ebuild
@@ -0,0 +1,283 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+PYTHON_COMPAT=( python3_{10..13} )
+
+inherit autotools flag-o-matic 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 https://github.com/bluez/bluez"
+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 ~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
+# change in the future, hence, this REQUIRED_USE constraint could be dropped
+# again in the future.
+# btpclient needs mesh, bug #790587
+REQUIRED_USE="
+	btpclient? ( mesh )
+	extra-tools? ( deprecated readline )
+	test? ( ${PYTHON_REQUIRED_USE} )
+	test-programs? ( ${PYTHON_REQUIRED_USE} )
+"
+
+TEST_DEPS="${PYTHON_DEPS}
+	$(python_gen_cond_dep '
+		>=dev-python/dbus-python-1[${PYTHON_USEDEP}]
+		dev-python/pygobject:3[${PYTHON_USEDEP}]
+	')
+"
+BDEPEND="
+	virtual/pkgconfig
+	man? ( dev-python/docutils )
+	test? ( ${TEST_DEPS} )
+"
+DEPEND="
+	>=dev-libs/glib-2.28:2[${MULTILIB_USEDEP}]
+	btpclient? ( >=dev-libs/ell-0.39 )
+	cups? ( net-print/cups:= )
+	mesh? (
+		>=dev-libs/ell-0.39
+		>=dev-libs/json-c-0.13:=
+		sys-libs/readline:0=
+	)
+	midi? ( media-libs/alsa-lib )
+	obex? ( dev-libs/libical:= )
+	readline? ( sys-libs/readline:0= )
+	systemd? ( sys-apps/systemd )
+	>=sys-apps/dbus-1.6:=
+	udev? ( >=virtual/udev-196 )
+"
+RDEPEND="${DEPEND}
+	selinux? ( sec-policy/selinux-bluetooth )
+	test-programs? ( ${TEST_DEPS} )
+"
+
+RESTRICT="!test? ( test )"
+
+PATCHES=(
+	# Try both udevadm paths to cover udev/systemd vs. eudev locations (#539844)
+	# http://www.spinics.net/lists/linux-bluetooth/msg58739.html
+	# https://bugs.gentoo.org/539844
+	# https://github.com/bluez/bluez/issues/268
+	"${FILESDIR}"/${PN}-udevadm-path-r1.patch
+
+	# https://github.com/bluez/bluez/commit/9d69dba21f1e46b34cdd8ae27fec11d0803907ee
+	"${FILESDIR}"/${P}-musl-gdbus.patch
+
+	# https://bugs.gentoo.org/928365
+	# https://github.com/bluez/bluez/issues/726
+	"${FILESDIR}"/${PN}-disable-test-vcp.patch
+)
+
+pkg_setup() {
+	# From http://www.linuxfromscratch.org/blfs/view/svn/general/bluez.html
+	# to prevent bugs like:
+	# https://bugzilla.kernel.org/show_bug.cgi?id=196621
+	CONFIG_CHECK="~NET ~BT ~BT_RFCOMM ~BT_RFCOMM_TTY ~BT_BNEP ~BT_BNEP_MC_FILTER
+		~BT_BNEP_PROTO_FILTER ~BT_HIDP ~CRYPTO_USER_API_HASH ~CRYPTO_USER_API_SKCIPHER
+		~UHID ~RFKILL"
+	# https://bugzilla.kernel.org/show_bug.cgi?id=196621
+	# https://bugzilla.kernel.org/show_bug.cgi?id=206815
+	if use mesh || use test; then
+		CONFIG_CHECK="${CONFIG_CHECK} ~CRYPTO_USER
+		~CRYPTO_USER_API ~CRYPTO_USER_API_AEAD ~CRYPTO_AES ~CRYPTO_CCM ~CRYPTO_AEAD ~CRYPTO_CMAC
+		~CRYPTO_MD5 ~CRYPTO_SHA1 ~KEY_DH_OPERATIONS"
+	fi
+	linux-info_pkg_setup
+
+	if use test || use test-programs; then
+		python-single-r1_pkg_setup
+	fi
+
+	if ! use udev; then
+		ewarn
+		ewarn "You are installing ${PN} with USE=-udev. This means various bluetooth"
+		ewarn "devices and adapters from Apple, Dell, Logitech etc. will not work,"
+		ewarn "and hid2hci will not be available."
+		ewarn
+	fi
+}
+
+src_prepare() {
+	default
+
+	# https://github.com/bluez/bluez/issues/806
+	eapply "${FILESDIR}"/0001-Allow-using-obexd-without-systemd-in-the-user-session-r4.patch
+
+	eautoreconf
+
+	multilib_copy_sources
+}
+
+multilib_src_configure() {
+	# unit/test-vcp test fails with LTO (bug #925745)
+	filter-lto
+
+	local myconf=(
+		# readline is automagic when client is enabled
+		# --enable-client always needs readline, bug #504038
+		# --enable-mesh is handled in the same way
+		ac_cv_header_readline_readline_h=$(multilib_native_usex readline)
+		ac_cv_header_readline_readline_h=$(multilib_native_usex mesh)
+	)
+
+	if ! multilib_is_native_abi; then
+		myconf+=(
+			# deps not used for the library
+			{DBUS,GLIB}_{CFLAGS,LIBS}=' '
+		)
+	fi
+
+	econf \
+		--localstatedir=/var \
+		--disable-android \
+		--enable-datafiles \
+		--enable-optimization \
+		$(use_enable debug) \
+		--enable-pie \
+		--enable-threads \
+		--enable-library \
+		--enable-tools \
+		--enable-monitor \
+		--with-systemdsystemunitdir="$(systemd_get_systemunitdir)" \
+		--with-systemduserunitdir="$(systemd_get_userunitdir)" \
+		$(multilib_native_use_enable btpclient) \
+		$(multilib_native_use_enable btpclient external-ell) \
+		$(multilib_native_use_enable cups) \
+		$(multilib_native_use_enable deprecated) \
+		$(multilib_native_use_enable experimental) \
+		$(multilib_native_use_enable man manpages) \
+		$(multilib_native_use_enable mesh) \
+		$(multilib_native_use_enable mesh external-ell) \
+		$(multilib_native_use_enable midi) \
+		$(multilib_native_use_enable obex) \
+		$(multilib_native_use_enable readline client) \
+		$(multilib_native_use_enable systemd) \
+		$(multilib_native_use_enable test-programs test) \
+		$(multilib_native_use_enable udev) \
+		$(multilib_native_use_enable udev hid2hci) \
+		$(multilib_native_use_enable udev sixaxis)
+}
+
+multilib_src_compile() {
+	if multilib_is_native_abi; then
+		default
+	else
+		emake -f Makefile -f - libs \
+			<<<'libs: $(lib_LTLIBRARIES)'
+	fi
+}
+
+multilib_src_test() {
+	multilib_is_native_abi && default
+}
+
+multilib_src_install() {
+	if multilib_is_native_abi; then
+		emake DESTDIR="${D}" install
+
+		# Only install extra-tools when relevant USE flag is enabled
+		if use extra-tools; then
+			ewarn "Upstream doesn't support using this tools and their bugs are"
+			ewarn "likely to be ignored forever, also they can break without"
+			ewarn "previous announcement."
+			ewarn "Upstream also states all this tools are not really needed,"
+			ewarn "then, if you still need to rely on them, you must ask them"
+			ewarn "to either install that tool by default or add the needed"
+			ewarn "functionality to the existing 'official' tools."
+			ewarn "Please report this issues to:"
+			ewarn "http://www.bluez.org/development/lists/"
+
+			# Upstream doesn't install this, bug #524640
+			# http://permalink.gmane.org/gmane.linux.bluez.kernel/53115
+			# http://comments.gmane.org/gmane.linux.bluez.kernel/54564
+			dobin tools/btmgmt
+			# gatttool is only built with readline, bug #530776
+			# https://bugzilla.redhat.com/show_bug.cgi?id=1141909
+			# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=720486
+			# https://bugs.archlinux.org/task/37686
+			dobin attrib/gatttool
+			# https://bugzilla.redhat.com/show_bug.cgi?id=1699680
+			dobin tools/avinfo
+		fi
+
+		# Not installed by default after being built, bug #666756
+		use btpclient && dobin tools/btpclient
+
+		# Unittests are not that useful once installed, so make them optional
+		if use test-programs; then
+			# Drop python2 only test tools
+			# https://bugzilla.kernel.org/show_bug.cgi?id=206819
+			rm "${ED}"/usr/$(get_libdir)/bluez/test/simple-player || die
+			# https://bugzilla.kernel.org/show_bug.cgi?id=206821
+			rm "${ED}"/usr/$(get_libdir)/bluez/test/test-hfp || die
+			# https://bugzilla.kernel.org/show_bug.cgi?id=206823
+			rm "${ED}"/usr/$(get_libdir)/bluez/test/test-sap-server	|| die
+
+			python_fix_shebang "${ED}"/usr/$(get_libdir)/bluez/test
+
+			for i in $(find "${ED}"/usr/$(get_libdir)/bluez/test -maxdepth 1 -type f ! -name "*.*"); do
+				dosym "${i}" /usr/bin/bluez-"${i##*/}"
+			done
+		fi
+	else
+		emake DESTDIR="${D}" \
+			install-pkgincludeHEADERS \
+			install-libLTLIBRARIES \
+			install-pkgconfigDATA
+	fi
+}
+
+multilib_src_install_all() {
+	# We need to ensure obexd can be spawned automatically by systemd
+	# when user-session is enabled:
+	# http://marc.info/?l=linux-bluetooth&m=148096094716386&w=2
+	# https://bugs.gentoo.org/show_bug.cgi?id=577842
+	# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=804908
+	# https://bugs.archlinux.org/task/45816
+	# https://bugzilla.redhat.com/show_bug.cgi?id=1318441
+	# https://bugzilla.redhat.com/show_bug.cgi?id=1389347
+	if use systemd; then
+		dosym obex.service /usr/lib/systemd/user/dbus-org.bluez.obex.service
+	fi
+
+	find "${D}" -name '*.la' -type f -delete || die
+
+	# Setup auto enable as Fedora does for allowing to use
+	# keyboards/mouse as soon as possible
+	insinto /etc/bluetooth
+	doins src/main.conf
+
+	newinitd "${FILESDIR}"/bluetooth-init.d-r5 bluetooth
+	newconfd "${FILESDIR}"/bluetooth-conf.d bluetooth
+
+	einstalldocs
+	use doc && dodoc doc/*.txt
+
+	# https://bugs.gentoo.org/929017
+	# https://github.com/bluez/bluez/issues/329#issuecomment-1102459104
+	fperms 0555 /etc/bluetooth
+
+	# https://bugs.gentoo.org/932172
+	if ! use systemd; then
+		keepdir /var/lib/bluetooth
+		fperms 0700 /var/lib/bluetooth
+	fi
+}
+
+pkg_postinst() {
+	use udev && udev_reload
+	systemd_reenable bluetooth.service
+
+	has_version net-dialup/ppp || elog "To use dial up networking you must install net-dialup/ppp"
+}
+
+pkg_postrm() {
+	use udev && udev_reload
+}

diff --git a/net-wireless/bluez/files/0001-Allow-using-obexd-without-systemd-in-the-user-session-r4.patch b/net-wireless/bluez/files/0001-Allow-using-obexd-without-systemd-in-the-user-session-r4.patch
new file mode 100644
index 000000000000..80c9046626e4
--- /dev/null
+++ b/net-wireless/bluez/files/0001-Allow-using-obexd-without-systemd-in-the-user-session-r4.patch
@@ -0,0 +1,20 @@
+--- a/Makefile.obexd
++++ b/Makefile.obexd
+@@ -4,15 +4,14 @@
+ if SYSTEMD
+ systemduserunit_DATA += obexd/src/obex.service
+ 
+-dbussessionbusdir = $(DBUS_SESSIONBUSDIR)
+-dbussessionbus_DATA = obexd/src/org.bluez.obex.service
+-
+ obexd-add-service-symlink:
+ 	$(LN_S) -f obex.service $(DESTDIR)$(SYSTEMD_USERUNITDIR)/dbus-org.bluez.obex.service
+ 
+ obexd-remove-service-symlink:
+ 	rm -f $(DESTDIR)$(SYSTEMD_USERUNITDIR)/dbus-org.bluez.obex.service
+ else
++dbussessionbusdir = $(DBUS_SESSIONBUSDIR)
++dbussessionbus_DATA = obexd/src/org.bluez.obex.service
+ obexd-add-service-symlink:
+ obexd-remove-service-symlink:
+ endif

diff --git a/net-wireless/bluez/files/bluez-5.79-musl-gdbus.patch b/net-wireless/bluez/files/bluez-5.79-musl-gdbus.patch
new file mode 100644
index 000000000000..c2b9474f45a0
--- /dev/null
+++ b/net-wireless/bluez/files/bluez-5.79-musl-gdbus.patch
@@ -0,0 +1,27 @@
+From 9d69dba21f1e46b34cdd8ae27fec11d0803907ee Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Gu=C3=B0ni=20M=C3=A1r=20Gilbert?= <gudni.m.g@gmail.com>
+Date: Sat, 2 Nov 2024 16:10:18 +0000
+Subject: [PATCH] gdbus: define MAX_INPUT for musl
+
+This is the same solution as was done in src/shared/util.c
+---
+ gdbus/object.c | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/gdbus/object.c b/gdbus/object.c
+index 84f116bf1..7b0476f1a 100644
+--- a/gdbus/object.c
++++ b/gdbus/object.c
+@@ -20,6 +20,12 @@
+ #include <dbus/dbus.h>
+ 
+ #include "gdbus.h"
++
++/* define MAX_INPUT for musl */
++#ifndef MAX_INPUT
++#define MAX_INPUT _POSIX_MAX_INPUT
++#endif
++
+ #include "src/shared/util.h"
+ 
+ #define info(fmt...)

diff --git a/net-wireless/bluez/files/bluez-disable-test-vcp.patch b/net-wireless/bluez/files/bluez-disable-test-vcp.patch
new file mode 100644
index 000000000000..ffbdbddea17a
--- /dev/null
+++ b/net-wireless/bluez/files/bluez-disable-test-vcp.patch
@@ -0,0 +1,24 @@
+From 1d5a2ec8eb96e9186aeb2826927057ddc7a9d0a6 Mon Sep 17 00:00:00 2001
+From: macmpi <16296055+macmpi@users.noreply.github.com>
+Date: Wed, 17 Jan 2024 09:34:28 +0100
+Subject: [PATCH] disable test_aics_unit_testcases
+
+fails on x86-64
+https://github.com/bluez/bluez/issues/726
+---
+ unit/test-vcp.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/unit/test-vcp.c b/unit/test-vcp.c
+index 6a61ea2c44..3886177758 100644
+--- a/unit/test-vcp.c
++++ b/unit/test-vcp.c
+@@ -2754,7 +2754,7 @@ int main(int argc, char *argv[])
+ 	tester_init(&argc, &argv);
+ 
+ 	test_vocs_unit_testcases();
+-	test_aics_unit_testcases();
++//	test_aics_unit_testcases(); test fails on x86-64
+ 
+ 	return tester_run();
+ }


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-wireless/bluez/, net-wireless/bluez/files/
@ 2024-11-24 22:30 Sam James
  0 siblings, 0 replies; 22+ messages in thread
From: Sam James @ 2024-11-24 22:30 UTC (permalink / raw
  To: gentoo-commits

commit:     08cc05caea45f6b7c53d95cc5d680055754ef7bb
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sun Nov 24 22:29:16 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Nov 24 22:29:16 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=08cc05ca

net-wireless/bluez: partly fix C23 compat

Noticed when looking at bug #944059. This issue was already fixed
by the GCC change referenced in bug #943809 but I already did the work
to backport these, so let's pull them in.

The issue in bug #944059 is an issue in sys-libs/readline which needs
to be addressed separately.

Bug: https://bugs.gentoo.org/943809
Bug: https://bugs.gentoo.org/944059
Signed-off-by: Sam James <sam <AT> gentoo.org>

 net-wireless/bluez/bluez-5.79.ebuild          |   3 +
 net-wireless/bluez/files/bluez-5.79-c23.patch | 123 ++++++++++++++++++++++++++
 2 files changed, 126 insertions(+)

diff --git a/net-wireless/bluez/bluez-5.79.ebuild b/net-wireless/bluez/bluez-5.79.ebuild
index fbcd5d01a0d6..c5921065eaf1 100644
--- a/net-wireless/bluez/bluez-5.79.ebuild
+++ b/net-wireless/bluez/bluez-5.79.ebuild
@@ -73,6 +73,9 @@ PATCHES=(
 	# https://bugs.gentoo.org/928365
 	# https://github.com/bluez/bluez/issues/726
 	"${FILESDIR}"/${PN}-disable-test-vcp.patch
+
+	# bug #944059
+	"${FILESDIR}"/${P}-c23.patch
 )
 
 pkg_setup() {

diff --git a/net-wireless/bluez/files/bluez-5.79-c23.patch b/net-wireless/bluez/files/bluez-5.79-c23.patch
new file mode 100644
index 000000000000..af790901b3b7
--- /dev/null
+++ b/net-wireless/bluez/files/bluez-5.79-c23.patch
@@ -0,0 +1,123 @@
+https://bugs.gentoo.org/943809
+https://github.com/bluez/bluez/commit/da5b5b0ecb1ead38676768ef78d46449d404bdc0
+https://github.com/bluez/bluez/commit/4d60826865c760cc4e5718b6414746a394768110
+https://github.com/bluez/bluez/commit/6f3111eb680df9c13502aacd65554846a9e13a3f
+
+From da5b5b0ecb1ead38676768ef78d46449d404bdc0 Mon Sep 17 00:00:00 2001
+From: Rudi Heitbaum <rudi@heitbaum.com>
+Date: Wed, 20 Nov 2024 13:02:56 +0000
+Subject: [PATCH] shared/ad: fix -std=c23 build failure
+
+gcc-15 switched to -std=c23 by default:
+
+    https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=55e3bd376b2214e200fa76d12b67ff259b06c212
+
+As a result `bluez` fails the build as:
+
+    src/shared/ad.c:1090:24: error: incompatible types when returning type '_Bool' but 'const char *' was expected
+     1090 |                 return false;
+          |                        ^~~~~
+---
+ src/shared/ad.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/shared/ad.c b/src/shared/ad.c
+index d08ce7af9b..dac381bbe6 100644
+--- a/src/shared/ad.c
++++ b/src/shared/ad.c
+@@ -1087,7 +1087,7 @@ bool bt_ad_add_name(struct bt_ad *ad, const char *name)
+ const char *bt_ad_get_name(struct bt_ad *ad)
+ {
+ 	if (!ad)
+-		return false;
++		return NULL;
+ 
+ 	return ad->name;
+ }
+
+From 4d60826865c760cc4e5718b6414746a394768110 Mon Sep 17 00:00:00 2001
+From: Rudi Heitbaum <rudi@heitbaum.com>
+Date: Wed, 20 Nov 2024 13:03:29 +0000
+Subject: [PATCH] shared/shell: fix -std=c23 build failure
+
+gcc-15 switched to -std=c23 by default:
+
+    https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=55e3bd376b2214e200fa76d12b67ff259b06c212
+
+As a result `bluez` fails the build as:
+
+    src/shared/shell.c:365:24: error: incompatible types when returning type '_Bool' but 'struct input *' was expected
+      365 |                 return false;
+          |                        ^~~~~
+---
+ src/shared/shell.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/shared/shell.c b/src/shared/shell.c
+index a8fa87696..aa6c16c8c 100644
+--- a/src/shared/shell.c
++++ b/src/shared/shell.c
+@@ -362,7 +362,7 @@ static struct input *input_new(int fd)
+ 
+ 	io = io_new(fd);
+ 	if (!io)
+-		return false;
++		return NULL;
+ 
+ 	input = new0(struct input, 1);
+ 	input->io = io;
+From 6f3111eb680df9c13502aacd65554846a9e13a3f Mon Sep 17 00:00:00 2001
+From: Rudi Heitbaum <rudi@heitbaum.com>
+Date: Wed, 20 Nov 2024 13:03:55 +0000
+Subject: [PATCH] shared/gatt-helpers: fix -std=c23 build failure
+
+gcc-15 switched to -std=c23 by default:
+
+    https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=55e3bd376b2214e200fa76d12b67ff259b06c212
+
+As a result `bluez` fails the build as:
+
+    src/shared/gatt-helpers.c:1136:24: error: incompatible types when returning type '_Bool' but 'struct bt_gatt_request *' was expected
+     1136 |                 return false;
+          |                        ^~~~~
+    src/shared/gatt-helpers.c:1250:24: error: incompatible types when returning type '_Bool' but 'struct bt_gatt_request *' was expected
+     1250 |                 return false;
+          |                        ^~~~~
+    src/shared/gatt-helpers.c:1478:24: error: incompatible types when returning type '_Bool' but 'struct bt_gatt_request *' was expected
+     1478 |                 return false;
+          |                        ^~~~~
+---
+ src/shared/gatt-helpers.c | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/src/shared/gatt-helpers.c b/src/shared/gatt-helpers.c
+index 50fcb269be..f1fa6300a1 100644
+--- a/src/shared/gatt-helpers.c
++++ b/src/shared/gatt-helpers.c
+@@ -1133,7 +1133,7 @@ struct bt_gatt_request *bt_gatt_discover_included_services(struct bt_att *att,
+ 	uint8_t pdu[6];
+ 
+ 	if (!att)
+-		return false;
++		return NULL;
+ 
+ 	op = new0(struct bt_gatt_request, 1);
+ 	op->att = att;
+@@ -1247,7 +1247,7 @@ struct bt_gatt_request *bt_gatt_discover_characteristics(struct bt_att *att,
+ 	uint8_t pdu[6];
+ 
+ 	if (!att)
+-		return false;
++		return NULL;
+ 
+ 	op = new0(struct bt_gatt_request, 1);
+ 	op->att = att;
+@@ -1475,7 +1475,7 @@ struct bt_gatt_request *bt_gatt_discover_descriptors(struct bt_att *att,
+ 	uint8_t pdu[4];
+ 
+ 	if (!att)
+-		return false;
++		return NULL;
+ 
+ 	op = new0(struct bt_gatt_request, 1);
+ 	op->att = att;


^ permalink raw reply related	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2024-11-24 22:30 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-12-02 13:31 [gentoo-commits] repo/gentoo:master commit in: net-wireless/bluez/, net-wireless/bluez/files/ Pacho Ramos
  -- strict thread matches above, loose matches on Subject: below --
2024-11-24 22:30 Sam James
2024-11-08 15:51 Pacho Ramos
2024-09-24  6:12 Sam James
2024-09-15 11:41 Pacho Ramos
2024-06-16 11:40 Pacho Ramos
2023-08-23 14:49 Pacho Ramos
2023-07-08 10:00 Pacho Ramos
2023-01-31  5:56 Sam James
2022-09-11  7:50 Pacho Ramos
2022-09-11  7:50 Pacho Ramos
2022-04-18 16:27 Pacho Ramos
2022-01-09 19:52 Pacho Ramos
2021-07-08  8:09 Pacho Ramos
2021-06-05 10:53 Pacho Ramos
2020-03-11 15:01 Pacho Ramos
2019-11-10 12:11 Pacho Ramos
2019-11-10 12:11 Pacho Ramos
2019-10-20  8:55 Pacho Ramos
2019-09-29 13:47 Pacho Ramos
2019-04-29 12:22 Pacho Ramos
2016-04-09 10:49 Pacho Ramos

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox