summaryrefslogtreecommitdiff
path: root/net-wireless/bluez
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2019-10-13 22:19:36 +0100
committerV3n3RiX <venerix@redcorelinux.org>2019-10-14 23:22:23 +0100
commit4b19be30aa626b327c885dae62c559ec0e9fb935 (patch)
tree76e74807bc479502e13866b581b6bf86734ec634 /net-wireless/bluez
parent30d6f67c98d149508509d5e86f176d558793acc0 (diff)
gentoo resync : 13.10.2019
Diffstat (limited to 'net-wireless/bluez')
-rw-r--r--net-wireless/bluez/Manifest11
-rw-r--r--net-wireless/bluez/bluez-5.50-r3.ebuild2
-rw-r--r--net-wireless/bluez/bluez-5.51.ebuild (renamed from net-wireless/bluez/bluez-5.50-r2.ebuild)87
-rw-r--r--net-wireless/bluez/files/0001-Allow-using-obexd-without-systemd-in-the-user-session-r1.patch58
-rw-r--r--net-wireless/bluez/files/69-btattach-bcm.rules33
-rw-r--r--[-rwxr-xr-x]net-wireless/bluez/files/bluetooth-init.d-r42
-rw-r--r--net-wireless/bluez/files/btattach-bcm-service.sh30
-rw-r--r--net-wireless/bluez/files/btattach-bcm_at.service6
8 files changed, 188 insertions, 41 deletions
diff --git a/net-wireless/bluez/Manifest b/net-wireless/bluez/Manifest
index 38f60e8ee447..1a08840a6ac3 100644
--- a/net-wireless/bluez/Manifest
+++ b/net-wireless/bluez/Manifest
@@ -1,15 +1,20 @@
AUX 0001-Allow-using-obexd-without-systemd-in-the-user-sessio.patch 1907 BLAKE2B f930b3a5d1b928ec89f08a07c25acc4f0c77b43de1e389583a1d86b3b9e542ceb9d67a5d938fcddc91df7b2fff0364fb01b10a12c7a6606cba6ef0045b935d6c SHA512 17a0967ac291be3822e2be73912ab4c1720564bdce0765582e54bc0347d0477d38f82dbf0db9d660f982c35b3c2ea13dd37b22e18223d36745306c4c9d859423
+AUX 0001-Allow-using-obexd-without-systemd-in-the-user-session-r1.patch 1909 BLAKE2B a4929ea456e63bb9e0de76885c4de9ffc7082bf869f46be61bba11c351a3de471b9fc93a4b2f094243f5d4c3bc172a9ff98c26c6d3530b75264cd64d6fade7a2 SHA512 5b278d603632685e31eeda6fe0bf32bd59536c6d8f2af221c3e39aa4a26bcbb6cb25d75822dbcf0a2ffb43f645b73a17bff1b62f40815c0f6243391ce24f5813
AUX 0001-obex-Use-GLib-helper-function-to-manipulate-paths.patch 1252 BLAKE2B ce6d00ea244d91e76b696e60ddb9096aa48572b68474f321f05b0e3e9525932e6fdaeacc3b141dc4b118d5fa305b7a0510e9c57c935e489a9c159dcd826ad870 SHA512 774f1d9cd49dd3fc0e9f02ad93876c59d78f88f149591f384cf5d2e3541d237ce390552c8bc2cb4d4ad7e5dcc295df49220565f0b0e686a2f8b3404f68323d32
AUX 0004-agent-Assert-possible-infinite-loop.patch 583 BLAKE2B 22cd0d0b4c6c1859631e31bba434f368a1cec07128aa69ecb9003734292aa1349b5dfad87b0ac35e79d089459dd24ecc8cb8f7bd0147c52b2284c2340884ee93 SHA512 f3af46b27180f500c3f978799633b7a01a9d7720eafdb7a9fb108684161616b976b42d135a2358785830c26642ef7c2175d0f1fa3d6df898fe3bd5e77f6a191d
-AUX bluetooth-init.d-r4 283 BLAKE2B 639679bb0156538e63e5e401a3063f8e72c2096b9ff9558e2e3289bd337dfb11c228010a50e40dd0a84ab2bb6f9cba69eb59b51b018d4983638dba4e3635e20c SHA512 155ec9c0deb82b1fc2218a0d23297ea1390b1ce0bcfffaf4b5ffbf5ee13fe4179b763edfcc6dec48c7a731a852d5307966090f35cc5caf28bbb8bee7dd01714a
+AUX 69-btattach-bcm.rules 2141 BLAKE2B 07fe8306e29f05082a603bd5a4b9d51c8c23b4ed48eaeebd01591970c0e29ea37198abaa8725023fd00cd38c67451910b6028d6725be3aca5ed1c495e02555ee SHA512 ecf535d737b9f1dc7a077f2a13e3712c959c505a93c24f48d63b04db0d42f8feef3918d48b7db5e8e115574a9b62f47aaa9c3e77230cff682d3f35da2f09047e
+AUX bluetooth-init.d-r4 280 BLAKE2B ecb807dec050b7c754e87b43848292ffd68afb36465739462208d1564c59d59b3c8801dca5f9ba8547efc982d972cdaeef340403c82c9fa1ad8922b0396d29bd SHA512 05fd235483c65decc8badeca1b3ec60ae59f4881cc9125f6b148afe2cbc269a636df620b6bab72ce20b6b265c73074b1afef1029aecd884dc1dbb2694c0d16d9
AUX bluez-5.39-systemd-quote.patch 1298 BLAKE2B c06a96ffee4f40d574765f7f5b58ba3544fe9862bf4d64d45be0dcbfe1446cb8cdca150402e44117f44b973d7041fd66f01088d843d35d0d6538ccf169551923 SHA512 a31a93934b3ad5d55633ab8ac0878f3cd8bda0ca7836a8912b444f88fe8c71183d25a6e3f36d962cc68da6d2776837b4bf660efb17d379c4003a092c313e69ba
AUX bluez-5.50-btpclient-header.patch 345 BLAKE2B 0418270a696b9a682a3f74f35af64152fbf005dd3abf0230b03d673632f2e5a8b2874c11b9adbfd1733fb601eb5aea02da9028894041e200f99121e41dff855a SHA512 eba5462c20a37905ab8491b6812cd5dd8229280a56fcf24b3a2624a871d14a0377697f93588d02fa03ed422f953072109ea76b544173b97d874b9190de060a97
AUX bluez-5.50-sink-connect.patch 2275 BLAKE2B ae03cc1c04774867d72602735554cdb377f3aa25165cd6a681a1996d30a9d0c51463d3d2a366049840ced9d805c1c3827ceaa69d619b5357fb21c1a708950064 SHA512 7fbb45e37b842cc6e8bbc98f19d5582c697c01c42000deacee6ea5554699669bd5ec23acba33cff994edd2b7d2865274905e074117b9a04334e9670bc8d6a386
AUX bluez-plugdev.patch 469 BLAKE2B 611a9971e4614ab32ab62e8d2dc23e4a98b59c02ad8303ed0dc10831ab9023665436cfa9c47f8ccab7f83ab2b46ca8369ce53c5084ba7bf649c3ea89779882af SHA512 b7e23b6f52e6f638e6d5deed4e901136c40bc1cbfb302ada8d85873e1792b4e3605802a2c5f786d5d6d53bf4651fc5b611396aaafe5eff90578650c448a5a7a2
AUX bluez-udevadm-path-r1.patch 564 BLAKE2B 0b4dc12f55ab60d254aa3365baf35186a5913026dbfcbc3da41c113b3c423c81189b87016dabcb2c505b684cad376d10d10df9aa17558b8fd022928995931e0e SHA512 d9b0dd452258e425802cf5ad4980a77796be79e94bf6ce641927c5ab7ea1117ce6589063f3a0b96bf25e81303234279a09d58484fec49cfc6aa1db46f245f9c6
AUX bluez-udevadm-path.patch 568 BLAKE2B 7c9d6fad4779cec9ee110c9f0723fe669e5990750674cfdf6fd7395db3c0bf4520f4d81896d802cf62a25d1abbf46784f09c581a1fb0b72ef8a27131d4cf65d8 SHA512 a1af572809ec71a1796ec66fa1d2fcea6fb7624bdb9a629791707b182310bf41d1a109cc19e0fe034f4b4ae5e5816d809ece2eb4410e7f47827ec1b86c82b3a1
+AUX btattach-bcm-service.sh 935 BLAKE2B cae7d78269b56038883ff74ddc7c5a3238fe4399a37cbba5c414d0396f2aff7c2a4965b56a1125dc8568e7bc848011106ab993e4c1211e704f485259373ab65a SHA512 259d10df16f4b23364da971063345b25cbf7c6a1b9f2576d3ecbd48620675392601cba017a591af1f44fe8eff8ea0c8cabeafa8adbddeb3e1014f428d37d1690
+AUX btattach-bcm_at.service 132 BLAKE2B 0af9a066a8d08d917fe80676f460297e244152d88ee02774b1e30c50febdb3fa9838c3818b80fbbf9248020dce4e1e33e2babf15a18609fddc1fd61465ecb6ed SHA512 ca6c89a676386cdaad6bfdd8a80062abe217ebd2b4484a125e4b5d0832b2c03ebed986f1806ff785664c99e1244bc164f1d152e5015fc87e46f2f6d847567b29
DIST bluez-5.50-fedora-backports.tar.xz 32232 BLAKE2B 35244036bbe18481e32bef2dcd4a223d44442ce28cee85a3a736bfbf5ee9d74372fa6366dc1102bf86babada608966a8c30b1c2537859a3741c289cabbc76026 SHA512 6d33e8bc67e50dc0d4cee3fa080402a51ddc8b6549f19b6c272de7dc51604eab23f909322f01aaca8a834abdc3cfd0bf24bb8623071af0cf0611d7427c9d8e9a
DIST bluez-5.50.tar.xz 1755384 BLAKE2B d70763a80fa233cd31fbefc44f73ffceb54c2d7b64ee83df0d2dafb039771d2b18e69dd44b35b2cdf8eee97553c02deca2281f7ec54e958218cf6c4b364a8516 SHA512 64a680e4b3c270bc2439610c91ad2aef36131d84401e4bbdf6c2b7ec8708a19dfc942b31b9189c38a97ca072c761c669ae1aace5f4ff5d06de3ccbf33184be45
-EBUILD bluez-5.50-r2.ebuild 8152 BLAKE2B 9a5973bb8fade0c504fcbc425d79c895a4c86122b4eb91fd77b03a8b11f3db70dd72a264c82e2f3c8b13a89d2e54b6bad51b3b257665f30ad9c4878ee9c3f8c6 SHA512 c22e0b7230c3b8ec1c30eb6b1df3e2323379aa453206afebb146338c60a8e695f37b2dc4778a733262fa9068664a4e07f5f8cd26347d758384f047fd8201d0fa
-EBUILD bluez-5.50-r3.ebuild 7990 BLAKE2B a909e6b969f90d3602db76fbf1614df14507cce2ca6b131f36fd5617033083b7a7fbe3f97bf315d85d9438b9b5f30d5ed82f1ad2601707378c19204af3f85ebc SHA512 b0d65fa1383bbb03dfa5db4c5b24880ddace37b200bb00fd68c49d3609c6505b4f502fdaab0d56576b05f4f75278372932de98f70b00f11c9ba26e317d911ceb
+DIST bluez-5.51.tar.xz 1941904 BLAKE2B e8580388961c99305c6f723160e726232a097067815a88a056c1569c55c2ea410004cf92572afbef9b782807d8a940503b4501f9c6046cacac35136fbbe580a8 SHA512 8b14eea98f541b981162abce728e0f917654ad3c990721ec398fe41bdd68069fe55ff64b61bc3c3b9f813facf42c995b07619f6d5d153965de27154b1a7b578f
+EBUILD bluez-5.50-r3.ebuild 8001 BLAKE2B 53a60e148a3db4c9eaff57ea07b0b1b5d12fb758e520569d0e553c28006826fe855771a2dd8e36ce32a5fb2c8e5002ff8a670e3cfe7e5ef7f70420c17b129db2 SHA512 6e9937151b6514d2ddb34426400a4f4a96c983b0996588bc3b82073e188c34419f70a1d78bbb34d68ac8e7d369fa111a9e5c27647b3cb6322fe0123803afb0a1
+EBUILD bluez-5.51.ebuild 9082 BLAKE2B 1e5ba81fa700f4fc6ae4aa538d4113f36852ea3f890777e05d3d61ad99d3def6eb00be9f789529f555f21e9d83818c2f2d3c0e5e42ec1ac93db40af2b46a3aad SHA512 81fbae889430f555b3d208529abddb5214565ca34de56e68418a0806487237ac2b151ef7c37b55fc7a889d0724ff3990b98a128a257ab097c51fa0dce76b69e2
MISC metadata.xml 1211 BLAKE2B 5e605af395041afd8b790d21b33b816ce3b960458375d51243e8a763302ce1fdc69da2ffd119966c88c261f3e13fd9b48241c2955eebc78d64da887599bb9830 SHA512 c35cd78b8f49fe1142f2ae203571e558a8d45d435eeb7a5e57260192869658d5c39c4f671f99225cdb1530309a7bdea37d572522d8fe9d5354b1e25f5ffd556f
diff --git a/net-wireless/bluez/bluez-5.50-r3.ebuild b/net-wireless/bluez/bluez-5.50-r3.ebuild
index c590e2ced4dd..e6f8139acd8a 100644
--- a/net-wireless/bluez/bluez-5.50-r3.ebuild
+++ b/net-wireless/bluez/bluez-5.50-r3.ebuild
@@ -9,7 +9,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://www.kernel.org/pub/linux/bluetooth/${P}.tar.xz
https://dev.gentoo.org/~pacho/${PN}/${P}-fedora-backports.tar.xz
"
diff --git a/net-wireless/bluez/bluez-5.50-r2.ebuild b/net-wireless/bluez/bluez-5.51.ebuild
index 4c335870096f..00a51cb60471 100644
--- a/net-wireless/bluez/bluez-5.50-r2.ebuild
+++ b/net-wireless/bluez/bluez-5.51.ebuild
@@ -2,18 +2,18 @@
# 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"
+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="alsa btpclient cups doc debug deprecated extra-tools experimental +mesh +obex +readline selinux systemd test test-programs +udev user-session"
+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
@@ -35,14 +35,14 @@ BDEPEND="
DEPEND="
>=dev-libs/glib-2.28:2[${MULTILIB_USEDEP}]
>=sys-apps/hwids-20121202.2
- alsa? ( media-libs/alsa-lib )
- btpclient? ( >=dev-libs/ell-0.3 )
+ btpclient? ( >=dev-libs/ell-0.14 )
cups? ( net-print/cups:= )
mesh? (
- >=dev-libs/ell-0.3
+ >=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? (
@@ -53,26 +53,17 @@ DEPEND="
udev? ( >=virtual/udev-172 )
"
RDEPEND="${DEPEND}
- acct-group/plugdev
selinux? ( sec-policy/selinux-bluetooth )
test-programs? ( ${TEST_DEPS} )
"
-DOC_CONTENTS="
- If you want to control your bluetooth devices as a non-root user,
- please remember to add you to plugdev group.
-"
-PATCHES=(
- # Fix missing header (fixed in 'master')
- "${FILESDIR}"/${P}-btpclient-header.patch
-
- # Use static group "plugdev" to not force people to become root for
- # controlling the devices.
- "${FILESDIR}"/${PN}-plugdev.patch
+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
- "${FILESDIR}"/${PN}-udevadm-path.patch
+ # 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
@@ -81,9 +72,6 @@ PATCHES=(
# 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() {
@@ -105,7 +93,7 @@ src_prepare() {
# http://www.spinics.net/lists/linux-bluetooth/msg38490.html
if ! use user-session || ! use systemd; then
- eapply "${FILESDIR}"/0001-Allow-using-obexd-without-systemd-in-the-user-sessio.patch
+ eapply "${FILESDIR}"/0001-Allow-using-obexd-without-systemd-in-the-user-session-r1.patch
fi
if use cups; then
@@ -115,6 +103,7 @@ src_prepare() {
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
@@ -152,12 +141,14 @@ multilib_src_configure() {
--enable-monitor \
--with-systemdsystemunitdir="$(systemd_get_systemunitdir)" \
--with-systemduserunitdir="$(systemd_get_userunitdir)" \
- $(multilib_native_use_enable alsa midi) \
$(multilib_native_use_enable btpclient) \
+ $(multilib_native_use_enable 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) \
@@ -198,9 +189,14 @@ multilib_src_install() {
# 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
- dobin tools/btmgmt
+ # https://bugzilla.redhat.com/show_bug.cgi?id=1699680
+ dobin tools/avinfo
fi
# Not installed by default after being built, bug #666756
@@ -208,20 +204,22 @@ multilib_src_install() {
# 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
+ # 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-pkgincludeHEADERS \
install-libLTLIBRARIES \
install-pkgconfigDATA
fi
@@ -240,7 +238,7 @@ multilib_src_install_all() {
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
+ find "${D}" -name '*.la' -type f -delete || die
keepdir /var/lib/bluetooth
@@ -251,20 +249,37 @@ multilib_src_install_all() {
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
- ! use systemd && readme.gentoo_create_doc
+ # 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 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."
+ has_version net-dialup/ppp || elog "To use dial up networking you must install net-dialup/ppp"
+ use mesh && readme.gentoo_print_elog
}
diff --git a/net-wireless/bluez/files/0001-Allow-using-obexd-without-systemd-in-the-user-session-r1.patch b/net-wireless/bluez/files/0001-Allow-using-obexd-without-systemd-in-the-user-session-r1.patch
new file mode 100644
index 000000000000..dec93073e18a
--- /dev/null
+++ b/net-wireless/bluez/files/0001-Allow-using-obexd-without-systemd-in-the-user-session-r1.patch
@@ -0,0 +1,58 @@
+From 3027cb7141fb65cf3eeda69c688db8c4045e2d3f Mon Sep 17 00:00:00 2001
+From: Giovanni Campagna <gcampagna-cNUdlRotFMnNLxjTenLetw@public.gmane.org>
+Date: Sat, 12 Oct 2013 17:45:25 +0200
+Subject: [PATCH] Allow using obexd without systemd in the user session
+
+Not all sessions run systemd --user (actually, the majority
+doesn't), so the dbus daemon must be able to spawn obexd
+directly, and to do so it needs the full path of the daemon.
+---
+ Makefile.obexd | 4 ++--
+ obexd/src/org.bluez.obex.service | 4 ----
+ obexd/src/org.bluez.obex.service.in | 4 ++++
+ 3 files changed, 6 insertions(+), 6 deletions(-)
+ delete mode 100644 obexd/src/org.bluez.obex.service
+ create mode 100644 obexd/src/org.bluez.obex.service.in
+
+diff --git a/Makefile.obexd b/Makefile.obexd
+index 3760867..142e7c3 100644
+--- a/Makefile.obexd
++++ b/Makefile.obexd
+@@ -2,12 +2,12 @@
+ if SYSTEMD
+ systemduserunitdir = $(SYSTEMD_USERUNITDIR)
+ systemduserunit_DATA = obexd/src/obex.service
++endif
+
+ dbussessionbusdir = $(DBUS_SESSIONBUSDIR)
+ dbussessionbus_DATA = obexd/src/org.bluez.obex.service
+-endif
+
+-EXTRA_DIST += obexd/src/obex.service.in obexd/src/org.bluez.obex.service
++EXTRA_DIST += obexd/src/obex.service.in obexd/src/org.bluez.obex.service.in
+
+ obex_plugindir = $(libdir)/obex/plugins
+
+diff --git a/obexd/src/org.bluez.obex.service b/obexd/src/org.bluez.obex.service
+deleted file mode 100644
+index a538088..0000000
+--- a/obexd/src/org.bluez.obex.service
++++ /dev/null
+@@ -1,4 +0,0 @@
+-[D-BUS Service]
+-Name=org.bluez.obex
+-Exec=/bin/false
+-SystemdService=dbus-org.bluez.obex.service
+diff --git a/obexd/src/org.bluez.obex.service.in b/obexd/src/org.bluez.obex.service.in
+new file mode 100644
+index 0000000..9c815f2
+--- /dev/null
++++ b/obexd/src/org.bluez.obex.service.in
+@@ -0,0 +1,4 @@
++[D-BUS Service]
++Name=org.bluez.obex
++Exec=@libexecdir@/obexd
++SystemdService=dbus-org.bluez.obex.service
+--
+1.8.3.1
+
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 000000000000..dfe8d1e785c8
--- /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
index 97cf500008e0..e69c66867fa0 100755..100644
--- 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 000000000000..c7f8b1784679
--- /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 000000000000..1e7c7dbe582e
--- /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