public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: net-wireless/bluez/files/, net-wireless/bluez/
@ 2016-02-12  8:50 Jeroen Roovers
  0 siblings, 0 replies; 22+ messages in thread
From: Jeroen Roovers @ 2016-02-12  8:50 UTC (permalink / raw
  To: gentoo-commits

commit:     30bdbd6c5ddc734020e35260ac1fb0848d769488
Author:     Jeroen Roovers <jer <AT> gentoo <DOT> org>
AuthorDate: Fri Feb 12 08:49:55 2016 +0000
Commit:     Jeroen Roovers <jer <AT> gentoo <DOT> org>
CommitDate: Fri Feb 12 08:50:17 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=30bdbd6c

net-wireless/bluez: Fix endian compile error (bug #574092).

Package-Manager: portage-2.2.27

 net-wireless/bluez/bluez-5.37.ebuild             |  3 ++
 net-wireless/bluez/files/bluez-5.37-endian.patch | 51 ++++++++++++++++++++++++
 2 files changed, 54 insertions(+)

diff --git a/net-wireless/bluez/bluez-5.37.ebuild b/net-wireless/bluez/bluez-5.37.ebuild
index fd9b88a..e3704f8 100644
--- a/net-wireless/bluez/bluez-5.37.ebuild
+++ b/net-wireless/bluez/bluez-5.37.ebuild
@@ -92,6 +92,9 @@ src_prepare() {
 	# ???
 	epatch "${FILESDIR}"/0004-agent-Assert-possible-infinite-loop.patch
 
+	# bug 574092
+	epatch "${FILESDIR}"/${PN}-5.37-endian.patch
+
 	if use cups; then
 		sed -i \
 			-e "s:cupsdir = \$(libdir)/cups:cupsdir = $(cups-config --serverbin):" \

diff --git a/net-wireless/bluez/files/bluez-5.37-endian.patch b/net-wireless/bluez/files/bluez-5.37-endian.patch
new file mode 100644
index 0000000..1ffa350
--- /dev/null
+++ b/net-wireless/bluez/files/bluez-5.37-endian.patch
@@ -0,0 +1,51 @@
+--- a/profiles/audio/a2dp-codecs.h
++++ b/profiles/audio/a2dp-codecs.h
+@@ -149,6 +149,17 @@
+ 	uint16_t codec_id;
+ } __attribute__ ((packed)) a2dp_vendor_codec_t;
+ 
++typedef struct {
++	a2dp_vendor_codec_t info;
++	uint8_t channel_mode:4;
++	uint8_t frequency:4;
++} __attribute__ ((packed)) a2dp_aptx_t;
++
++typedef struct {
++	a2dp_vendor_codec_t info;
++	uint8_t unknown[2];
++} __attribute__ ((packed)) a2dp_ldac_t;
++
+ #if __BYTE_ORDER == __LITTLE_ENDIAN
+ 
+ typedef struct {
+@@ -183,17 +194,6 @@
+ 	uint8_t bitrate3;
+ } __attribute__ ((packed)) a2dp_aac_t;
+ 
+-typedef struct {
+-	a2dp_vendor_codec_t info;
+-	uint8_t channel_mode:4;
+-	uint8_t frequency:4;
+-} __attribute__ ((packed)) a2dp_aptx_t;
+-
+-typedef struct {
+-	a2dp_vendor_codec_t info;
+-	uint8_t unknown[2];
+-} __attribute__ ((packed)) a2dp_ldac_t;
+-
+ #elif __BYTE_ORDER == __BIG_ENDIAN
+ 
+ typedef struct {
+@@ -228,12 +228,6 @@
+ 	uint8_t bitrate3;
+ } __attribute__ ((packed)) a2dp_aac_t;
+ 
+-typedef struct {
+-	a2dp_vendor_codec_t info;
+-	uint8_t frequency:4;
+-	uint8_t channel_mode:4;
+-} __attribute__ ((packed)) a2dp_aptx_t;
+-
+ #else
+ #error "Unknown byte order"
+ #endif


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

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

commit:     b4723357d9721f055a054bb0bfd1596cbfea96b1
Author:     Pacho Ramos <pacho <AT> gentoo <DOT> org>
AuthorDate: Sat Feb  4 15:19:44 2017 +0000
Commit:     Pacho Ramos <pacho <AT> gentoo <DOT> org>
CommitDate: Sat Feb  4 15:20:18 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b4723357

net-wireless/bluez: Drop old

Package-Manager: Portage-2.3.3, Repoman-2.3.1

 net-wireless/bluez/Manifest                  |   3 -
 net-wireless/bluez/bluez-4.101-r9.ebuild     | 204 ----------------------
 net-wireless/bluez/bluez-5.39.ebuild         | 235 --------------------------
 net-wireless/bluez/bluez-5.43.ebuild         | 244 ---------------------------
 net-wireless/bluez/files/bluetooth-init.d-r2 |  21 ---
 net-wireless/bluez/files/rfcomm-conf.d       |   5 -
 net-wireless/bluez/files/rfcomm-init.d       |  27 ---
 7 files changed, 739 deletions(-)

diff --git a/net-wireless/bluez/Manifest b/net-wireless/bluez/Manifest
index e479f0d..ae52d98 100644
--- a/net-wireless/bluez/Manifest
+++ b/net-wireless/bluez/Manifest
@@ -1,4 +1 @@
-DIST bluez-4.101-patches.tar.xz 12380 SHA256 ea4b837245080ebe904fe4f338cd3c8c1370e197cdfbcd42bd55430c940b5e13 SHA512 0ef3219ed923a0880b2fe7008c36c185ff631a8fe1b357cc3612888817d9a7eaa6624bd31ed00a8bbbb6739528cb777a0b9900a7db4930482d1cbc38417b89aa WHIRLPOOL b89729b2cb1ecd6c816210682605b275af396af056e85d9a8671192ede0470002c1f61931781f27ad988ce8bc137f69a6725008a5ea9fe743ae41bc2f5edc7e8
-DIST bluez-4.101.tar.xz 887236 SHA256 41f9578bef39b8c94a2d6ddeaa556afd22d136936d0f03100e422fe970a45a7d SHA512 c8a88fa6948e43c81687047856806c9dc576d3223371947b496f228dec2b2614d1c5a8ff587e9f26eec44843a50503c55861f9fa736fdba43b2364f663f0cb0d WHIRLPOOL 0c4f163e4f4d0ba8f7928f5330ac3fd5f204c299346c59e73b64ebb331b0887a2b01e8ed6f4e6ae91f826a0431df4f97fe3a0900fa6013ae66fd755aaa136196
-DIST bluez-5.39.tar.xz 1659576 SHA256 21d1bc9150d3576296595217efb98a746b592389d25d5637e8bee5da7272593b SHA512 a0c43d0de4dcbfa20bbfe34e805a60703f4b94d0aa6c1d128a0917dfaa490593b26eb555b0a343ff44d1f94349b61776189438039e489ddcf8fe107354740230 WHIRLPOOL da299f8556418cf38d5a05b91079fdb6ff85761127d4708783bcd97fa4502e208187c013b1d8622688b438308506fbb06732426c35f6fedc2fe25cfd68a93486
 DIST bluez-5.43.tar.xz 1658348 SHA256 16c9c05d2a1da644ce3570d975ada3643d2e60c007a955bac09c0a0efeb58d15 SHA512 a48ac3d196a16fdfe7ef9bdc9a4ed8c9d40054e4f801a27a45150ce46e655ceff6264d230721065081d865c8b1f754ea0c407acc84fd299529aba048ce31889c WHIRLPOOL b63fcb8f9784122168f89902a74d811cc6236999de5dfe62b425032ac4d51923742f77d6d9957b3811c9584d194065bba184daf47882b1f09f760184a18838e9

diff --git a/net-wireless/bluez/bluez-4.101-r9.ebuild b/net-wireless/bluez/bluez-4.101-r9.ebuild
deleted file mode 100644
index 7e638fc..00000000
--- a/net-wireless/bluez/bluez-4.101-r9.ebuild
+++ /dev/null
@@ -1,204 +0,0 @@
-# Copyright 1999-2015 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id$
-
-EAPI=5
-PYTHON_COMPAT=( python2_7 )
-inherit autotools eutils multilib python-single-r1 readme.gentoo \
-	systemd 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
-	https://dev.gentoo.org/~pacho/bluez/${P}-patches.tar.xz"
-
-LICENSE="GPL-2 LGPL-2.1"
-SLOT="0"
-KEYWORDS="amd64 arm hppa ppc ppc64 x86"
-IUSE="alsa cups debug gstreamer hid2hci pcmcia readline selinux test-programs usb"
-
-REQUIRED_USE="test-programs? ( ${PYTHON_REQUIRED_USE} )"
-
-# TODO: revisit USE=gstreamer once gstreamer is ported to multilib
-
-CDEPEND="
-	>=dev-libs/glib-2.28:2
-	>=sys-apps/dbus-1.6:=
-	>=sys-apps/hwids-20121202.2
-	>=virtual/udev-171
-	alsa? (
-		>=media-libs/alsa-lib-1.0.27.2:=[${MULTILIB_USEDEP},alsa_pcm_plugins_extplug(+),alsa_pcm_plugins_ioplug(+)]
-		media-libs/libsndfile:=
-	)
-	cups? ( net-print/cups:= )
-	gstreamer? (
-		>=media-libs/gstreamer-0.10:0.10
-		>=media-libs/gst-plugins-base-0.10:0.10
-	)
-	readline? ( sys-libs/readline:= )
-	selinux? ( sec-policy/selinux-bluetooth )
-	usb? ( virtual/libusb:0 )
-"
-DEPEND="${CDEPEND}
-	sys-devel/flex
-	>=virtual/pkgconfig-0-r1[${MULTILIB_USEDEP}]
-	test-programs? ( >=dev-libs/check-0.9.6 )
-"
-RDEPEND="${CDEPEND}
-	test-programs? (
-		>=dev-python/dbus-python-1
-		dev-python/pygobject:2
-		dev-python/pygobject:3
-		${PYTHON_DEPS}
-	)
-	abi_x86_32? (
-		!<app-emulation/emul-linux-x86-soundlibs-20140406-r1
-		!app-emulation/emul-linux-x86-soundlibs[-abi_x86_32]
-	)
-"
-
-DOCS=( AUTHORS ChangeLog README )
-
-DOC_CONTENTS="
-	If you want to use rfcomm as a normal user, you need to add the user
-	to the uucp group.
-"
-
-pkg_setup() {
-	enewgroup plugdev
-	use test-programs && python-single-r1_pkg_setup
-}
-
-src_prepare() {
-	# Fedora patches
-	epatch "${WORKDIR}/${P}-patches"/*.patch
-
-	# Use static group "plugdev" if there is no ConsoleKit (or systemd logind)
-	epatch "${FILESDIR}"/bluez-plugdev.patch
-
-	sed -e "s/AM_CONFIG_HEADER/AC_CONFIG_HEADERS/" -i configure.ac || die
-
-	eautoreconf
-
-	if use cups; then
-		sed -i \
-			-e "s:cupsdir = \$(libdir)/cups:cupsdir = `cups-config --serverbin`:" \
-			Makefile.{in,tools} || die
-	fi
-
-	multilib_copy_sources
-}
-
-multilib_src_configure() {
-	local myconf=(
-		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
-
-	# Missing flags: --enable-{sap,hidd,pand,dund,dbusoob,gatt}
-	# Keep this in ./configure --help order!
-	econf \
-		--localstatedir=/var \
-		--enable-network \
-		--enable-serial \
-		--enable-input \
-		--enable-audio \
-		--enable-service \
-		--enable-health \
-		--enable-pnat \
-		$(multilib_native_use_enable gstreamer) \
-		$(use_enable alsa) \
-		$(multilib_native_use_enable usb) \
-		$(multilib_native_use_enable usb cable) \
-		--enable-tools \
-		--enable-bccmd \
-		$(use_enable pcmcia) \
-		$(multilib_native_use_enable hid2hci) \
-		--enable-dfutool \
-		$(multilib_native_use_enable cups) \
-		$(multilib_native_use_enable test-programs test) \
-		--enable-datafiles \
-		$(use_enable debug) \
-		--enable-maemo6 \
-		--enable-wiimote \
-		--disable-hal \
-		--with-ouifile=/usr/share/misc/oui.txt \
-		--with-systemdunitdir="$(systemd_get_unitdir)"
-}
-
-multilib_src_compile() {
-	if multilib_is_native_abi; then
-		default
-	else
-		emake -f Makefile -f - libs \
-			<<<'libs: $(lib_LTLIBRARIES) $(alsa_LTLIBRARIES)'
-	fi
-}
-
-multilib_src_test() {
-	multilib_is_native_abi && default
-}
-
-multilib_src_install() {
-	if multilib_is_native_abi; then
-		emake DESTDIR="${D}" install
-	else
-		emake DESTDIR="${D}" \
-			install-includeHEADERS \
-			install-libLTLIBRARIES \
-			install-alsaLTLIBRARIES \
-			install-pkgconfigDATA
-	fi
-
-	if multilib_is_native_abi && use test-programs; then
-		pushd test >/dev/null
-		dobin simple-agent simple-service monitor-bluetooth
-		newbin list-devices list-bluetooth-devices
-		rm test-textfile.{c,o} || die #356529
-		local b
-		for b in hsmicro hsplay test-*; do
-			newbin "${b}" bluez-"${b}"
-		done
-		insinto /usr/share/doc/${PF}/test-services
-		doins service-*
-		python_fix_shebang "${ED}"
-		popd >/dev/null
-	fi
-}
-
-multilib_src_install_all() {
-	insinto /etc/bluetooth
-	local d
-	for d in input audio network serial; do
-		doins ${d}/${d}.conf
-	done
-
-	newinitd "${FILESDIR}"/bluetooth-init.d-r2 bluetooth
-	newinitd "${FILESDIR}"/rfcomm-init.d rfcomm
-	newconfd "${FILESDIR}"/rfcomm-conf.d rfcomm
-
-	readme.gentoo_create_doc
-
-	prune_libtool_files --modules
-}
-
-pkg_postinst() {
-	readme.gentoo_print_elog
-
-	udevadm control --reload-rules
-
-	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 only"
-		elog "be able to run bluetooth clients as root. If you want to be able to run bluetooth clientes as"
-		elog "a regular user, you need to enable the consolekit use flag for this package or"
-		elog "to add the user to the plugdev group."
-	fi
-}

diff --git a/net-wireless/bluez/bluez-5.39.ebuild b/net-wireless/bluez/bluez-5.39.ebuild
deleted file mode 100644
index 7931cf8..00000000
--- a/net-wireless/bluez/bluez-5.39.ebuild
+++ /dev/null
@@ -1,235 +0,0 @@
-# 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/bluez-5.43.ebuild b/net-wireless/bluez/bluez-5.43.ebuild
deleted file mode 100644
index f0b2534..00000000
--- a/net-wireless/bluez/bluez-5.43.ebuild
+++ /dev/null
@@ -1,244 +0,0 @@
-# Copyright 1999-2017 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id$
-
-EAPI=6
-PYTHON_COMPAT=( python2_7 )
-
-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"
-# 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? ( readline )
-	test? ( ${PYTHON_REQUIRED_USE} )
-	test-programs? ( ${PYTHON_REQUIRED_USE} )
-"
-
-CDEPEND="
-	>=dev-libs/glib-2.28:2[${MULTILIB_USEDEP}]
-	>=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
-		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() {
-	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/bluetooth-init.d-r2 b/net-wireless/bluez/files/bluetooth-init.d-r2
deleted file mode 100644
index d16181e..00000000
--- a/net-wireless/bluez/files/bluetooth-init.d-r2
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/sbin/openrc-run
-# Copyright 1999-2012 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id$
-
-depend() {
-	after coldplug
-	need dbus localmount hostname
-}
-
-start() {
-   	ebegin "Starting ${SVCNAME}"
-	start-stop-daemon --start --exec /usr/sbin/bluetoothd
-	eend $?
-}
-
-stop() {
-	ebegin "Shutting down ${SVCNAME}"
-	start-stop-daemon --stop --quiet --exec /usr/sbin/bluetoothd
-	eend $?
-}

diff --git a/net-wireless/bluez/files/rfcomm-conf.d b/net-wireless/bluez/files/rfcomm-conf.d
deleted file mode 100644
index d87acdb..00000000
--- a/net-wireless/bluez/files/rfcomm-conf.d
+++ /dev/null
@@ -1,5 +0,0 @@
-# Bind rfcomm devices (allowed values are "true" and "false")
-RFCOMM_ENABLE=true
-
-# Config file for rfcomm
-RFCOMM_CONFIG="/etc/bluetooth/rfcomm.conf"

diff --git a/net-wireless/bluez/files/rfcomm-init.d b/net-wireless/bluez/files/rfcomm-init.d
deleted file mode 100644
index 84095be..00000000
--- a/net-wireless/bluez/files/rfcomm-init.d
+++ /dev/null
@@ -1,27 +0,0 @@
-#!/sbin/openrc-run
-# Copyright 1999-2013 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id$
-
-depend() {
-	after coldplug
-	need dbus localmount hostname
-}
-
-start() {
-	if [ "${RFCOMM_ENABLE}" = "true" -a -x /usr/bin/rfcomm ]; then
-		if [ -f "${RFCOMM_CONFIG}" ]; then
-			ebegin "Starting rfcomm"
-			/usr/bin/rfcomm -f "${RFCOMM_CONFIG}" bind all
-			eend $?
-		else
-			ewarn "Not enabling rfcomm because RFCOMM_CONFIG does not exists"
-		fi
-	fi
-}
-
-stop() {
-	ebegin "Shutting down rfcomm"
-	/usr/bin/rfcomm release all
-	eend $?
-}


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

* [gentoo-commits] repo/gentoo:master commit in: net-wireless/bluez/files/, net-wireless/bluez/
@ 2017-09-14 17:23 Patrick McLean
  0 siblings, 0 replies; 22+ messages in thread
From: Patrick McLean @ 2017-09-14 17:23 UTC (permalink / raw
  To: gentoo-commits

commit:     ffd3f508463eb80c860adcae5f966ca2ab92b92b
Author:     Patrick McLean <chutzpah <AT> gentoo <DOT> org>
AuthorDate: Thu Sep 14 17:22:55 2017 +0000
Commit:     Patrick McLean <chutzpah <AT> gentoo <DOT> org>
CommitDate: Thu Sep 14 17:23:19 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ffd3f508

net-wireless/bluez: Revision bump to 5.47-r1, update OpenRC init script

Gentoo-Bug: 630988
Package-Manager: Portage-2.3.8, Repoman-2.3.3

 .../bluez/{bluez-5.47.ebuild => bluez-5.47-r1.ebuild}        |  2 +-
 net-wireless/bluez/files/bluetooth-init.d-r4                 | 12 ++++++++++++
 2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/net-wireless/bluez/bluez-5.47.ebuild b/net-wireless/bluez/bluez-5.47-r1.ebuild
similarity index 99%
rename from net-wireless/bluez/bluez-5.47.ebuild
rename to net-wireless/bluez/bluez-5.47-r1.ebuild
index 1549f18010f..e60d2611e3f 100644
--- a/net-wireless/bluez/bluez-5.47.ebuild
+++ b/net-wireless/bluez/bluez-5.47-r1.ebuild
@@ -245,7 +245,7 @@ multilib_src_install_all() {
 	done
 	doins src/main.conf
 
-	newinitd "${FILESDIR}"/bluetooth-init.d-r3 bluetooth
+	newinitd "${FILESDIR}"/bluetooth-init.d-r4 bluetooth
 	newinitd "${FILESDIR}"/rfcomm-init.d-r2 rfcomm
 
 	einstalldocs

diff --git a/net-wireless/bluez/files/bluetooth-init.d-r4 b/net-wireless/bluez/files/bluetooth-init.d-r4
new file mode 100755
index 00000000000..97cf500008e
--- /dev/null
+++ b/net-wireless/bluez/files/bluetooth-init.d-r4
@@ -0,0 +1,12 @@
+#!/sbin/openrc-run
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+pidfile="/run/bluetoothd.pid"
+command="/usr/libexec/bluetooth/bluetoothd"
+command_background=1
+
+depend() {
+	after coldplug
+	need dbus localmount hostname
+}


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

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

commit:     19474b4a6cf48f0df05a9d3ad03a6ea470ef44ec
Author:     Pacho Ramos <pacho <AT> gentoo <DOT> org>
AuthorDate: Sun Sep 24 21:26:35 2017 +0000
Commit:     Pacho Ramos <pacho <AT> gentoo <DOT> org>
CommitDate: Sun Sep 24 21:26:35 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=19474b4a

net-wireless/bluez: Drop old

Package-Manager: Portage-2.3.10, Repoman-2.3.3

 net-wireless/bluez/Manifest                  |   1 -
 net-wireless/bluez/bluez-5.43-r1.ebuild      | 255 ---------------------------
 net-wireless/bluez/files/bluetooth-init.d-r3 |  20 ---
 3 files changed, 276 deletions(-)

diff --git a/net-wireless/bluez/Manifest b/net-wireless/bluez/Manifest
index 98dccd62079..cdd113dc8ac 100644
--- a/net-wireless/bluez/Manifest
+++ b/net-wireless/bluez/Manifest
@@ -1,2 +1 @@
-DIST bluez-5.43.tar.xz 1658348 SHA256 16c9c05d2a1da644ce3570d975ada3643d2e60c007a955bac09c0a0efeb58d15 SHA512 a48ac3d196a16fdfe7ef9bdc9a4ed8c9d40054e4f801a27a45150ce46e655ceff6264d230721065081d865c8b1f754ea0c407acc84fd299529aba048ce31889c WHIRLPOOL b63fcb8f9784122168f89902a74d811cc6236999de5dfe62b425032ac4d51923742f77d6d9957b3811c9584d194065bba184daf47882b1f09f760184a18838e9
 DIST bluez-5.47.tar.xz 1718920 SHA256 cf75bf7cd5d564f21cc4a2bd01d5c39ce425397335fd47d9bbe43af0a58342c8 SHA512 86fa1baae1593d4824038db8418358b0be624c81fc23ee8f96ec08979d309a2377be3924ab53cc0fcb712aec8e696360e9a9f4de4c12cc31b14de5cf495a11a6 WHIRLPOOL c3b2999ea73804f905b81222db9e5f3df0e9b3b7b4ed888a9b7ce760f831c335080ef35368b62d837f2d2d1695cf18d845a1259bb6d76ee8d6ff17b5197abf01

diff --git a/net-wireless/bluez/bluez-5.43-r1.ebuild b/net-wireless/bluez/bluez-5.43-r1.ebuild
deleted file mode 100644
index e041949288f..00000000000
--- a/net-wireless/bluez/bluez-5.43-r1.ebuild
+++ /dev/null
@@ -1,255 +0,0 @@
-# Copyright 1999-2017 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=6
-PYTHON_COMPAT=( python2_7 )
-
-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 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? ( 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
-	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
-	# http://article.gmane.org/gmane.linux.bluez.kernel/67230
-	"${FILESDIR}"/bluez-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
-
-	# 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
-
-	# 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
-
-	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
-		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
-
-	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
-	systemd_reenable bluetooth.service
-
-	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/bluetooth-init.d-r3 b/net-wireless/bluez/files/bluetooth-init.d-r3
deleted file mode 100644
index b54f47d16ff..00000000000
--- a/net-wireless/bluez/files/bluetooth-init.d-r3
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/sbin/openrc-run
-# Copyright 1999-2014 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-depend() {
-	after coldplug
-	need dbus localmount hostname
-}
-
-start() {
-   	ebegin "Starting ${SVCNAME}"
-	start-stop-daemon --start --background --exec /usr/libexec/bluetooth/bluetoothd
-	eend $?
-}
-
-stop() {
-	ebegin "Shutting down ${SVCNAME}"
-	start-stop-daemon --stop --quiet --exec /usr/libexec/bluetooth/bluetoothd
-	eend $?
-}


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

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

commit:     5f6f22e0b7c30080a493a439178ee2b7a92b4afe
Author:     Pacho Ramos <pacho <AT> gentoo <DOT> org>
AuthorDate: Wed May 23 18:36:23 2018 +0000
Commit:     Pacho Ramos <pacho <AT> gentoo <DOT> org>
CommitDate: Wed May 23 18:52:21 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5f6f22e0

net-wireless/bluez: Fix crash with non-LE devices (#655114)

Package-Manager: Portage-2.3.31, Repoman-2.3.9

 net-wireless/bluez/bluez-5.49-r1.ebuild            | 263 +++++++++++++++++++++
 .../bluez/files/bluez-5.49-crash-non-LE.patch      |  51 ++++
 2 files changed, 314 insertions(+)

diff --git a/net-wireless/bluez/bluez-5.49-r1.ebuild b/net-wireless/bluez/bluez-5.49-r1.ebuild
new file mode 100644
index 00000000000..d5c27acdb57
--- /dev/null
+++ b/net-wireless/bluez/bluez-5.49-r1.ebuild
@@ -0,0 +1,263 @@
+# 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/files/bluez-5.49-crash-non-LE.patch b/net-wireless/bluez/files/bluez-5.49-crash-non-LE.patch
new file mode 100644
index 00000000000..b66868e7140
--- /dev/null
+++ b/net-wireless/bluez/files/bluez-5.49-crash-non-LE.patch
@@ -0,0 +1,51 @@
+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/files/, net-wireless/bluez/
@ 2019-01-19  8:56 Pacho Ramos
  0 siblings, 0 replies; 22+ messages in thread
From: Pacho Ramos @ 2019-01-19  8:56 UTC (permalink / raw
  To: gentoo-commits

commit:     d24e675eb6f2d5c6db5de9bab734a4340e4dbc01
Author:     Pacho Ramos <pacho <AT> gentoo <DOT> org>
AuthorDate: Sat Jan 19 08:17:18 2019 +0000
Commit:     Pacho Ramos <pacho <AT> gentoo <DOT> org>
CommitDate: Sat Jan 19 08:56:23 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d24e675e

net-wireless/bluez: Fix missing header build failure

Thanks-to: Dennis Schridde
Thanks-to: W. Duijvenvoorde
Closes: https://bugs.gentoo.org/675362
Package-Manager: Portage-2.3.55, Repoman-2.3.12
Signed-off-by: Pacho Ramos <pacho <AT> gentoo.org>

 net-wireless/bluez/bluez-5.50-r1.ebuild                    |  3 +++
 net-wireless/bluez/files/bluez-5.50-btpclient-header.patch | 10 ++++++++++
 2 files changed, 13 insertions(+)

diff --git a/net-wireless/bluez/bluez-5.50-r1.ebuild b/net-wireless/bluez/bluez-5.50-r1.ebuild
index 176d40c87d0..677e62aad26 100644
--- a/net-wireless/bluez/bluez-5.50-r1.ebuild
+++ b/net-wireless/bluez/bluez-5.50-r1.ebuild
@@ -60,6 +60,9 @@ DOC_CONTENTS="
 "
 
 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

diff --git a/net-wireless/bluez/files/bluez-5.50-btpclient-header.patch b/net-wireless/bluez/files/bluez-5.50-btpclient-header.patch
new file mode 100644
index 00000000000..61a8e6a3742
--- /dev/null
+++ b/net-wireless/bluez/files/bluez-5.50-btpclient-header.patch
@@ -0,0 +1,10 @@
+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>


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

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

commit:     d0fe48785cce688dd6838794c810a3786c1bc1ef
Author:     Pacho Ramos <pacho <AT> gentoo <DOT> org>
AuthorDate: Mon Jun 10 11:22:54 2019 +0000
Commit:     Pacho Ramos <pacho <AT> gentoo <DOT> org>
CommitDate: Mon Jun 10 11:22:54 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d0fe4878

net-wireless/bluez: Backport lots of fixes (from Fedora)...

- Include multiple fixes backported by Fedora people
- Stop relying on plugdev group and follow upstream policy (#679034)
- Update udevadm PATH for current systemd (#539844)
- Rename USE alsa to midi (#658862)

Closes: https://bugs.gentoo.org/679034
Closes: https://bugs.gentoo.org/658862
Bug: https://bugs.gentoo.org/539844
Package-Manager: Portage-2.3.67, Repoman-2.3.13
Signed-off-by: Pacho Ramos <pacho <AT> gentoo.org>

 net-wireless/bluez/Manifest                        |   1 +
 net-wireless/bluez/bluez-5.50-r3.ebuild            | 267 +++++++++++++++++++++
 .../bluez/files/bluez-5.50-sink-connect.patch      |  72 ++++++
 .../bluez/files/bluez-udevadm-path-r1.patch        |  10 +
 net-wireless/bluez/metadata.xml                    |   9 +-
 5 files changed, 354 insertions(+), 5 deletions(-)

diff --git a/net-wireless/bluez/Manifest b/net-wireless/bluez/Manifest
index 0574b3c3473..2de1b406112 100644
--- a/net-wireless/bluez/Manifest
+++ b/net-wireless/bluez/Manifest
@@ -1 +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

diff --git a/net-wireless/bluez/bluez-5.50-r3.ebuild b/net-wireless/bluez/bluez-5.50-r3.ebuild
new file mode 100644
index 00000000000..c613f12d2fd
--- /dev/null
+++ b/net-wireless/bluez/bluez-5.50-r3.ebuild
@@ -0,0 +1,267 @@
+# 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="
+	mirror://kernel/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/files/bluez-5.50-sink-connect.patch b/net-wireless/bluez/files/bluez-5.50-sink-connect.patch
new file mode 100644
index 00000000000..2093b69a655
--- /dev/null
+++ b/net-wireless/bluez/files/bluez-5.50-sink-connect.patch
@@ -0,0 +1,72 @@
+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-r1.patch b/net-wireless/bluez/files/bluez-udevadm-path-r1.patch
new file mode 100644
index 00000000000..ac1c94ccd21
--- /dev/null
+++ b/net-wireless/bluez/files/bluez-udevadm-path-r1.patch
@@ -0,0 +1,10 @@
+--- 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}="/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

diff --git a/net-wireless/bluez/metadata.xml b/net-wireless/bluez/metadata.xml
index 3f1b1fdf5cd..31e86951f85 100644
--- a/net-wireless/bluez/metadata.xml
+++ b/net-wireless/bluez/metadata.xml
@@ -13,11 +13,10 @@
     purpose by default. All this tools shouldn't be used. Then, please
     notify upstream about you still need them to let them know the
     situation.</flag>
-  <flag name="mesh">Add support for Bluetooth Mesh control application and advertising
-    bearer.</flag>
-  <flag name="obex">Enable OBEX transfer support.</flag>
-  <flag name="test-programs">Install tools for testing of
-    various Bluetooth functions</flag>
+  <flag name="mesh">Add support for Bluetooth Mesh control application and advertising bearer.</flag>
+  <flag name="midi">Enable MIDI support</flag>
+  <flag name="obex">Enable OBEX transfer support</flag>
+  <flag name="test-programs">Install tools for testing of various Bluetooth functions</flag>
   <flag name="user-session">Allow compatibility with user-session semantics for session bus under systemd</flag>
 </use>
 <upstream>


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

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

commit:     01275fe1564faa3c830bca4b0ea900fb44bafb0f
Author:     Pacho Ramos <pacho <AT> gentoo <DOT> org>
AuthorDate: Sun Sep 29 10:58:47 2019 +0000
Commit:     Pacho Ramos <pacho <AT> gentoo <DOT> org>
CommitDate: Sun Sep 29 10:58:47 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=01275fe1

net-wireless/bluez: Version bump to 5.51

- Follow Fedora for installing few more needed extra-tools, AutoEnable
  bluetooth as soon as possible for keyboard/mouse devices.
- Install example files for meshctl (#662110)
- Fix QA issues (#694852)

Closes: https://bugs.gentoo.org/662110
Bug: https://bugs.gentoo.org/683230
Closes: https://bugs.gentoo.org/694852
Closes: https://bugs.gentoo.org/695316
Package-Manager: Portage-2.3.76, Repoman-2.3.17
Signed-off-by: Pacho Ramos <pacho <AT> gentoo.org>

 net-wireless/bluez/Manifest                      |   1 +
 net-wireless/bluez/bluez-5.51.ebuild             | 285 +++++++++++++++++++++++
 net-wireless/bluez/files/69-btattach-bcm.rules   |  33 +++
 net-wireless/bluez/files/bluetooth-init.d-r4     |   2 +-
 net-wireless/bluez/files/btattach-bcm-service.sh |  30 +++
 net-wireless/bluez/files/btattach-bcm_at.service |   6 +
 6 files changed, 356 insertions(+), 1 deletion(-)

diff --git a/net-wireless/bluez/Manifest b/net-wireless/bluez/Manifest
index 2de1b406112..042c13a4249 100644
--- a/net-wireless/bluez/Manifest
+++ b/net-wireless/bluez/Manifest
@@ -1,2 +1,3 @@
 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

diff --git a/net-wireless/bluez/bluez-5.51.ebuild b/net-wireless/bluez/bluez-5.51.ebuild
new file mode 100644
index 00000000000..b777edab5bc
--- /dev/null
+++ b/net-wireless/bluez/bluez-5.51.ebuild
@@ -0,0 +1,285 @@
+# 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="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="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
+
+	# 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-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
+	# 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-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' -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/69-btattach-bcm.rules b/net-wireless/bluez/files/69-btattach-bcm.rules
new file mode 100644
index 00000000000..dfe8d1e785c
--- /dev/null
+++ b/net-wireless/bluez/files/69-btattach-bcm.rules
@@ -0,0 +1,33 @@
+# Some devices have a bluetooth HCI connected to an uart, these needs to be
+# setup by calling btattach. The systemd btattach-bcm.service takes care of
+# this. These udev rules hardware-activate that service when necessary.
+#
+# For now this only suports ACPI enumerated Broadcom BT HCIs.
+# This has been tested on Bay and Cherry Trail devices with both ACPI and
+# PCI enumerated UARTs.
+
+# Note we check for the platform device not for the acpi device, because
+# some DSDTs list multiple bluetooth adapters, but only some (or none)
+# are enabled. Only enabled adapters get a platform device created.
+ACTION!="add", GOTO="btattach_bcm_rules_end"
+SUBSYSTEM!="platform", GOTO="btattach_bcm_rules_end"
+
+KERNEL=="BCM2E1A:00", TAG+="systemd", ENV{SYSTEMD_WANTS}="btattach-bcm@%k.service"
+KERNEL=="BCM2E39:00", TAG+="systemd", ENV{SYSTEMD_WANTS}="btattach-bcm@%k.service"
+KERNEL=="BCM2E3A:00", TAG+="systemd", ENV{SYSTEMD_WANTS}="btattach-bcm@%k.service"
+KERNEL=="BCM2E3D:00", TAG+="systemd", ENV{SYSTEMD_WANTS}="btattach-bcm@%k.service"
+KERNEL=="BCM2E3F:00", TAG+="systemd", ENV{SYSTEMD_WANTS}="btattach-bcm@%k.service"
+KERNEL=="BCM2E40:00", TAG+="systemd", ENV{SYSTEMD_WANTS}="btattach-bcm@%k.service"
+KERNEL=="BCM2E54:00", TAG+="systemd", ENV{SYSTEMD_WANTS}="btattach-bcm@%k.service"
+KERNEL=="BCM2E55:00", TAG+="systemd", ENV{SYSTEMD_WANTS}="btattach-bcm@%k.service"
+KERNEL=="BCM2E64:00", TAG+="systemd", ENV{SYSTEMD_WANTS}="btattach-bcm@%k.service"
+KERNEL=="BCM2E65:00", TAG+="systemd", ENV{SYSTEMD_WANTS}="btattach-bcm@%k.service"
+KERNEL=="BCM2E67:00", TAG+="systemd", ENV{SYSTEMD_WANTS}="btattach-bcm@%k.service"
+KERNEL=="BCM2E71:00", TAG+="systemd", ENV{SYSTEMD_WANTS}="btattach-bcm@%k.service"
+KERNEL=="BCM2E7B:00", TAG+="systemd", ENV{SYSTEMD_WANTS}="btattach-bcm@%k.service"
+KERNEL=="BCM2E7C:00", TAG+="systemd", ENV{SYSTEMD_WANTS}="btattach-bcm@%k.service"
+KERNEL=="BCM2E7E:00", TAG+="systemd", ENV{SYSTEMD_WANTS}="btattach-bcm@%k.service"
+KERNEL=="BCM2E95:00", TAG+="systemd", ENV{SYSTEMD_WANTS}="btattach-bcm@%k.service"
+KERNEL=="BCM2E96:00", TAG+="systemd", ENV{SYSTEMD_WANTS}="btattach-bcm@%k.service"
+
+LABEL="btattach_bcm_rules_end"

diff --git a/net-wireless/bluez/files/bluetooth-init.d-r4 b/net-wireless/bluez/files/bluetooth-init.d-r4
old mode 100755
new mode 100644
index 97cf500008e..e69c66867fa
--- a/net-wireless/bluez/files/bluetooth-init.d-r4
+++ b/net-wireless/bluez/files/bluetooth-init.d-r4
@@ -1,5 +1,5 @@
 #!/sbin/openrc-run
-# Copyright 1999-2017 Gentoo Foundation
+# Copyright 1999-2019 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 pidfile="/run/bluetoothd.pid"

diff --git a/net-wireless/bluez/files/btattach-bcm-service.sh b/net-wireless/bluez/files/btattach-bcm-service.sh
new file mode 100644
index 00000000000..c7f8b178467
--- /dev/null
+++ b/net-wireless/bluez/files/btattach-bcm-service.sh
@@ -0,0 +1,30 @@
+#!/bin/bash
+
+# Simple shell script to wait for the tty for an uart using BT HCI to show up
+# and then invoke btattach with the right parameters, this is intended to be
+# invoked from a hardware-activated systemd service
+#
+# For now this only suports ACPI enumerated Broadcom BT HCIs.
+# This has been tested on Bay and Cherry Trail devices with both ACPI and
+# PCI enumerated UARTs.
+#
+# Note the kernel bt developers are working on solving this entirely in the
+# kernel, so it is not worth the trouble to write something better then this.
+
+BT_DEV="/sys/bus/platform/devices/$1"
+BT_DEV="$(readlink -f $BT_DEV)"
+UART_DEV="$(dirname $BT_DEV)"
+
+# Stupid GPD-pocket has USB BT with id 0000:0000, but still claims to have
+# an uart attached bt
+if [ "$1" = "BCM2E7E:00" ] && lsusb | grep -q "ID 0000:0000"; then
+	exit 0
+fi
+
+while [ ! -d "$UART_DEV/tty" ]; do
+	sleep .2
+done
+
+TTY="$(ls $UART_DEV/tty)"
+
+exec btattach --bredr "/dev/$TTY" -P bcm

diff --git a/net-wireless/bluez/files/btattach-bcm_at.service b/net-wireless/bluez/files/btattach-bcm_at.service
new file mode 100644
index 00000000000..1e7c7dbe582
--- /dev/null
+++ b/net-wireless/bluez/files/btattach-bcm_at.service
@@ -0,0 +1,6 @@
+[Unit]
+Description=btattach for Broadcom devices
+
+[Service]
+Type=simple
+ExecStart=/usr/libexec/bluetooth/btattach-bcm-service.sh %I


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

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

commit:     87eadbdbf4dff78be3702e418b1898833d26a7a7
Author:     Pacho Ramos <pacho <AT> gentoo <DOT> org>
AuthorDate: Sun Oct 20 11:15:18 2019 +0000
Commit:     Pacho Ramos <pacho <AT> gentoo <DOT> org>
CommitDate: Sun Oct 20 11:39:14 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=87eadbdb

net-wireless/bluez: Fix cancelling disconnect timeout

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

 net-wireless/bluez/bluez-5.51-r1.ebuild            | 294 +++++++++++++++++++++
 .../files/bluez-5.51-disconnect-timeout.patch      | 104 ++++++++
 2 files changed, 398 insertions(+)

diff --git a/net-wireless/bluez/bluez-5.51-r1.ebuild b/net-wireless/bluez/bluez-5.51-r1.ebuild
new file mode 100644
index 00000000000..1bf47c399e0
--- /dev/null
+++ b/net-wireless/bluez/bluez-5.51-r1.ebuild
@@ -0,0 +1,294 @@
+# 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/bluez-5.51-disconnect-timeout.patch b/net-wireless/bluez/files/bluez-5.51-disconnect-timeout.patch
new file mode 100644
index 00000000000..2f6e7c8c4d9
--- /dev/null
+++ b/net-wireless/bluez/files/bluez-5.51-disconnect-timeout.patch
@@ -0,0 +1,104 @@
+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
+


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

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

commit:     e7d2a2805d8c54cfdeab02e3e60935629f471ac7
Author:     Pacho Ramos <pacho <AT> gentoo <DOT> org>
AuthorDate: Mon Mar 22 21:16:26 2021 +0000
Commit:     Pacho Ramos <pacho <AT> gentoo <DOT> org>
CommitDate: Mon Mar 22 21:16:26 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e7d2a280

net-wireless/bluez: Fix reconnect issues and allow to pass options...

Upstream fix for reconnect issues and allow to pass options to init.d
script. Also drop obsolete btattach hacks as Fedora did.

Closes: https://bugs.gentoo.org/777000
Thanks-to: Joakim Tjernlund
Package-Manager: Portage-3.0.17, Repoman-3.0.2
Signed-off-by: Pacho Ramos <pacho <AT> gentoo.org>

 net-wireless/bluez/bluez-5.56-r1.ebuild            | 295 +++++++++++++++++++++
 net-wireless/bluez/files/bluetooth-conf.d          |   1 +
 net-wireless/bluez/files/bluetooth-init.d-r5       |  13 +
 .../bluez/files/bluez-5.56-avdtp-disconnects.patch |  41 +++
 4 files changed, 350 insertions(+)

diff --git a/net-wireless/bluez/bluez-5.56-r1.ebuild b/net-wireless/bluez/bluez-5.56-r1.ebuild
new file mode 100644
index 00000000000..ee7911d7c17
--- /dev/null
+++ b/net-wireless/bluez/bluez-5.56-r1.ebuild
@@ -0,0 +1,295 @@
+# 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.28 )
+	cups? ( net-print/cups:= )
+	mesh? (
+		>=dev-libs/ell-0.37
+		>=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=(
+	# 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
+
+	# avdtp: Fix removing all remote SEPs when loading from cache (from 'master')
+	"${FILESDIR}"/${P}-avdtp-disconnects.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
+
+	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
+		# --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/bluetooth-conf.d b/net-wireless/bluez/files/bluetooth-conf.d
new file mode 100644
index 00000000000..d5b5005ce7f
--- /dev/null
+++ b/net-wireless/bluez/files/bluetooth-conf.d
@@ -0,0 +1 @@
+#BLUETOOTH_OPTS="-E"

diff --git a/net-wireless/bluez/files/bluetooth-init.d-r5 b/net-wireless/bluez/files/bluetooth-init.d-r5
new file mode 100644
index 00000000000..4d60234e030
--- /dev/null
+++ b/net-wireless/bluez/files/bluetooth-init.d-r5
@@ -0,0 +1,13 @@
+#!/sbin/openrc-run
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+pidfile="/run/bluetoothd.pid"
+command="/usr/libexec/bluetooth/bluetoothd"
+command_args="${BLUETOOTH_OPTS}"
+command_background=1
+
+depend() {
+	after coldplug
+	need dbus localmount hostname
+}

diff --git a/net-wireless/bluez/files/bluez-5.56-avdtp-disconnects.patch b/net-wireless/bluez/files/bluez-5.56-avdtp-disconnects.patch
new file mode 100644
index 00000000000..c2e34152748
--- /dev/null
+++ b/net-wireless/bluez/files/bluez-5.56-avdtp-disconnects.patch
@@ -0,0 +1,41 @@
+From 28ddec8d6b829e002fa268c07b71e4c564ba9e16 Mon Sep 17 00:00:00 2001
+From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
+Date: Thu, 11 Mar 2021 07:36:07 -0800
+Subject: [PATCH] avdtp: Fix removing all remote SEPs when loading from cache
+
+If avdtp_discover is called after cache has been loaded it end up
+removing all remote SEPs as they have not been discovered yet.
+
+Fixes: https://github.com/bluez/bluez/issues/102
+---
+ profiles/audio/avdtp.c | 16 ++++++++++++----
+ 1 file changed, 12 insertions(+), 4 deletions(-)
+
+diff --git a/profiles/audio/avdtp.c b/profiles/audio/avdtp.c
+index 088ca58b3..1d5871c62 100644
+--- a/profiles/audio/avdtp.c
++++ b/profiles/audio/avdtp.c
+@@ -3381,10 +3381,18 @@ int avdtp_discover(struct avdtp *session, avdtp_discover_cb_t cb,
+ 	session->discover = g_new0(struct discover_callback, 1);
+ 
+ 	if (session->seps) {
+-		session->discover->cb = cb;
+-		session->discover->user_data = user_data;
+-		session->discover->id = g_idle_add(process_discover, session);
+-		return 0;
++		struct avdtp_remote_sep *sep = session->seps->data;
++
++		/* Check that SEP have been discovered as it may be loaded from
++		 * cache.
++		 */
++		if (sep->discovered) {
++			session->discover->cb = cb;
++			session->discover->user_data = user_data;
++			session->discover->id = g_idle_add(process_discover,
++								session);
++			return 0;
++		}
+ 	}
+ 
+ 	err = send_request(session, FALSE, NULL, AVDTP_DISCOVER, NULL, 0);
+


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

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

commit:     5f675fe2e6957446b593397841e2a162dc13cfbd
Author:     Pacho Ramos <pacho <AT> gentoo <DOT> org>
AuthorDate: Tue Jun 22 16:17:21 2021 +0000
Commit:     Pacho Ramos <pacho <AT> gentoo <DOT> org>
CommitDate: Tue Jun 22 16:17:21 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5f675fe2

net-wireless/bluez: Fix A2DP parsing

Bug: https://bugs.gentoo.org/785424
Thanks-to: Joakim Tjernlund
Package-Manager: Portage-3.0.19, Repoman-3.0.3
Signed-off-by: Pacho Ramos <pacho <AT> gentoo.org>

 net-wireless/bluez/bluez-5.59-r1.ebuild            | 292 +++++++++++++++++++++
 .../bluez/files/bluez-5.59-a2dp-parsing.patch      |  38 +++
 2 files changed, 330 insertions(+)

diff --git a/net-wireless/bluez/bluez-5.59-r1.ebuild b/net-wireless/bluez/bluez-5.59-r1.ebuild
new file mode 100644
index 00000000000..898115e910a
--- /dev/null
+++ b/net-wireless/bluez/bluez-5.59-r1.ebuild
@@ -0,0 +1,292 @@
+# 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
new file mode 100644
index 00000000000..40569ec9805
--- /dev/null
+++ b/net-wireless/bluez/files/bluez-5.59-a2dp-parsing.patch
@@ -0,0 +1,38 @@
+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/files/, net-wireless/bluez/
@ 2021-06-23  7:53 Pacho Ramos
  0 siblings, 0 replies; 22+ messages in thread
From: Pacho Ramos @ 2021-06-23  7:53 UTC (permalink / raw
  To: gentoo-commits

commit:     dc88877a2411735d828da371cd8b72b2173625f5
Author:     Pacho Ramos <pacho <AT> gentoo <DOT> org>
AuthorDate: Wed Jun 23 07:52:09 2021 +0000
Commit:     Pacho Ramos <pacho <AT> gentoo <DOT> org>
CommitDate: Wed Jun 23 07:53:39 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=dc88877a

net-wireless/bluez: Drop old

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

 net-wireless/bluez/Manifest                        |   2 -
 net-wireless/bluez/bluez-5.55.ebuild               | 299 ---------------------
 net-wireless/bluez/bluez-5.56-r1.ebuild            | 296 --------------------
 .../bluez/files/bluez-5.56-avdtp-disconnects.patch |  41 ---
 4 files changed, 638 deletions(-)

diff --git a/net-wireless/bluez/Manifest b/net-wireless/bluez/Manifest
index 30a5ca30ec7..4bc25fa2af7 100644
--- a/net-wireless/bluez/Manifest
+++ b/net-wireless/bluez/Manifest
@@ -1,4 +1,2 @@
-DIST bluez-5.55.tar.xz 2041428 BLAKE2B 7eee44063ea53188d35324bcc5b5f0539cf92a5934632743677bbf41822b8b79a899a82a93fd79887fe058e6f0c0e66ed8d5da46e5585682613bc1847cb009a8 SHA512 9423cb60d15a6f068838497a1eaea9f5a32d70c07191c313ba821a6919d6e0c436ada4f547cc5f2db5eacc0123429ad54851f57df2554f61fa293743ec14a033
-DIST bluez-5.56.tar.xz 2053080 BLAKE2B b901deae4047ebe96c034c20c9d7e6c275d3c1fd311dc57ed2f1f927d6e778b213af3e09caaeebbb11110f1733fc9bf341cf8f7c63a37aaa6b896607c0026d92 SHA512 b320ee9d49a516f5cecb5fbc410ba42e9127f44ebcfb95647f68bd5d300147d0eaf633f8e8d0678631a2184ea3afae7b01b5f228157328874fa2a87832ed0ae1
 DIST bluez-5.58.tar.xz 2060368 BLAKE2B 157780f83181d89fb126face5e9794bc0de8196f43d57d079fc09ae7e45e7ef21bf404e834d844da28d06f9a29cb92f11c310dbbcb7f60e845a335a558d7190c SHA512 159b554e0afd56af5da6f8333383f2fdf96d77a0e82d762bf4b37786e7312b7e61fbbae0f18b26442a606e0a232f48e0f45a4b38b95de36c7daf384f582315a3
 DIST bluez-5.59.tar.xz 2123104 BLAKE2B 59e063ffc0cd810a151f49c2d8b3e1dca46eef038dfe112bfc0524e111e00cfea78557f3d1ccf657882b76158ee9249291f9fc6e6a4cce851e0e6dc43f707398 SHA512 506ce28459a82614e5f6c55235b84e5780a9bfa821904fd40ee2928a503978248368069c57a283db9dd81f48d78f45e00d95a7c52d1538d3f5c858a29424304f

diff --git a/net-wireless/bluez/bluez-5.55.ebuild b/net-wireless/bluez/bluez-5.55.ebuild
deleted file mode 100644
index e374716a186..00000000000
--- a/net-wireless/bluez/bluez-5.55.ebuild
+++ /dev/null
@@ -1,299 +0,0 @@
-# Copyright 1999-2020 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.28 )
-	cups? ( net-print/cups:= )
-	mesh? (
-		>=dev-libs/ell-0.28
-		>=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=(
-	# 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
-
-	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
-		# --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-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-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
-
-	# 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/bluez-5.56-r1.ebuild b/net-wireless/bluez/bluez-5.56-r1.ebuild
deleted file mode 100644
index 928432949d1..00000000000
--- a/net-wireless/bluez/bluez-5.56-r1.ebuild
+++ /dev/null
@@ -1,296 +0,0 @@
-# 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.28 )
-	cups? ( net-print/cups:= )
-	mesh? (
-		>=dev-libs/ell-0.37
-		>=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=(
-	# 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
-
-	# avdtp: Fix removing all remote SEPs when loading from cache (from 'master')
-	"${FILESDIR}"/${P}-avdtp-disconnects.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.56-avdtp-disconnects.patch b/net-wireless/bluez/files/bluez-5.56-avdtp-disconnects.patch
deleted file mode 100644
index c2e34152748..00000000000
--- a/net-wireless/bluez/files/bluez-5.56-avdtp-disconnects.patch
+++ /dev/null
@@ -1,41 +0,0 @@
-From 28ddec8d6b829e002fa268c07b71e4c564ba9e16 Mon Sep 17 00:00:00 2001
-From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
-Date: Thu, 11 Mar 2021 07:36:07 -0800
-Subject: [PATCH] avdtp: Fix removing all remote SEPs when loading from cache
-
-If avdtp_discover is called after cache has been loaded it end up
-removing all remote SEPs as they have not been discovered yet.
-
-Fixes: https://github.com/bluez/bluez/issues/102
----
- profiles/audio/avdtp.c | 16 ++++++++++++----
- 1 file changed, 12 insertions(+), 4 deletions(-)
-
-diff --git a/profiles/audio/avdtp.c b/profiles/audio/avdtp.c
-index 088ca58b3..1d5871c62 100644
---- a/profiles/audio/avdtp.c
-+++ b/profiles/audio/avdtp.c
-@@ -3381,10 +3381,18 @@ int avdtp_discover(struct avdtp *session, avdtp_discover_cb_t cb,
- 	session->discover = g_new0(struct discover_callback, 1);
- 
- 	if (session->seps) {
--		session->discover->cb = cb;
--		session->discover->user_data = user_data;
--		session->discover->id = g_idle_add(process_discover, session);
--		return 0;
-+		struct avdtp_remote_sep *sep = session->seps->data;
-+
-+		/* Check that SEP have been discovered as it may be loaded from
-+		 * cache.
-+		 */
-+		if (sep->discovered) {
-+			session->discover->cb = cb;
-+			session->discover->user_data = user_data;
-+			session->discover->id = g_idle_add(process_discover,
-+								session);
-+			return 0;
-+		}
- 	}
- 
- 	err = send_request(session, FALSE, NULL, AVDTP_DISCOVER, NULL, 0);
-


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

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

commit:     1e4db05081ee5d3e479838361b7337fbac39623e
Author:     Pacho Ramos <pacho <AT> gentoo <DOT> org>
AuthorDate: Sun Jul 25 09:01:35 2021 +0000
Commit:     Pacho Ramos <pacho <AT> gentoo <DOT> org>
CommitDate: Sun Jul 25 09:01:35 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1e4db050

net-wireless/bluez: Fix building with glibc-2.34

Closes: https://bugs.gentoo.org/803830
Thanks-to: Sam James
Package-Manager: Portage-3.0.20, Repoman-3.0.3
Signed-off-by: Pacho Ramos <pacho <AT> gentoo.org>

 net-wireless/bluez/bluez-5.60.ebuild               |  3 ++
 .../bluez/files/bluez-5.60-glibc-2.34.patch        | 42 ++++++++++++++++++++++
 2 files changed, 45 insertions(+)

diff --git a/net-wireless/bluez/bluez-5.60.ebuild b/net-wireless/bluez/bluez-5.60.ebuild
index 415cff1e5f2..394c547a517 100644
--- a/net-wireless/bluez/bluez-5.60.ebuild
+++ b/net-wireless/bluez/bluez-5.60.ebuild
@@ -71,6 +71,9 @@ PATCHES=(
 	# Fedora patches
 	# http://www.spinics.net/lists/linux-bluetooth/msg40136.html
 	"${FILESDIR}"/0001-obex-Use-GLib-helper-function-to-manipulate-paths.patch
+
+	# https://marc.info/?l=linux-bluetooth&m=161498090629584&w=2
+	"${FILESDIR}"/${PN}-5.60-glibc-2.34.patch
 )
 
 pkg_setup() {

diff --git a/net-wireless/bluez/files/bluez-5.60-glibc-2.34.patch b/net-wireless/bluez/files/bluez-5.60-glibc-2.34.patch
new file mode 100644
index 00000000000..1e846100285
--- /dev/null
+++ b/net-wireless/bluez/files/bluez-5.60-glibc-2.34.patch
@@ -0,0 +1,42 @@
+From 124dee151746b4a8a2e8a7194af78f2c82f75d79 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
+Date: Wed, 3 Mar 2021 08:57:36 +0100
+Subject: [PATCH] media: rename local function conflicting with pause(2)
+
+profiles/audio/media.c:1284:13: error: conflicting types for 'pause'; have '_Bool(void *)'
+ 1284 | static bool pause(void *user_data)
+      |             ^~~~~
+In file included from /usr/include/bits/sigstksz.h:24,
+                 from /usr/include/signal.h:315,
+                 from /usr/include/glib-2.0/glib/gbacktrace.h:36,
+                 from /usr/include/glib-2.0/glib.h:34,
+                 from profiles/audio/media.c:21:
+/usr/include/unistd.h:478:12: note: previous declaration of 'pause' with type 'int(void)'
+  478 | extern int pause (void);
+      |            ^~~~~
+---
+ profiles/audio/media.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/profiles/audio/media.c b/profiles/audio/media.c
+index c84bbe22dc..3d8c4b69c3 100644
+--- a/profiles/audio/media.c
++++ b/profiles/audio/media.c
+@@ -1281,7 +1281,7 @@ static bool stop(void *user_data)
+ 	return media_player_send(mp, "Stop");
+ }
+ 
+-static bool pause(void *user_data)
++static bool pause_play(void *user_data)
+ {
+ 	struct media_player *mp = user_data;
+ 
+@@ -1331,7 +1331,7 @@ static struct avrcp_player_cb player_cb = {
+ 	.set_volume = set_volume,
+ 	.play = play,
+ 	.stop = stop,
+-	.pause = pause,
++	.pause = pause_play,
+ 	.next = next,
+ 	.previous = previous,
+ };


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

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

commit:     7514a3c027e281871fc86a27f7660016016b4023
Author:     Pacho Ramos <pacho <AT> gentoo <DOT> org>
AuthorDate: Tue Oct 19 21:19:44 2021 +0000
Commit:     Pacho Ramos <pacho <AT> gentoo <DOT> org>
CommitDate: Tue Oct 19 21:19:44 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7514a3c0

net-wireless/bluez: Drop old

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

 net-wireless/bluez/Manifest                      |   2 -
 net-wireless/bluez/bluez-5.58-r1.ebuild          | 292 -----------------------
 net-wireless/bluez/bluez-5.60.ebuild             | 292 -----------------------
 net-wireless/bluez/files/bluez-5.58-rfkill.patch |  84 -------
 4 files changed, 670 deletions(-)

diff --git a/net-wireless/bluez/Manifest b/net-wireless/bluez/Manifest
index 56ab750524f..471eb8b4602 100644
--- a/net-wireless/bluez/Manifest
+++ b/net-wireless/bluez/Manifest
@@ -1,4 +1,2 @@
-DIST bluez-5.58.tar.xz 2060368 BLAKE2B 157780f83181d89fb126face5e9794bc0de8196f43d57d079fc09ae7e45e7ef21bf404e834d844da28d06f9a29cb92f11c310dbbcb7f60e845a335a558d7190c SHA512 159b554e0afd56af5da6f8333383f2fdf96d77a0e82d762bf4b37786e7312b7e61fbbae0f18b26442a606e0a232f48e0f45a4b38b95de36c7daf384f582315a3
-DIST bluez-5.60.tar.xz 2124312 BLAKE2B 52cd08192cbfb7adc2e11f270442af62307dbf3cb940554f77e1ec4c30036ca1c05970d7d48719d3036173135f2b14123f2d0aad8147f0a919773d211238a11e SHA512 069e054360b4ab72f1daa033572f0fd822fb0f47e52069f4f3dcdfecfa312b9a5366cc04967e639aef39b980c0e1007389f1ee757e7c3bae43a5e66f8ed21a6b
 DIST bluez-5.61.tar.xz 2137412 BLAKE2B 2fc1b44f726d48b4a0e8bbecc664077db1db69bbc87c66e9d7ac85d7b2e066de8b349c18597a5ba140c5fcb1ef867ee3980ebdd839ded69ae30491fb7b836940 SHA512 a2318637258f9db0bf05fecbfbea2c3ca5e21867378e28ab4c77f658fe42f10c8c607939f2b437ec40d1ceb00b99f7916c0275faaedd9edd247f7dc91329937a
 DIST bluez-5.62.tar.xz 2149348 BLAKE2B db99b36a230fc0be15275d2eda9864b686326ba50648f66b19087ea4309a76d234ab4f1dcb6975f1513a898978b1d5b9332542f5dcee22efd898b79658434a70 SHA512 8fb0b81e1d929d3eee3d70f457ce75dbcff4c2a8a728247fc950bbe11e84d83582345bfd433d2e2df7b5588eb0e42f286658a83c7332be84819d9df49a5707e8

diff --git a/net-wireless/bluez/bluez-5.58-r1.ebuild b/net-wireless/bluez/bluez-5.58-r1.ebuild
deleted file mode 100644
index 18c11b1754e..00000000000
--- a/net-wireless/bluez/bluez-5.58-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_{8..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_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.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 ~CRYPTO_USER_API_HASH ~CRYPTO_USER_API_SKCIPHER"
-	# 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
-	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/bluez-5.60.ebuild b/net-wireless/bluez/bluez-5.60.ebuild
deleted file mode 100644
index a86c0dde25a..00000000000
--- a/net-wireless/bluez/bluez-5.60.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_{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 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_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}]
-	>=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=(
-	# 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
-
-	# https://marc.info/?l=linux-bluetooth&m=161498090629584&w=2
-	"${FILESDIR}"/${PN}-5.60-glibc-2.34.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.58-rfkill.patch b/net-wireless/bluez/files/bluez-5.58-rfkill.patch
deleted file mode 100644
index dd7f2f978e7..00000000000
--- a/net-wireless/bluez/files/bluez-5.58-rfkill.patch
+++ /dev/null
@@ -1,84 +0,0 @@
-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/files/, net-wireless/bluez/
@ 2022-01-16  9:38 Pacho Ramos
  0 siblings, 0 replies; 22+ messages in thread
From: Pacho Ramos @ 2022-01-16  9:38 UTC (permalink / raw
  To: gentoo-commits

commit:     277ef13c7bb383657ee4628b45a37b62f66eb20e
Author:     Pacho Ramos <pacho <AT> gentoo <DOT> org>
AuthorDate: Sun Jan 16 09:37:57 2022 +0000
Commit:     Pacho Ramos <pacho <AT> gentoo <DOT> org>
CommitDate: Sun Jan 16 09:38:06 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=277ef13c

net-wireless/bluez: Sync with upstream fixes

For bug #827706

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

 net-wireless/bluez/bluez-5.63-r1.ebuild            | 295 +++++++++++
 ...hog-Fix-read-order-of-attributes-rediffed.patch | 542 +++++++++++++++++++++
 ...while-uhid-device-has-not-been-c-rediffed.patch |  90 ++++
 3 files changed, 927 insertions(+)

diff --git a/net-wireless/bluez/bluez-5.63-r1.ebuild b/net-wireless/bluez/bluez-5.63-r1.ebuild
new file mode 100644
index 000000000000..baad2b48deaf
--- /dev/null
+++ b/net-wireless/bluez/bluez-5.63-r1.ebuild
@@ -0,0 +1,295 @@
+# 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-hog-Fix-read-order-of-attributes-rediffed.patch b/net-wireless/bluez/files/0001-hog-Fix-read-order-of-attributes-rediffed.patch
new file mode 100644
index 000000000000..cd6dc44b5d3e
--- /dev/null
+++ b/net-wireless/bluez/files/0001-hog-Fix-read-order-of-attributes-rediffed.patch
@@ -0,0 +1,542 @@
+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
new file mode 100644
index 000000000000..f39775785f4a
--- /dev/null
+++ b/net-wireless/bluez/files/0002-hog-Add-input-queue-while-uhid-device-has-not-been-c-rediffed.patch
@@ -0,0 +1,90 @@
+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
+


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

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

commit:     590842a7dae0db6d1d945376c84003c7a2235d03
Author:     Pacho Ramos <pacho <AT> gentoo <DOT> org>
AuthorDate: Sun Dec  4 13:15:35 2022 +0000
Commit:     Pacho Ramos <pacho <AT> gentoo <DOT> org>
CommitDate: Sun Dec  4 14:49:17 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=590842a7

net-wireless/bluez: add 5.66

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

 net-wireless/bluez/Manifest                        |   1 +
 net-wireless/bluez/bluez-5.66.ebuild               | 300 +++++++++++++++++++++
 .../bluez-5.66-power-state-adapter-property.patch  |  28 ++
 .../files/bluez-5.66-transient-hostname-fix.patch  | 185 +++++++++++++
 4 files changed, 514 insertions(+)

diff --git a/net-wireless/bluez/Manifest b/net-wireless/bluez/Manifest
index 710de1c38b68..ff11cd002cac 100644
--- a/net-wireless/bluez/Manifest
+++ b/net-wireless/bluez/Manifest
@@ -1,3 +1,4 @@
 DIST bluez-5.64.tar.xz 2175148 BLAKE2B 828c620330d1993d5c5c2a865f2d27a29425e3583aac01a1a782290a805ee0fd6456b6832c804ad323dd8714fa9329487b2616ed08f1f491ea29403ee05dba2d SHA512 f11f9974b29c5c6fce3890d7e42425c1cb02e42c1b8f49c5cc4b249234e67b64317d0e5e82721e2fbf1b53269c8569a9c869d59ce42b5e927f6622f0753e53cd
 DIST bluez-5.65.tar.xz 2208100 BLAKE2B 9d2937e2e14d8d8945183c6436921d9d16a6d3bcb5dbe3e2493554fbc4972bb4c006aabc793c9fb8eae47a7e9f29ae9fdf47551dfc0a238e86f5a76ce7436ae2 SHA512 c20c09a1a75053c77d73b3ce15ac7fd321eb6df5ca1646d57c6848b87c0c9957908bc17dd928da4ef2aacfc8667877cbc7511c1ba43db839bfa9bf1fb8269907
+DIST bluez-5.66.tar.xz 2257288 BLAKE2B af1911cf590461a874daa16bedb8a021a3b2c2af3254360c035d2180e0f355372651bd41da342c26e6d9631d726dd08e0d6a83a22069333b94b6fce6d546718c SHA512 ed0994932687eacf27207867366671b323671f5d5199daf36ea5eff8f254f2bc99ef989ef7df9883b35c06f2af60452be8bad0a06109428a4717cf2b247b4865
 DIST power-state-adapter-property.patch 22488 BLAKE2B a46173c0ebe4f4822c67c2f8f2f3e67dab261753f64204f1a61665c3bba1d7a10e0f8511b38ce273d986490ffd262a737bee82694909683df7386b2015301607 SHA512 b039a578454681f291dc3b04079c8d0151b13a84b4b013e290aa3c28aba1538cef2d9e9aadfe88a0dbfb8e4cea1c251cb5043f4175fb32d53526f7b82de0451a

diff --git a/net-wireless/bluez/bluez-5.66.ebuild b/net-wireless/bluez/bluez-5.66.ebuild
new file mode 100644
index 000000000000..8a2a8ed1bcee
--- /dev/null
+++ b/net-wireless/bluez/bluez-5.66.ebuild
@@ -0,0 +1,300 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+PYTHON_COMPAT=( python3_{8..11} )
+
+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 ~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
+	# http://www.spinics.net/lists/linux-bluetooth/msg40136.html
+	"${FILESDIR}"/0001-obex-Use-GLib-helper-function-to-manipulate-paths.patch
+
+	# https://lore.kernel.org/linux-bluetooth/20220901110719.176944-1-hadess@hadess.net/T/#m9c08d004cd5422783ee1d93154f42303bba9169f
+	"${FILESDIR}"/${PN}-5.66-power-state-adapter-property.patch
+
+	# Fixed in next release
+	"${FILESDIR}"/${P}-transient-hostname-fix.patch
+)
+
+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
+	# Upstream dropped the example files
+	# Install .json files as examples to be used by meshctl
+	#if use mesh; then
+		#dodoc tools/mesh-gatt/*.json
+	#	local DOC_CONTENTS="Some example .json files were installed into
+	#	/usr/share/doc/${PF} to be used with meshctl. Feel free to
+	#	uncompress and copy them to ~/.config/meshctl to use them."
+	#	readme.gentoo_create_doc
+	#fi
+}
+
+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/bluez-5.66-power-state-adapter-property.patch b/net-wireless/bluez/files/bluez-5.66-power-state-adapter-property.patch
new file mode 100644
index 000000000000..566d7c08b591
--- /dev/null
+++ b/net-wireless/bluez/files/bluez-5.66-power-state-adapter-property.patch
@@ -0,0 +1,28 @@
+From 70309219acd4c81e3a9e2b3652d2d93eb08b0aee Mon Sep 17 00:00:00 2001
+From: Bastien Nocera <hadess@hadess.net>
+Date: Wed, 31 Aug 2022 11:16:34 +0200
+Subject: [PATCH 6/6] adapter: Remove experimental flag for PowerState
+
+Now that the feature has been tested, that the API is deemed adequate
+and the reliability sufficient.
+---
+ src/adapter.c | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+diff --git a/src/adapter.c b/src/adapter.c
+index 8fb2acdc8..841096d7f 100644
+--- a/src/adapter.c
++++ b/src/adapter.c
+@@ -3864,8 +3864,7 @@ static const GDBusPropertyTable adapter_properties[] = {
+ 	{ "Alias", "s", property_get_alias, property_set_alias },
+ 	{ "Class", "u", property_get_class },
+ 	{ "Powered", "b", property_get_powered, property_set_powered },
+-	{ "PowerState", "s", property_get_power_state, NULL, NULL,
+-			     G_DBUS_PROPERTY_FLAG_EXPERIMENTAL },
++	{ "PowerState", "s", property_get_power_state },
+ 	{ "Discoverable", "b", property_get_discoverable,
+ 					property_set_discoverable },
+ 	{ "DiscoverableTimeout", "u", property_get_discoverable_timeout,
+-- 
+2.37.2
+

diff --git a/net-wireless/bluez/files/bluez-5.66-transient-hostname-fix.patch b/net-wireless/bluez/files/bluez-5.66-transient-hostname-fix.patch
new file mode 100644
index 000000000000..fef2776f7a0e
--- /dev/null
+++ b/net-wireless/bluez/files/bluez-5.66-transient-hostname-fix.patch
@@ -0,0 +1,185 @@
+From e515f4b6e25c971c47ab79e9cbdfa17119bbde23 Mon Sep 17 00:00:00 2001
+From: Bastien Nocera <hadess@hadess.net>
+Date: Wed, 9 Nov 2022 16:17:55 +0100
+Subject: [PATCH 1/2] hostname: Add '' around printed strings
+
+Otherwise we can't see whether the string is nul, or empty.
+---
+ plugins/hostname.c | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/plugins/hostname.c b/plugins/hostname.c
+index 1a9513adb..14b6450b5 100644
+--- a/plugins/hostname.c
++++ b/plugins/hostname.c
+@@ -128,7 +128,7 @@ static void property_changed(GDBusProxy *proxy, const char *name,
+ 
+ 			dbus_message_iter_get_basic(iter, &str);
+ 
+-			DBG("pretty hostname: %s", str);
++			DBG("pretty hostname: '%s'", str);
+ 
+ 			g_free(pretty_hostname);
+ 			pretty_hostname = g_strdup(str);
+@@ -146,7 +146,7 @@ static void property_changed(GDBusProxy *proxy, const char *name,
+ 
+ 			dbus_message_iter_get_basic(iter, &str);
+ 
+-			DBG("static hostname: %s", str);
++			DBG("static hostname: '%s'", str);
+ 
+ 			g_free(static_hostname);
+ 			static_hostname = g_strdup(str);
+@@ -165,7 +165,7 @@ static void property_changed(GDBusProxy *proxy, const char *name,
+ 
+ 			dbus_message_iter_get_basic(iter, &str);
+ 
+-			DBG("chassis: %s", str);
++			DBG("chassis: '%s'", str);
+ 
+ 			for (i = 0; chassis_table[i].chassis; i++) {
+ 				if (strcmp(chassis_table[i].chassis, str))
+-- 
+2.37.3
+
+
+From e2b2b1675f310023862319ea10ffd205a75cc0cb Mon Sep 17 00:00:00 2001
+From: Bastien Nocera <hadess@hadess.net>
+Date: Wed, 9 Nov 2022 16:17:56 +0100
+Subject: [PATCH 2/2] hostname: Fallback to transient hostname
+
+After pretty hostname, and static hostname, also support transient
+hostname as a last resort before 'BlueZ X.XX'.
+
+This happens on Fedora's Workstation installation as it calls
+"hostnamectl set-hostname" on startup. In Fedora Silverblue, the default
+hostname is set as fedora in /etc/os-release.
+
+In both cases, we should fall back to that transient hostname, as bad as
+it could be.
+
+Note that the transient hostname needs to be monitored through the
+kernel directly, as explained in:
+https://www.freedesktop.org/software/systemd/man/org.freedesktop.hostname1.html
+---
+ plugins/hostname.c | 57 ++++++++++++++++++++++++++++++++++++++++++++--
+ 1 file changed, 55 insertions(+), 2 deletions(-)
+
+diff --git a/plugins/hostname.c b/plugins/hostname.c
+index 14b6450b5..51707f07d 100644
+--- a/plugins/hostname.c
++++ b/plugins/hostname.c
+@@ -16,6 +16,8 @@
+ #include <stdint.h>
+ #include <stdlib.h>
+ #include <string.h>
++#include <fcntl.h>
++#include <sys/utsname.h>
+ 
+ #include "lib/bluetooth.h"
+ #include "lib/sdp.h"
+@@ -44,8 +46,10 @@
+ static uint8_t major_class = MAJOR_CLASS_MISCELLANEOUS;
+ static uint8_t minor_class = MINOR_CLASS_UNCATEGORIZED;
+ 
+-static char *pretty_hostname = NULL;
+-static char *static_hostname = NULL;
++static char *pretty_hostname    = NULL;
++static char *static_hostname    = NULL;
++static char *transient_hostname = NULL;
++static guint hostname_id = 0;
+ 
+ /*
+  * Fallback to static hostname only if empty pretty hostname was already
+@@ -60,6 +64,10 @@ static const char *get_hostname(void)
+ 		if (static_hostname &&
+ 				g_str_equal(static_hostname, "") == FALSE)
+ 			return static_hostname;
++
++		if (transient_hostname &&
++				g_str_equal(transient_hostname, "") == FALSE)
++			return transient_hostname;
+ 	}
+ 
+ 	return NULL;
+@@ -181,6 +189,32 @@ static void property_changed(GDBusProxy *proxy, const char *name,
+ 	}
+ }
+ 
++static void read_transient_hostname(void)
++{
++	struct utsname u;
++
++	if (uname(&u) != 0) {
++		g_free(transient_hostname);
++		transient_hostname = NULL;
++		DBG("failed to read transient hostname");
++		return;
++	}
++
++	g_free(transient_hostname);
++	transient_hostname = g_strdup(u.nodename);
++
++	DBG("read transient hostname: '%s'", transient_hostname);
++}
++
++static gboolean hostname_cb(GIOChannel *io, GIOCondition cond,
++							gpointer user_data)
++{
++	DBG("transient hostname changed");
++	read_transient_hostname();
++	adapter_foreach(update_class, NULL);
++	return TRUE;
++}
++
+ static int hostname_probe(struct btd_adapter *adapter)
+ {
+ 	DBG("");
+@@ -261,9 +295,11 @@ static GDBusProxy *hostname_proxy = NULL;
+ static int hostname_init(void)
+ {
+ 	DBusConnection *conn = btd_get_dbus_connection();
++	int fd;
+ 	int err;
+ 
+ 	read_dmi_fallback();
++	read_transient_hostname();
+ 
+ 	hostname_client = g_dbus_client_new(conn, "org.freedesktop.hostname1",
+ 						"/org/freedesktop/hostname1");
+@@ -289,6 +325,17 @@ static int hostname_init(void)
+ 		hostname_client = NULL;
+ 	}
+ 
++	fd = open("/proc/sys/kernel/hostname", O_RDONLY);
++	if (fd < 0) {
++		error("open(/proc/sys/kernel/hostname): %s (%d)",
++					strerror(errno), errno);
++	} else {
++		GIOChannel *io = g_io_channel_unix_new(fd);
++
++		hostname_id = g_io_add_watch(io, G_IO_ERR, hostname_cb, NULL);
++		g_io_channel_unref(io);
++	}
++
+ 	return err;
+ }
+ 
+@@ -306,8 +353,14 @@ static void hostname_exit(void)
+ 		hostname_client = NULL;
+ 	}
+ 
++	if (hostname_id != 0) {
++		g_source_remove(hostname_id);
++		hostname_id = 0;
++	}
++
+ 	g_free(pretty_hostname);
+ 	g_free(static_hostname);
++	g_free(transient_hostname);
+ }
+ 
+ BLUETOOTH_PLUGIN_DEFINE(hostname, VERSION, BLUETOOTH_PLUGIN_PRIORITY_DEFAULT,
+-- 
+2.37.3
+


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

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

commit:     26f32e2abe9e0c412c98898f61b144a3f6e5fb76
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sat Dec  9 18:05:05 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Dec  9 18:06:02 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=26f32e2a

net-wireless/bluez: backport CVE-2023-45866 fix

Signed-off-by: Sam James <sam <AT> gentoo.org>

 net-wireless/bluez/bluez-5.70-r1.ebuild            | 288 +++++++++++++++++++++
 .../bluez/files/bluez-5.70-CVE-2023-45866.patch    |  43 +++
 2 files changed, 331 insertions(+)

diff --git a/net-wireless/bluez/bluez-5.70-r1.ebuild b/net-wireless/bluez/bluez-5.70-r1.ebuild
new file mode 100644
index 000000000000..756654822561
--- /dev/null
+++ b/net-wireless/bluez/bluez-5.70-r1.ebuild
@@ -0,0 +1,288 @@
+# 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 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
+
+	# Backport CVE-2023-45866 fix (bug #919383)
+	"${FILESDIR}"/${PN}-5.70-CVE-2023-45866.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() {
+	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.70-CVE-2023-45866.patch b/net-wireless/bluez/files/bluez-5.70-CVE-2023-45866.patch
new file mode 100644
index 000000000000..6e5ac253585c
--- /dev/null
+++ b/net-wireless/bluez/files/bluez-5.70-CVE-2023-45866.patch
@@ -0,0 +1,43 @@
+https://bugs.gentoo.org/919383
+https://git.kernel.org/pub/scm/bluetooth/bluez.git/commit/?id=25a471a83e02e1effb15d5a488b3f0085eaeb675
+
+From 25a471a83e02e1effb15d5a488b3f0085eaeb675 Mon Sep 17 00:00:00 2001
+From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
+Date: Tue, 10 Oct 2023 13:03:12 -0700
+Subject: input.conf: Change default of ClassicBondedOnly
+
+This changes the default of ClassicBondedOnly since defaulting to false
+is not inline with HID specification which mandates the of Security Mode
+4:
+
+BLUETOOTH SPECIFICATION Page 84 of 123
+Human Interface Device (HID) Profile:
+
+  5.4.3.4.2 Security Modes
+  Bluetooth HID Hosts shall use Security Mode 4 when interoperating with
+  Bluetooth HID devices that are compliant to the Bluetooth Core
+  Specification v2.1+EDR[6].
+--- a/profiles/input/device.c
++++ b/profiles/input/device.c
+@@ -81,7 +81,7 @@ struct input_device {
+ 
+ static int idle_timeout = 0;
+ static bool uhid_enabled = false;
+-static bool classic_bonded_only = false;
++static bool classic_bonded_only = true;
+ 
+ void input_set_idle_timeout(int timeout)
+ {
+--- a/profiles/input/input.conf
++++ b/profiles/input/input.conf
+@@ -17,7 +17,7 @@
+ # platforms may want to make sure that input connections only come from bonded
+ # device connections. Several older mice have been known for not supporting
+ # pairing/encryption.
+-# Defaults to false to maximize device compatibility.
++# Defaults to true for security.
+ #ClassicBondedOnly=true
+ 
+ # LE upgrade security
+-- 
+cgit 1.2.3-korg


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

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

commit:     7eea4a6e371f176706880da4b1e0ef04fb5c3f7c
Author:     Pacho Ramos <pacho <AT> gentoo <DOT> org>
AuthorDate: Sat Dec 16 09:14:54 2023 +0000
Commit:     Pacho Ramos <pacho <AT> gentoo <DOT> org>
CommitDate: Sat Dec 16 09:15:19 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7eea4a6e

net-wireless/bluez: drop 5.68, 5.69, 5.70

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

 net-wireless/bluez/Manifest                        |   2 -
 net-wireless/bluez/bluez-5.68.ebuild               | 294 ---------------------
 net-wireless/bluez/bluez-5.69.ebuild               | 285 --------------------
 net-wireless/bluez/bluez-5.70.ebuild               | 285 --------------------
 .../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 -------------
 .../bluez/files/bluez-5.68-clang-midi.patch        |  83 ------
 .../files/bluez-5.68-heap-use-after-free.patch     |  41 ---
 .../bluez/files/bluez-5.68-monitor-decoding.patch  |  45 ----
 11 files changed, 1556 deletions(-)

diff --git a/net-wireless/bluez/Manifest b/net-wireless/bluez/Manifest
index 081b8f9cd9b4..b316ef9b7427 100644
--- a/net-wireless/bluez/Manifest
+++ b/net-wireless/bluez/Manifest
@@ -1,4 +1,2 @@
-DIST bluez-5.68.tar.xz 2319788 BLAKE2B 3beca78fadef4d66df6f237b7460f6ac4bf001d80c856b599faa2cc1232c4342c7945eace5a6667009b9d19f2368f9841e608f07bc826b30ce9112c43dd7e316 SHA512 1805fb68923a5e098777b69835d7593396f8f2bbf52e1cfe58e7447621497a700b23389c79e96b2d663c611335f6ea9df11efe8aa75a8842f6b73105f66e799c
-DIST bluez-5.69.tar.xz 2335728 BLAKE2B 3b85c6418bf5f8fea989d9435d90f704da707248034006d12863465b9acee2b549f6d2950fdde64e74a1cbded4c711c54db747a82abdaa67ec965aab1c817d85 SHA512 4d5618cd083fe375c41faff868b5d9f072aeaccdffed758f6b69fd0cb46b058431cbf63182bd4a3f4f4e7a24b092729a4125687af730cd4250b273d66107bf42
 DIST bluez-5.70.tar.xz 2339844 BLAKE2B 1ba2ddd3bfc6562a07f4e8376e0d537b555f0d36a221f051c4c10dd912c23e73aa2b0d8aa125e0fd911908e4cfa0036429e17250a26b3298bb21f65e4cc5255c SHA512 3a5f8caf7730dcdbbe0bb92154b41651a9d6619038447bf4c25e5e3e5316effcd7242a7a0456d731ce21d55b8daea5212a359acc5e5fc460499b9356b7d364cf
 DIST bluez-5.71.tar.xz 2381208 BLAKE2B 73e5f08771f821c90a70c553c600c48c4f1adb85aa9cb1a1eaae61a33b2dda73b7825fe769b3ea1daaaadedc39ad3fb71d84b336408f5ce6963f0373e9f7dcce SHA512 648394bbe470405aa0e2d3914474e95c122f567deaaac20a5dd74bac29fa430dfb64cdb7bdb4fb7510e62fa73e96112a97197fc212b421bf480b8d1bb24cfb5d

diff --git a/net-wireless/bluez/bluez-5.68.ebuild b/net-wireless/bluez/bluez-5.68.ebuild
deleted file mode 100644
index 37f02d578577..000000000000
--- a/net-wireless/bluez/bluez-5.68.ebuild
+++ /dev/null
@@ -1,294 +0,0 @@
-# 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
-	"${FILESDIR}"/${P}-clang-midi.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() {
-	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.69.ebuild b/net-wireless/bluez/bluez-5.69.ebuild
deleted file mode 100644
index 657bb53be4c7..000000000000
--- a/net-wireless/bluez/bluez-5.69.ebuild
+++ /dev/null
@@ -1,285 +0,0 @@
-# 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 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() {
-	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.70.ebuild b/net-wireless/bluez/bluez-5.70.ebuild
deleted file mode 100644
index 657bb53be4c7..000000000000
--- a/net-wireless/bluez/bluez-5.70.ebuild
+++ /dev/null
@@ -1,285 +0,0 @@
-# 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 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() {
-	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
deleted file mode 100644
index bb79fc42734b..000000000000
--- a/net-wireless/bluez/files/bluez-5.68-bap-dettach-io.patch
+++ /dev/null
@@ -1,101 +0,0 @@
-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
deleted file mode 100644
index 72b875ba4b6f..000000000000
--- a/net-wireless/bluez/files/bluez-5.68-bap-ebusy-fix.patch
+++ /dev/null
@@ -1,206 +0,0 @@
-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
deleted file mode 100644
index 3a7ddd3c6f2a..000000000000
--- a/net-wireless/bluez/files/bluez-5.68-bap-nonzero.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-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
deleted file mode 100644
index fbc2eeda89cc..000000000000
--- a/net-wireless/bluez/files/bluez-5.68-bap-resume.patch
+++ /dev/null
@@ -1,187 +0,0 @@
-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-clang-midi.patch b/net-wireless/bluez/files/bluez-5.68-clang-midi.patch
deleted file mode 100644
index f62d9f395944..000000000000
--- a/net-wireless/bluez/files/bluez-5.68-clang-midi.patch
+++ /dev/null
@@ -1,83 +0,0 @@
-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 
-

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
deleted file mode 100644
index 3cc6733634a5..000000000000
--- a/net-wireless/bluez/files/bluez-5.68-heap-use-after-free.patch
+++ /dev/null
@@ -1,41 +0,0 @@
-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
deleted file mode 100644
index 6d5c6306ccd3..000000000000
--- a/net-wireless/bluez/files/bluez-5.68-monitor-decoding.patch
+++ /dev/null
@@ -1,45 +0,0 @@
-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/files/, net-wireless/bluez/
@ 2023-12-21  9:23 Pacho Ramos
  0 siblings, 0 replies; 22+ messages in thread
From: Pacho Ramos @ 2023-12-21  9:23 UTC (permalink / raw
  To: gentoo-commits

commit:     908539cda2d09793344370cd12b06e3adc5419b2
Author:     Pacho Ramos <pacho <AT> gentoo <DOT> org>
AuthorDate: Thu Dec 21 09:22:41 2023 +0000
Commit:     Pacho Ramos <pacho <AT> gentoo <DOT> org>
CommitDate: Thu Dec 21 09:23:03 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=908539cd

net-wireless/bluez: Fix auto-connect with older kernels

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

 net-wireless/bluez/bluez-5.71-r1.ebuild            | 288 +++++++++++++++++++++
 .../bluez/files/bluez-5.71-link-old-kernels.patch  | 163 ++++++++++++
 2 files changed, 451 insertions(+)

diff --git a/net-wireless/bluez/bluez-5.71-r1.ebuild b/net-wireless/bluez/bluez-5.71-r1.ebuild
new file mode 100644
index 000000000000..c7392ed1615f
--- /dev/null
+++ b/net-wireless/bluez/bluez-5.71-r1.ebuild
@@ -0,0 +1,288 @@
+# 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 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
+
+	# https://github.com/bluez/bluez/issues/686
+	"${FILESDIR}"/${P}-link-old-kernels.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() {
+	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.71-link-old-kernels.patch b/net-wireless/bluez/files/bluez-5.71-link-old-kernels.patch
new file mode 100644
index 000000000000..33cee137f277
--- /dev/null
+++ b/net-wireless/bluez/files/bluez-5.71-link-old-kernels.patch
@@ -0,0 +1,163 @@
+From 7ad5669402c9acff8e4cc808edc12a41df36654e Mon Sep 17 00:00:00 2001
+From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
+Date: Wed, 20 Dec 2023 12:20:03 -0500
+Subject: [PATCH] adapter: Fix link key address type for old kernels
+
+On old kernels only BDADDR_BREDR is supported so this attempts to detect
+that and retry.
+
+Fixes: https://github.com/bluez/bluez/issues/686
+---
+ src/adapter.c | 59 ++++++++++++++++++++++++++++++++++++++-------------
+ 1 file changed, 44 insertions(+), 15 deletions(-)
+
+diff --git a/src/adapter.c b/src/adapter.c
+index ee70b00d2..022390f0d 100644
+--- a/src/adapter.c
++++ b/src/adapter.c
+@@ -311,6 +311,7 @@ struct btd_adapter {
+ 	bool pincode_requested;		/* PIN requested during last bonding */
+ 	GSList *connections;		/* Connected devices */
+ 	GSList *devices;		/* Devices structure pointers */
++	GSList *load_keys;		/* Devices keys to be loaded */
+ 	GSList *connect_list;		/* Devices to connect when found */
+ 	struct btd_device *connect_le;	/* LE device waiting to be connected */
+ 	sdp_list_t *services;		/* Services associated to adapter */
+@@ -4284,6 +4285,9 @@ static int set_privacy(struct btd_adapter *adapter, uint8_t privacy)
+ 	return -1;
+ }
+ 
++static void load_link_keys(struct btd_adapter *adapter, bool debug_keys,
++							bool retry);
++
+ static void load_link_keys_complete(uint8_t status, uint16_t length,
+ 					const void *param, void *user_data)
+ {
+@@ -4293,18 +4297,31 @@ static void load_link_keys_complete(uint8_t status, uint16_t length,
+ 		btd_error(adapter->dev_id,
+ 			"Failed to load link keys for hci%u: %s (0x%02x)",
+ 				adapter->dev_id, mgmt_errstr(status), status);
++
++		if (status == MGMT_STATUS_INVALID_PARAMS) {
++			load_link_keys(adapter, btd_opts.debug_keys, true);
++			/* Release keys after retry since we shall only retry
++			 * once.
++			 */
++			goto done;
++		}
++
+ 		return;
+ 	}
+ 
+ 	DBG("link keys loaded for hci%u", adapter->dev_id);
++
++done:
++	g_slist_free_full(adapter->load_keys, g_free);
++	adapter->load_keys = NULL;
+ }
+ 
+-static void load_link_keys(struct btd_adapter *adapter, GSList *keys,
+-							bool debug_keys)
++static void load_link_keys(struct btd_adapter *adapter, bool debug_keys,
++							bool retry)
+ {
+ 	struct mgmt_cp_load_link_keys *cp;
+ 	struct mgmt_link_key_info *key;
+-	size_t key_count, cp_size;
++	size_t count, cp_size;
+ 	unsigned int id;
+ 	GSList *l;
+ 
+@@ -4318,12 +4335,14 @@ static void load_link_keys(struct btd_adapter *adapter, GSList *keys,
+ 	if (!(adapter->supported_settings & MGMT_SETTING_BREDR))
+ 		return;
+ 
+-	key_count = g_slist_length(keys);
++	count = g_slist_length(adapter->load_keys);
++	if (!count)
++		return;
+ 
+-	DBG("hci%u keys %zu debug_keys %d", adapter->dev_id, key_count,
+-								debug_keys);
++	DBG("hci%u keys %zu debug_keys %d retry %s", adapter->dev_id, count,
++				debug_keys, retry ? "true" : "false");
+ 
+-	cp_size = sizeof(*cp) + (key_count * sizeof(*key));
++	cp_size = sizeof(*cp) + (count * sizeof(*key));
+ 
+ 	cp = g_try_malloc0(cp_size);
+ 	if (cp == NULL) {
+@@ -4341,13 +4360,18 @@ static void load_link_keys(struct btd_adapter *adapter, GSList *keys,
+ 	 * behavior for debug keys.
+ 	 */
+ 	cp->debug_keys = debug_keys;
+-	cp->key_count = htobs(key_count);
++	cp->key_count = htobs(count);
+ 
+-	for (l = keys, key = cp->keys; l != NULL; l = g_slist_next(l), key++) {
++	for (l = adapter->load_keys, key = cp->keys; l != NULL;
++					l = g_slist_next(l), key++) {
+ 		struct link_key_info *info = l->data;
+ 
+ 		bacpy(&key->addr.bdaddr, &info->bdaddr);
+-		key->addr.type = info->bdaddr_type;
++		/* Old kernels might only support loading with type set to
++		 * BDADDR_BREDR so on retry set that instead of using the stored
++		 * info.
++		 */
++		key->addr.type = retry ? BDADDR_BREDR : info->bdaddr_type;
+ 		key->type = info->type;
+ 		memcpy(key->val, info->key, 16);
+ 		key->pin_len = info->pin_len;
+@@ -4359,9 +4383,12 @@ static void load_link_keys(struct btd_adapter *adapter, GSList *keys,
+ 
+ 	g_free(cp);
+ 
+-	if (id == 0)
++	if (id == 0) {
+ 		btd_error(adapter->dev_id, "Failed to load link keys for hci%u",
+ 							adapter->dev_id);
++		g_slist_free_full(adapter->load_keys, g_free);
++		adapter->load_keys = NULL;
++	}
+ }
+ 
+ static void load_ltks_complete(uint8_t status, uint16_t length,
+@@ -4873,7 +4900,6 @@ static void load_defaults(struct btd_adapter *adapter)
+ static void load_devices(struct btd_adapter *adapter)
+ {
+ 	char dirname[PATH_MAX];
+-	GSList *keys = NULL;
+ 	GSList *ltks = NULL;
+ 	GSList *irks = NULL;
+ 	GSList *params = NULL;
+@@ -4964,7 +4990,8 @@ static void load_devices(struct btd_adapter *adapter)
+ 		}
+ 
+ 		if (key_info)
+-			keys = g_slist_append(keys, key_info);
++			adapter->load_keys = g_slist_append(adapter->load_keys,
++								key_info);
+ 
+ 		if (ltk_info)
+ 			ltks = g_slist_append(ltks, ltk_info);
+@@ -5013,8 +5040,7 @@ static void load_devices(struct btd_adapter *adapter)
+ 
+ 	closedir(dir);
+ 
+-	load_link_keys(adapter, keys, btd_opts.debug_keys);
+-	g_slist_free_full(keys, g_free);
++	load_link_keys(adapter, btd_opts.debug_keys, false);
+ 
+ 	load_ltks(adapter, ltks);
+ 	g_slist_free_full(ltks, g_free);
+@@ -6930,6 +6956,9 @@ static void adapter_remove(struct btd_adapter *adapter)
+ 	g_slist_free(adapter->devices);
+ 	adapter->devices = NULL;
+ 
++	g_slist_free(adapter->load_keys);
++	adapter->load_keys = NULL;
++
+ 	discovery_cleanup(adapter, 0);
+ 
+ 	unload_drivers(adapter);


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

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

commit:     b9ff9d632b84c905da6334a0dcf26a5c5180c043
Author:     Pacho Ramos <pacho <AT> gentoo <DOT> org>
AuthorDate: Thu Mar  7 14:28:26 2024 +0000
Commit:     Pacho Ramos <pacho <AT> gentoo <DOT> org>
CommitDate: Thu Mar  7 14:28:26 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b9ff9d63

net-wireless/bluez: drop 5.70-r1, 5.71-r1

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

 net-wireless/bluez/Manifest                        |   2 -
 net-wireless/bluez/bluez-5.70-r1.ebuild            | 288 ---------------------
 net-wireless/bluez/bluez-5.71-r1.ebuild            | 288 ---------------------
 .../bluez/files/bluez-5.70-CVE-2023-45866.patch    |  43 ---
 .../bluez/files/bluez-5.71-link-old-kernels.patch  | 163 ------------
 5 files changed, 784 deletions(-)

diff --git a/net-wireless/bluez/Manifest b/net-wireless/bluez/Manifest
index ad631202f4f3..016cfdbb5deb 100644
--- a/net-wireless/bluez/Manifest
+++ b/net-wireless/bluez/Manifest
@@ -1,3 +1 @@
-DIST bluez-5.70.tar.xz 2339844 BLAKE2B 1ba2ddd3bfc6562a07f4e8376e0d537b555f0d36a221f051c4c10dd912c23e73aa2b0d8aa125e0fd911908e4cfa0036429e17250a26b3298bb21f65e4cc5255c SHA512 3a5f8caf7730dcdbbe0bb92154b41651a9d6619038447bf4c25e5e3e5316effcd7242a7a0456d731ce21d55b8daea5212a359acc5e5fc460499b9356b7d364cf
-DIST bluez-5.71.tar.xz 2381208 BLAKE2B 73e5f08771f821c90a70c553c600c48c4f1adb85aa9cb1a1eaae61a33b2dda73b7825fe769b3ea1daaaadedc39ad3fb71d84b336408f5ce6963f0373e9f7dcce SHA512 648394bbe470405aa0e2d3914474e95c122f567deaaac20a5dd74bac29fa430dfb64cdb7bdb4fb7510e62fa73e96112a97197fc212b421bf480b8d1bb24cfb5d
 DIST bluez-5.72.tar.xz 2390792 BLAKE2B b5d1bc290c9bad5aa32de16433c34d0ac5aed7164077ef941a0bf90eddc5e22a6cf19f972bcae33061b41e3c344f7abeb65a11b6013c13fd53059ac93d83240a SHA512 1c6560f60ac0654d7c25ed8ab2f0f3a3a9ca8688ee28e1c476ffc7ae38737e739d27bbb88789c86b03fc600a8a68496d90a7b395ec393dd2bbf69be62357991a

diff --git a/net-wireless/bluez/bluez-5.70-r1.ebuild b/net-wireless/bluez/bluez-5.70-r1.ebuild
deleted file mode 100644
index 2595b6e1428f..000000000000
--- a/net-wireless/bluez/bluez-5.70-r1.ebuild
+++ /dev/null
@@ -1,288 +0,0 @@
-# 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 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
-
-	# Backport CVE-2023-45866 fix (bug #919383)
-	"${FILESDIR}"/${PN}-5.70-CVE-2023-45866.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() {
-	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.71-r1.ebuild b/net-wireless/bluez/bluez-5.71-r1.ebuild
deleted file mode 100644
index c7392ed1615f..000000000000
--- a/net-wireless/bluez/bluez-5.71-r1.ebuild
+++ /dev/null
@@ -1,288 +0,0 @@
-# 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 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
-
-	# https://github.com/bluez/bluez/issues/686
-	"${FILESDIR}"/${P}-link-old-kernels.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() {
-	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.70-CVE-2023-45866.patch b/net-wireless/bluez/files/bluez-5.70-CVE-2023-45866.patch
deleted file mode 100644
index 6e5ac253585c..000000000000
--- a/net-wireless/bluez/files/bluez-5.70-CVE-2023-45866.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-https://bugs.gentoo.org/919383
-https://git.kernel.org/pub/scm/bluetooth/bluez.git/commit/?id=25a471a83e02e1effb15d5a488b3f0085eaeb675
-
-From 25a471a83e02e1effb15d5a488b3f0085eaeb675 Mon Sep 17 00:00:00 2001
-From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
-Date: Tue, 10 Oct 2023 13:03:12 -0700
-Subject: input.conf: Change default of ClassicBondedOnly
-
-This changes the default of ClassicBondedOnly since defaulting to false
-is not inline with HID specification which mandates the of Security Mode
-4:
-
-BLUETOOTH SPECIFICATION Page 84 of 123
-Human Interface Device (HID) Profile:
-
-  5.4.3.4.2 Security Modes
-  Bluetooth HID Hosts shall use Security Mode 4 when interoperating with
-  Bluetooth HID devices that are compliant to the Bluetooth Core
-  Specification v2.1+EDR[6].
---- a/profiles/input/device.c
-+++ b/profiles/input/device.c
-@@ -81,7 +81,7 @@ struct input_device {
- 
- static int idle_timeout = 0;
- static bool uhid_enabled = false;
--static bool classic_bonded_only = false;
-+static bool classic_bonded_only = true;
- 
- void input_set_idle_timeout(int timeout)
- {
---- a/profiles/input/input.conf
-+++ b/profiles/input/input.conf
-@@ -17,7 +17,7 @@
- # platforms may want to make sure that input connections only come from bonded
- # device connections. Several older mice have been known for not supporting
- # pairing/encryption.
--# Defaults to false to maximize device compatibility.
-+# Defaults to true for security.
- #ClassicBondedOnly=true
- 
- # LE upgrade security
--- 
-cgit 1.2.3-korg

diff --git a/net-wireless/bluez/files/bluez-5.71-link-old-kernels.patch b/net-wireless/bluez/files/bluez-5.71-link-old-kernels.patch
deleted file mode 100644
index 33cee137f277..000000000000
--- a/net-wireless/bluez/files/bluez-5.71-link-old-kernels.patch
+++ /dev/null
@@ -1,163 +0,0 @@
-From 7ad5669402c9acff8e4cc808edc12a41df36654e Mon Sep 17 00:00:00 2001
-From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
-Date: Wed, 20 Dec 2023 12:20:03 -0500
-Subject: [PATCH] adapter: Fix link key address type for old kernels
-
-On old kernels only BDADDR_BREDR is supported so this attempts to detect
-that and retry.
-
-Fixes: https://github.com/bluez/bluez/issues/686
----
- src/adapter.c | 59 ++++++++++++++++++++++++++++++++++++++-------------
- 1 file changed, 44 insertions(+), 15 deletions(-)
-
-diff --git a/src/adapter.c b/src/adapter.c
-index ee70b00d2..022390f0d 100644
---- a/src/adapter.c
-+++ b/src/adapter.c
-@@ -311,6 +311,7 @@ struct btd_adapter {
- 	bool pincode_requested;		/* PIN requested during last bonding */
- 	GSList *connections;		/* Connected devices */
- 	GSList *devices;		/* Devices structure pointers */
-+	GSList *load_keys;		/* Devices keys to be loaded */
- 	GSList *connect_list;		/* Devices to connect when found */
- 	struct btd_device *connect_le;	/* LE device waiting to be connected */
- 	sdp_list_t *services;		/* Services associated to adapter */
-@@ -4284,6 +4285,9 @@ static int set_privacy(struct btd_adapter *adapter, uint8_t privacy)
- 	return -1;
- }
- 
-+static void load_link_keys(struct btd_adapter *adapter, bool debug_keys,
-+							bool retry);
-+
- static void load_link_keys_complete(uint8_t status, uint16_t length,
- 					const void *param, void *user_data)
- {
-@@ -4293,18 +4297,31 @@ static void load_link_keys_complete(uint8_t status, uint16_t length,
- 		btd_error(adapter->dev_id,
- 			"Failed to load link keys for hci%u: %s (0x%02x)",
- 				adapter->dev_id, mgmt_errstr(status), status);
-+
-+		if (status == MGMT_STATUS_INVALID_PARAMS) {
-+			load_link_keys(adapter, btd_opts.debug_keys, true);
-+			/* Release keys after retry since we shall only retry
-+			 * once.
-+			 */
-+			goto done;
-+		}
-+
- 		return;
- 	}
- 
- 	DBG("link keys loaded for hci%u", adapter->dev_id);
-+
-+done:
-+	g_slist_free_full(adapter->load_keys, g_free);
-+	adapter->load_keys = NULL;
- }
- 
--static void load_link_keys(struct btd_adapter *adapter, GSList *keys,
--							bool debug_keys)
-+static void load_link_keys(struct btd_adapter *adapter, bool debug_keys,
-+							bool retry)
- {
- 	struct mgmt_cp_load_link_keys *cp;
- 	struct mgmt_link_key_info *key;
--	size_t key_count, cp_size;
-+	size_t count, cp_size;
- 	unsigned int id;
- 	GSList *l;
- 
-@@ -4318,12 +4335,14 @@ static void load_link_keys(struct btd_adapter *adapter, GSList *keys,
- 	if (!(adapter->supported_settings & MGMT_SETTING_BREDR))
- 		return;
- 
--	key_count = g_slist_length(keys);
-+	count = g_slist_length(adapter->load_keys);
-+	if (!count)
-+		return;
- 
--	DBG("hci%u keys %zu debug_keys %d", adapter->dev_id, key_count,
--								debug_keys);
-+	DBG("hci%u keys %zu debug_keys %d retry %s", adapter->dev_id, count,
-+				debug_keys, retry ? "true" : "false");
- 
--	cp_size = sizeof(*cp) + (key_count * sizeof(*key));
-+	cp_size = sizeof(*cp) + (count * sizeof(*key));
- 
- 	cp = g_try_malloc0(cp_size);
- 	if (cp == NULL) {
-@@ -4341,13 +4360,18 @@ static void load_link_keys(struct btd_adapter *adapter, GSList *keys,
- 	 * behavior for debug keys.
- 	 */
- 	cp->debug_keys = debug_keys;
--	cp->key_count = htobs(key_count);
-+	cp->key_count = htobs(count);
- 
--	for (l = keys, key = cp->keys; l != NULL; l = g_slist_next(l), key++) {
-+	for (l = adapter->load_keys, key = cp->keys; l != NULL;
-+					l = g_slist_next(l), key++) {
- 		struct link_key_info *info = l->data;
- 
- 		bacpy(&key->addr.bdaddr, &info->bdaddr);
--		key->addr.type = info->bdaddr_type;
-+		/* Old kernels might only support loading with type set to
-+		 * BDADDR_BREDR so on retry set that instead of using the stored
-+		 * info.
-+		 */
-+		key->addr.type = retry ? BDADDR_BREDR : info->bdaddr_type;
- 		key->type = info->type;
- 		memcpy(key->val, info->key, 16);
- 		key->pin_len = info->pin_len;
-@@ -4359,9 +4383,12 @@ static void load_link_keys(struct btd_adapter *adapter, GSList *keys,
- 
- 	g_free(cp);
- 
--	if (id == 0)
-+	if (id == 0) {
- 		btd_error(adapter->dev_id, "Failed to load link keys for hci%u",
- 							adapter->dev_id);
-+		g_slist_free_full(adapter->load_keys, g_free);
-+		adapter->load_keys = NULL;
-+	}
- }
- 
- static void load_ltks_complete(uint8_t status, uint16_t length,
-@@ -4873,7 +4900,6 @@ static void load_defaults(struct btd_adapter *adapter)
- static void load_devices(struct btd_adapter *adapter)
- {
- 	char dirname[PATH_MAX];
--	GSList *keys = NULL;
- 	GSList *ltks = NULL;
- 	GSList *irks = NULL;
- 	GSList *params = NULL;
-@@ -4964,7 +4990,8 @@ static void load_devices(struct btd_adapter *adapter)
- 		}
- 
- 		if (key_info)
--			keys = g_slist_append(keys, key_info);
-+			adapter->load_keys = g_slist_append(adapter->load_keys,
-+								key_info);
- 
- 		if (ltk_info)
- 			ltks = g_slist_append(ltks, ltk_info);
-@@ -5013,8 +5040,7 @@ static void load_devices(struct btd_adapter *adapter)
- 
- 	closedir(dir);
- 
--	load_link_keys(adapter, keys, btd_opts.debug_keys);
--	g_slist_free_full(keys, g_free);
-+	load_link_keys(adapter, btd_opts.debug_keys, false);
- 
- 	load_ltks(adapter, ltks);
- 	g_slist_free_full(ltks, g_free);
-@@ -6930,6 +6956,9 @@ static void adapter_remove(struct btd_adapter *adapter)
- 	g_slist_free(adapter->devices);
- 	adapter->devices = NULL;
- 
-+	g_slist_free(adapter->load_keys);
-+	adapter->load_keys = NULL;
-+
- 	discovery_cleanup(adapter, 0);
- 
- 	unload_drivers(adapter);


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

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

commit:     b9883b6871c36f7b6b2f717aec8d00d8ea71549c
Author:     Pacho Ramos <pacho <AT> gentoo <DOT> org>
AuthorDate: Mon Mar 25 18:44:48 2024 +0000
Commit:     Pacho Ramos <pacho <AT> gentoo <DOT> org>
CommitDate: Mon Mar 25 18:45:00 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b9883b68

net-wireless/bluez: add 5.73

Thanks-to: Sam James
Thanks-to: Lars Wendler
Closes: https://bugs.gentoo.org/927791
Signed-off-by: Pacho Ramos <pacho <AT> gentoo.org>

 net-wireless/bluez/Manifest                        |   1 +
 net-wireless/bluez/bluez-5.73.ebuild               | 271 +++++++++++++++++++++
 .../bluez/files/bluez-5.73-configure-cups.patch    |  35 +++
 3 files changed, 307 insertions(+)

diff --git a/net-wireless/bluez/Manifest b/net-wireless/bluez/Manifest
index 016cfdbb5deb..4f894bc5d6dd 100644
--- a/net-wireless/bluez/Manifest
+++ b/net-wireless/bluez/Manifest
@@ -1 +1,2 @@
 DIST bluez-5.72.tar.xz 2390792 BLAKE2B b5d1bc290c9bad5aa32de16433c34d0ac5aed7164077ef941a0bf90eddc5e22a6cf19f972bcae33061b41e3c344f7abeb65a11b6013c13fd53059ac93d83240a SHA512 1c6560f60ac0654d7c25ed8ab2f0f3a3a9ca8688ee28e1c476ffc7ae38737e739d27bbb88789c86b03fc600a8a68496d90a7b395ec393dd2bbf69be62357991a
+DIST bluez-5.73.tar.xz 2408088 BLAKE2B 69c5b8c23039108403631da86c29d62869f2311bb34eeb471779fae094bbf8738193389fb8792b779b10eaeca5b02723c86f2b98c435bbd2c23a3d317df76070 SHA512 20090da036d3d614706b14a757b02acf138859d8f0476aa7f68d57635dfb3632ce7d8bb3456320904d72333d1314a5fe14dcb8ece307e6d31ce6d2d516de25e8

diff --git a/net-wireless/bluez/bluez-5.73.ebuild b/net-wireless/bluez/bluez-5.73.ebuild
new file mode 100644
index 000000000000..f71af719302f
--- /dev/null
+++ b/net-wireless/bluez/bluez-5.73.ebuild
@@ -0,0 +1,271 @@
+# 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 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
+	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 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.73-configure-cups.patch b/net-wireless/bluez/files/bluez-5.73-configure-cups.patch
new file mode 100644
index 000000000000..1ab1f96915ee
--- /dev/null
+++ b/net-wireless/bluez/files/bluez-5.73-configure-cups.patch
@@ -0,0 +1,35 @@
+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/files/, net-wireless/bluez/
@ 2024-04-07 16:06 Pacho Ramos
  0 siblings, 0 replies; 22+ messages in thread
From: Pacho Ramos @ 2024-04-07 16:06 UTC (permalink / raw
  To: gentoo-commits

commit:     417b23a120e91255efb3c5342bef6bdf1f370fba
Author:     Pacho Ramos <pacho <AT> gentoo <DOT> org>
AuthorDate: Sun Apr  7 16:06:12 2024 +0000
Commit:     Pacho Ramos <pacho <AT> gentoo <DOT> org>
CommitDate: Sun Apr  7 16:06:12 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=417b23a1

net-wireless/bluez: Fix obex dbus file installation on non-systemd systems

Thanks-to: Andreas Fink
Closes: https://bugs.gentoo.org/928417
Signed-off-by: Pacho Ramos <pacho <AT> gentoo.org>

 net-wireless/bluez/bluez-5.73-r1.ebuild            | 278 +++++++++++++++++++++
 ...xd-without-systemd-in-the-user-session-r3.patch |  20 ++
 2 files changed, 298 insertions(+)

diff --git a/net-wireless/bluez/bluez-5.73-r1.ebuild b/net-wireless/bluez/bluez-5.73-r1.ebuild
new file mode 100644
index 000000000000..d67e578fb3ef
--- /dev/null
+++ b/net-wireless/bluez/bluez-5.73-r1.ebuild
@@ -0,0 +1,278 @@
+# 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/files/0001-Allow-using-obexd-without-systemd-in-the-user-session-r3.patch b/net-wireless/bluez/files/0001-Allow-using-obexd-without-systemd-in-the-user-session-r3.patch
new file mode 100644
index 000000000000..bb4c838b9545
--- /dev/null
+++ b/net-wireless/bluez/files/0001-Allow-using-obexd-without-systemd-in-the-user-session-r3.patch
@@ -0,0 +1,20 @@
+https://github.com/bluez/bluez/issues/806
+https://bugs.gentoo.org/928417
+--- bluez-5.73.orig/Makefile.obexd	2024-04-02 10:38:48.743419656 +0200
++++ bluez-5.73/Makefile.obexd	2024-04-02 10:40:53.300086281 +0200
+@@ -1,13 +1,13 @@
+ # SPDX-License-Identifier: GPL-2.0
+ if OBEX
+ 
++dbussessionbusdir = $(DBUS_SESSIONBUSDIR)
++dbussessionbus_DATA = obexd/src/org.bluez.obex.service
++
+ if SYSTEMD
+ systemduserunitdir = $(SYSTEMD_USERUNITDIR)
+ 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


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

end of thread, other threads:[~2024-04-07 16:06 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-07 16:06 [gentoo-commits] repo/gentoo:master commit in: net-wireless/bluez/files/, net-wireless/bluez/ Pacho Ramos
  -- strict thread matches above, loose matches on Subject: below --
2024-03-25 18:45 Pacho Ramos
2024-03-07 14:28 Pacho Ramos
2023-12-21  9:23 Pacho Ramos
2023-12-16  9:15 Pacho Ramos
2023-12-09 18:11 Sam James
2022-12-04 14:50 Pacho Ramos
2022-01-16  9:38 Pacho Ramos
2021-10-19 21:19 Pacho Ramos
2021-07-25  9:01 Pacho Ramos
2021-06-23  7:53 Pacho Ramos
2021-06-22 16:17 Pacho Ramos
2021-03-22 21:16 Pacho Ramos
2019-10-20 11:39 Pacho Ramos
2019-09-29 11:01 Pacho Ramos
2019-06-10 11:23 Pacho Ramos
2019-01-19  8:56 Pacho Ramos
2018-05-23 18:52 Pacho Ramos
2017-09-24 21:26 Pacho Ramos
2017-09-14 17:23 Patrick McLean
2017-02-04 15:20 Pacho Ramos
2016-02-12  8:50 Jeroen Roovers

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