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