Gentoo Archives: gentoo-commits

From: Pacho Ramos <pacho@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-wireless/bluez/
Date: Wed, 11 Mar 2020 15:05:11
Message-Id: 1583939087.eb5b9e0040ae2ed733dedbf282801136fe368aeb.pacho@gentoo
1 commit: eb5b9e0040ae2ed733dedbf282801136fe368aeb
2 Author: Pacho Ramos <pacho <AT> gentoo <DOT> org>
3 AuthorDate: Wed Mar 11 15:04:47 2020 +0000
4 Commit: Pacho Ramos <pacho <AT> gentoo <DOT> org>
5 CommitDate: Wed Mar 11 15:04:47 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=eb5b9e00
7
8 net-wireless/bluez: Version bump to 5.53
9
10 Also check for needed kernel options for regular bluetooth usage and test
11 suite. Use python3.
12
13 Thanks-to: Joakim Tjernlund
14 Closes: https://bugs.gentoo.org/711430
15 Closes: https://bugs.gentoo.org/618548
16 Package-Manager: Portage-2.3.93, Repoman-2.3.20
17 Signed-off-by: Pacho Ramos <pacho <AT> gentoo.org>
18
19 net-wireless/bluez/Manifest | 1 +
20 net-wireless/bluez/bluez-5.53.ebuild | 294 +++++++++++++++++++++++++++++++++++
21 2 files changed, 295 insertions(+)
22
23 diff --git a/net-wireless/bluez/Manifest b/net-wireless/bluez/Manifest
24 index ec45687f7a0..b185cc971bb 100644
25 --- a/net-wireless/bluez/Manifest
26 +++ b/net-wireless/bluez/Manifest
27 @@ -1 +1,2 @@
28 DIST bluez-5.52.tar.xz 1957504 BLAKE2B 670cdfb44eca1b184c0bd678bab34116f9172394b86fb69fa454f7bdcc1ae82c466a806879ddef96dddd6ae6cd31466b48f9e87113d43144659ae0c057b9def8 SHA512 9024481910d1dee85578bf3d7a4fc4be2bece516e6216c91aa1a7ac18537f092b47c41c4a5506ddd7e279599d58002e98203c5439745c01df4dbc22a75234c84
29 +DIST bluez-5.53.tar.xz 1997504 BLAKE2B 921ab4ae18ab1827e870eb6f6f20c247e7855ba090e47659d283abadc280a5f66966a387b85e43487abf14fd4d4382d8337e46fec3400d0be5201b9ff7635dde SHA512 62956e6293ec2517ec453dc7a6c82d34a8c446df8add8fe411b0a45fd5604817f3a19fbc646ad6f68df435f3cd2bd10ae040890e30db83b022f90b54cc6b3c74
30
31 diff --git a/net-wireless/bluez/bluez-5.53.ebuild b/net-wireless/bluez/bluez-5.53.ebuild
32 new file mode 100644
33 index 00000000000..6535d303da2
34 --- /dev/null
35 +++ b/net-wireless/bluez/bluez-5.53.ebuild
36 @@ -0,0 +1,294 @@
37 +# Copyright 1999-2020 Gentoo Authors
38 +# Distributed under the terms of the GNU General Public License v2
39 +
40 +EAPI=7
41 +PYTHON_COMPAT=( python3_{6,7,8} )
42 +
43 +inherit autotools linux-info python-single-r1 readme.gentoo-r1 systemd udev multilib-minimal
44 +
45 +DESCRIPTION="Bluetooth Tools and System Daemons for Linux"
46 +HOMEPAGE="http://www.bluez.org"
47 +SRC_URI="https://www.kernel.org/pub/linux/bluetooth/${P}.tar.xz"
48 +
49 +LICENSE="GPL-2+ LGPL-2.1+"
50 +SLOT="0/3"
51 +KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~mips ~ppc ~ppc64 ~x86"
52 +IUSE="btpclient cups doc debug deprecated extra-tools experimental +mesh midi +obex +readline selinux systemd test test-programs +udev user-session"
53 +
54 +# Since this release all remaining extra-tools need readline support, but this could
55 +# change in the future, hence, this REQUIRED_USE constraint could be dropped
56 +# again in the future.
57 +REQUIRED_USE="
58 + extra-tools? ( deprecated readline )
59 + test? ( ${PYTHON_REQUIRED_USE} )
60 + test-programs? ( ${PYTHON_REQUIRED_USE} )
61 +"
62 +
63 +TEST_DEPS="${PYTHON_DEPS}
64 + $(python_gen_cond_dep '
65 + >=dev-python/dbus-python-1[${PYTHON_MULTI_USEDEP}]
66 + dev-python/pygobject:3[${PYTHON_MULTI_USEDEP}]
67 + ')
68 +"
69 +BDEPEND="
70 + virtual/pkgconfig
71 + test? ( ${TEST_DEPS} )
72 +"
73 +DEPEND="
74 + >=dev-libs/glib-2.28:2[${MULTILIB_USEDEP}]
75 + >=sys-apps/hwids-20121202.2
76 + btpclient? ( >=dev-libs/ell-0.28 )
77 + cups? ( net-print/cups:= )
78 + mesh? (
79 + >=dev-libs/ell-0.28
80 + >=dev-libs/json-c-0.13:=
81 + sys-libs/readline:0=
82 + )
83 + midi? ( media-libs/alsa-lib )
84 + obex? ( dev-libs/libical:= )
85 + readline? ( sys-libs/readline:0= )
86 + systemd? (
87 + >=sys-apps/dbus-1.6:=[user-session=]
88 + sys-apps/systemd
89 + )
90 + !systemd? ( >=sys-apps/dbus-1.6:= )
91 + udev? ( >=virtual/udev-172 )
92 +"
93 +RDEPEND="${DEPEND}
94 + selinux? ( sec-policy/selinux-bluetooth )
95 + test-programs? ( ${TEST_DEPS} )
96 +"
97 +
98 +RESTRICT="!test? ( test )"
99 +
100 +PATCHES=(
101 + # Try both udevadm paths to cover udev/systemd vs. eudev locations (#539844)
102 + # http://www.spinics.net/lists/linux-bluetooth/msg58739.html
103 + # https://bugs.gentoo.org/539844
104 + "${FILESDIR}"/${PN}-udevadm-path-r1.patch
105 +
106 + # Fedora patches
107 + # http://www.spinics.net/lists/linux-bluetooth/msg40136.html
108 + "${FILESDIR}"/0001-obex-Use-GLib-helper-function-to-manipulate-paths.patch
109 +)
110 +
111 +pkg_setup() {
112 + # From http://www.linuxfromscratch.org/blfs/view/svn/general/bluez.html
113 + # to prevent bugs like:
114 + # https://bugzilla.kernel.org/show_bug.cgi?id=196621
115 + CONFIG_CHECK="~NET ~BT ~BT_RFCOMM ~BT_RFCOMM_TTY ~BT_BNEP ~BT_BNEP_MC_FILTER
116 + ~BT_BNEP_PROTO_FILTER ~BT_HIDP ~RFKILL"
117 + if use test; then
118 + CONFIG_CHECK="${CONFIG_CHECK} ~CRYPTO ~CRYPTO_USER_API_HASH ~CRYPTO_USER_API_SKCIPHER"
119 + fi
120 + linux-info_pkg_setup
121 +
122 + if use test || use test-programs; then
123 + python-single-r1_pkg_setup
124 + fi
125 +
126 + if ! use udev; then
127 + ewarn
128 + ewarn "You are installing ${PN} with USE=-udev. This means various bluetooth"
129 + ewarn "devices and adapters from Apple, Dell, Logitech etc. will not work,"
130 + ewarn "and hid2hci will not be available."
131 + ewarn
132 + fi
133 +}
134 +
135 +src_prepare() {
136 + default
137 +
138 + # http://www.spinics.net/lists/linux-bluetooth/msg38490.html
139 + if ! use user-session || ! use systemd; then
140 + eapply "${FILESDIR}"/0001-Allow-using-obexd-without-systemd-in-the-user-session-r2.patch
141 + fi
142 +
143 + if use cups; then
144 + sed -i \
145 + -e "s:cupsdir = \$(libdir)/cups:cupsdir = $(cups-config --serverbin):" \
146 + Makefile.{in,tools} || die
147 + fi
148 +
149 + # Broken test: https://bugzilla.kernel.org/show_bug.cgi?id=206815
150 + # https://bugs.gentoo.org/704190
151 + sed -i -e '/unit_tests += unit\/test-mesh-crypto\b/d' Makefile.am || die
152 +
153 + eautoreconf
154 +
155 + multilib_copy_sources
156 +}
157 +
158 +multilib_src_configure() {
159 + local myconf=(
160 + # readline is automagic when client is enabled
161 + # --enable-client always needs readline, bug #504038
162 + # --enable-mesh is handled in the same way
163 + ac_cv_header_readline_readline_h=$(multilib_native_usex readline)
164 + ac_cv_header_readline_readline_h=$(multilib_native_usex mesh)
165 + )
166 +
167 + if ! multilib_is_native_abi; then
168 + myconf+=(
169 + # deps not used for the library
170 + {DBUS,GLIB}_{CFLAGS,LIBS}=' '
171 + )
172 + fi
173 +
174 + econf \
175 + --localstatedir=/var \
176 + --disable-android \
177 + --enable-datafiles \
178 + --enable-optimization \
179 + $(use_enable debug) \
180 + --enable-pie \
181 + --enable-threads \
182 + --enable-library \
183 + --enable-tools \
184 + --enable-manpages \
185 + --enable-monitor \
186 + --with-systemdsystemunitdir="$(systemd_get_systemunitdir)" \
187 + --with-systemduserunitdir="$(systemd_get_userunitdir)" \
188 + $(multilib_native_use_enable btpclient) \
189 + $(multilib_native_use_enable btpclient external-ell) \
190 + $(multilib_native_use_enable cups) \
191 + $(multilib_native_use_enable deprecated) \
192 + $(multilib_native_use_enable experimental) \
193 + $(multilib_native_use_enable mesh) \
194 + $(multilib_native_use_enable mesh external-ell) \
195 + $(multilib_native_use_enable midi) \
196 + $(multilib_native_use_enable obex) \
197 + $(multilib_native_use_enable readline client) \
198 + $(multilib_native_use_enable systemd) \
199 + $(multilib_native_use_enable test-programs test) \
200 + $(multilib_native_use_enable udev) \
201 + $(multilib_native_use_enable udev sixaxis)
202 +}
203 +
204 +multilib_src_compile() {
205 + if multilib_is_native_abi; then
206 + default
207 + else
208 + emake -f Makefile -f - libs \
209 + <<<'libs: $(lib_LTLIBRARIES)'
210 + fi
211 +}
212 +
213 +multilib_src_test() {
214 + multilib_is_native_abi && default
215 +}
216 +
217 +multilib_src_install() {
218 + if multilib_is_native_abi; then
219 + emake DESTDIR="${D}" install
220 +
221 + # Only install extra-tools when relevant USE flag is enabled
222 + if use extra-tools; then
223 + ewarn "Upstream doesn't support using this tools and their bugs are"
224 + ewarn "likely to be ignored forever, also that tools can break"
225 + ewarn "without previous announcement."
226 + ewarn "Upstream also states all this tools are not really needed,"
227 + ewarn "then, if you still need to rely on them, you must ask them"
228 + ewarn "to either install that tool by default or add the needed"
229 + ewarn "functionality to the existing 'official' tools."
230 + ewarn "Please report this issues to:"
231 + ewarn "http://www.bluez.org/development/lists/"
232 +
233 + # Upstream doesn't install this, bug #524640
234 + # http://permalink.gmane.org/gmane.linux.bluez.kernel/53115
235 + # http://comments.gmane.org/gmane.linux.bluez.kernel/54564
236 + dobin tools/btmgmt
237 + # gatttool is only built with readline, bug #530776
238 + # https://bugzilla.redhat.com/show_bug.cgi?id=1141909
239 + # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=720486
240 + # https://bugs.archlinux.org/task/37686
241 + dobin attrib/gatttool
242 + # https://bugzilla.redhat.com/show_bug.cgi?id=1699680
243 + dobin tools/avinfo
244 + fi
245 +
246 + # Not installed by default after being built, bug #666756
247 + use btpclient && dobin tools/btpclient
248 +
249 + # Unittests are not that useful once installed, so make them optional
250 + if use test-programs; then
251 + # Drop python2 only test tools
252 + # https://bugzilla.kernel.org/show_bug.cgi?id=206819
253 + rm "${ED}"/usr/$(get_libdir)/bluez/test/simple-player || die
254 + # https://bugzilla.kernel.org/show_bug.cgi?id=206821
255 + rm "${ED}"/usr/$(get_libdir)/bluez/test/test-hfp || die
256 + # https://bugzilla.kernel.org/show_bug.cgi?id=206823
257 + rm "${ED}"/usr/$(get_libdir)/bluez/test/test-sap-server || die
258 +
259 + python_fix_shebang "${ED}"/usr/$(get_libdir)/bluez/test
260 +
261 + for i in $(find "${ED}"/usr/$(get_libdir)/bluez/test -maxdepth 1 -type f ! -name "*.*"); do
262 + dosym "${i}" /usr/bin/bluez-"${i##*/}"
263 + done
264 + fi
265 + else
266 + emake DESTDIR="${D}" \
267 + install-pkgincludeHEADERS \
268 + install-libLTLIBRARIES \
269 + install-pkgconfigDATA
270 + fi
271 +}
272 +
273 +multilib_src_install_all() {
274 + # We need to ensure obexd can be spawned automatically by systemd
275 + # when user-session is enabled:
276 + # http://marc.info/?l=linux-bluetooth&m=148096094716386&w=2
277 + # https://bugs.gentoo.org/show_bug.cgi?id=577842
278 + # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=804908
279 + # https://bugs.archlinux.org/task/45816
280 + # https://bugzilla.redhat.com/show_bug.cgi?id=1318441
281 + # https://bugzilla.redhat.com/show_bug.cgi?id=1389347
282 + if use user-session && use systemd; then
283 + ln -s "${ED}"/usr/lib/systemd/user/obex.service "${ED}"/usr/lib/systemd/user/dbus-org.bluez.obex.service
284 + fi
285 +
286 + find "${D}" -name '*.la' -type f -delete || die
287 +
288 + keepdir /var/lib/bluetooth
289 +
290 + # Upstream don't want people to play with them
291 + # But we keep installing them due to 'historical' reasons
292 + insinto /etc/bluetooth
293 + local d
294 + for d in input network; do
295 + doins profiles/${d}/${d}.conf
296 + done
297 + # Setup auto enable as Fedora does for allowing to use
298 + # keyboards/mouse as soon as possible
299 + sed -i 's/#\[Policy\]$/\[Policy\]/; s/#AutoEnable=false/AutoEnable=true/' src/main.conf || die
300 + doins src/main.conf
301 +
302 + newinitd "${FILESDIR}"/bluetooth-init.d-r4 bluetooth
303 +
304 + einstalldocs
305 + use doc && dodoc doc/*.txt
306 + # Install .json files as examples to be used by meshctl
307 + if use mesh; then
308 + dodoc tools/mesh-gatt/*.json
309 + local DOC_CONTENTS="Some example .json files were installed into
310 + /usr/share/doc/${PF} to be used with meshctl. Feel free to
311 + uncompress and copy them to ~/.config/meshctl to use them."
312 + readme.gentoo_create_doc
313 + fi
314 +
315 + # From Fedora:
316 + # Scripts for automatically btattach-ing serial ports connected to Broadcom HCIs
317 + # as found on some Atom based x86 hardware
318 + udev_dorules "${FILESDIR}/69-btattach-bcm.rules"
319 + systemd_newunit "${FILESDIR}/btattach-bcm_at.service" "btattach-bcm@.service"
320 + exeinto /usr/libexec/bluetooth
321 + doexe "${FILESDIR}/btattach-bcm-service.sh"
322 +}
323 +
324 +pkg_postinst() {
325 + use udev && udev_reload
326 + systemd_reenable bluetooth.service
327 +
328 + has_version net-dialup/ppp || elog "To use dial up networking you must install net-dialup/ppp"
329 + use mesh && readme.gentoo_print_elog
330 +}