Gentoo Archives: gentoo-commits

From: Andreas Sturmlechner <asturm@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: media-sound/pulseaudio/, media-sound/pulseaudio/files/
Date: Sat, 02 Jun 2018 17:09:06
Message-Id: 1527959196.2f89fbb0b4966952ac0f89717c915f1b4b94c0e2.asturm@gentoo
1 commit: 2f89fbb0b4966952ac0f89717c915f1b4b94c0e2
2 Author: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
3 AuthorDate: Mon May 28 22:14:21 2018 +0000
4 Commit: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
5 CommitDate: Sat Jun 2 17:06:36 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2f89fbb0
7
8 media-sound/pulseaudio: Port to Qt5
9
10 Bug: https://bugs.gentoo.org/656704
11 Package-Manager: Portage-2.3.40, Repoman-2.3.9
12
13 .../files/pulseaudio-11.1-qpaeq-pyqt5-1.patch | 198 ++++++++++++
14 .../files/pulseaudio-11.1-qpaeq-pyqt5-2.patch | 31 ++
15 media-sound/pulseaudio/pulseaudio-11.1-r1.ebuild | 360 +++++++++++++++++++++
16 3 files changed, 589 insertions(+)
17
18 diff --git a/media-sound/pulseaudio/files/pulseaudio-11.1-qpaeq-pyqt5-1.patch b/media-sound/pulseaudio/files/pulseaudio-11.1-qpaeq-pyqt5-1.patch
19 new file mode 100644
20 index 00000000000..62012c12147
21 --- /dev/null
22 +++ b/media-sound/pulseaudio/files/pulseaudio-11.1-qpaeq-pyqt5-1.patch
23 @@ -0,0 +1,198 @@
24 +From: =?utf-8?q?Andrius_=C5=A0tikonas?= <andrius@××××××××.eu>
25 +Date: Mon, 20 Nov 2017 19:56:53 +0000
26 +Subject: qpaeq: port to PyQt5
27 +
28 +(cherry picked from commit 480e0e74f43565d7ece72141666961ae8cc2ed75)
29 +---
30 + src/utils/qpaeq | 68 ++++++++++++++++++++++++++++-----------------------------
31 + 1 file changed, 34 insertions(+), 34 deletions(-)
32 +
33 +diff --git a/src/utils/qpaeq b/src/utils/qpaeq
34 +index ac4b9e4..508b233 100755
35 +--- a/src/utils/qpaeq
36 ++++ b/src/utils/qpaeq
37 +@@ -18,13 +18,13 @@
38 +
39 + import os,math,sys
40 + try:
41 +- import PyQt4,sip
42 +- from PyQt4 import QtGui,QtCore
43 ++ import PyQt5,sip
44 ++ from PyQt5 import QtWidgets,QtCore
45 + import dbus.mainloop.qt
46 + import dbus
47 + except ImportError as e:
48 + sys.stderr.write('There was an error importing needed libraries\n'
49 +- 'Make sure you have qt4 and dbus-python installed\n'
50 ++ 'Make sure you have qt5 and dbus-python installed\n'
51 + 'The error that occured was:\n'
52 + '\t%s\n' % (str(e)))
53 + sys.exit(-1)
54 +@@ -62,7 +62,7 @@ def connect():
55 + prop_iface='org.freedesktop.DBus.Properties'
56 + eq_iface='org.PulseAudio.Ext.Equalizing1.Equalizer'
57 + device_iface='org.PulseAudio.Core1.Device'
58 +-class QPaeq(QtGui.QWidget):
59 ++class QPaeq(QtWidgets.QWidget):
60 + manager_path='/org/pulseaudio/equalizing1'
61 + manager_iface='org.PulseAudio.Ext.Equalizing1.Manager'
62 + core_iface='org.PulseAudio.Core1'
63 +@@ -70,7 +70,7 @@ class QPaeq(QtGui.QWidget):
64 + module_name='module-equalizer-sink'
65 +
66 + def __init__(self):
67 +- QtGui.QWidget.__init__(self)
68 ++ QtWidgets.QWidget.__init__(self)
69 + self.setWindowTitle('qpaeq')
70 + self.slider_widget=None
71 + self.sink_name=None
72 +@@ -84,50 +84,50 @@ class QPaeq(QtGui.QWidget):
73 + self.setMinimumSize(self.sizeHint())
74 +
75 + def create_layout(self):
76 +- self.main_layout=QtGui.QVBoxLayout()
77 ++ self.main_layout=QtWidgets.QVBoxLayout()
78 + self.setLayout(self.main_layout)
79 +- toprow_layout=QtGui.QHBoxLayout()
80 +- sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Fixed)
81 ++ toprow_layout=QtWidgets.QHBoxLayout()
82 ++ sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Fixed)
83 + sizePolicy.setHorizontalStretch(0)
84 + sizePolicy.setVerticalStretch(0)
85 + #sizePolicy.setHeightForWidth(self.profile_box.sizePolicy().hasHeightForWidth())
86 +
87 +- toprow_layout.addWidget(QtGui.QLabel('Sink'))
88 +- self.sink_box = QtGui.QComboBox()
89 ++ toprow_layout.addWidget(QtWidgets.QLabel('Sink'))
90 ++ self.sink_box = QtWidgets.QComboBox()
91 + self.sink_box.setSizePolicy(sizePolicy)
92 + self.sink_box.setDuplicatesEnabled(False)
93 +- self.sink_box.setInsertPolicy(QtGui.QComboBox.InsertAlphabetically)
94 +- #self.sink_box.setSizeAdjustPolicy(QtGui.QComboBox.AdjustToContents)
95 ++ self.sink_box.setInsertPolicy(QtWidgets.QComboBox.InsertAlphabetically)
96 ++ #self.sink_box.setSizeAdjustPolicy(QtWidgets.QComboBox.AdjustToContents)
97 + toprow_layout.addWidget(self.sink_box)
98 +
99 +- toprow_layout.addWidget(QtGui.QLabel('Channel'))
100 +- self.channel_box = QtGui.QComboBox()
101 ++ toprow_layout.addWidget(QtWidgets.QLabel('Channel'))
102 ++ self.channel_box = QtWidgets.QComboBox()
103 + self.channel_box.setSizePolicy(sizePolicy)
104 + toprow_layout.addWidget(self.channel_box)
105 +
106 +- toprow_layout.addWidget(QtGui.QLabel('Preset'))
107 +- self.profile_box = QtGui.QComboBox()
108 ++ toprow_layout.addWidget(QtWidgets.QLabel('Preset'))
109 ++ self.profile_box = QtWidgets.QComboBox()
110 + self.profile_box.setSizePolicy(sizePolicy)
111 +- self.profile_box.setInsertPolicy(QtGui.QComboBox.InsertAlphabetically)
112 +- #self.profile_box.setSizeAdjustPolicy(QtGui.QComboBox.AdjustToContents)
113 ++ self.profile_box.setInsertPolicy(QtWidgets.QComboBox.InsertAlphabetically)
114 ++ #self.profile_box.setSizeAdjustPolicy(QtWidgets.QComboBox.AdjustToContents)
115 + toprow_layout.addWidget(self.profile_box)
116 +
117 +- large_icon_size=self.style().pixelMetric(QtGui.QStyle.PM_LargeIconSize)
118 ++ large_icon_size=self.style().pixelMetric(QtWidgets.QStyle.PM_LargeIconSize)
119 + large_icon_size=QtCore.QSize(large_icon_size,large_icon_size)
120 +- save_profile=QtGui.QToolButton()
121 +- save_profile.setIcon(self.style().standardIcon(QtGui.QStyle.SP_DriveFDIcon))
122 ++ save_profile=QtWidgets.QToolButton()
123 ++ save_profile.setIcon(self.style().standardIcon(QtWidgets.QStyle.SP_DriveFDIcon))
124 + save_profile.setIconSize(large_icon_size)
125 + save_profile.setToolButtonStyle(QtCore.Qt.ToolButtonIconOnly)
126 + save_profile.clicked.connect(self.save_profile)
127 +- remove_profile=QtGui.QToolButton()
128 +- remove_profile.setIcon(self.style().standardIcon(QtGui.QStyle.SP_TrashIcon))
129 ++ remove_profile=QtWidgets.QToolButton()
130 ++ remove_profile.setIcon(self.style().standardIcon(QtWidgets.QStyle.SP_TrashIcon))
131 + remove_profile.setIconSize(large_icon_size)
132 + remove_profile.setToolButtonStyle(QtCore.Qt.ToolButtonIconOnly)
133 + remove_profile.clicked.connect(self.remove_profile)
134 + toprow_layout.addWidget(save_profile)
135 + toprow_layout.addWidget(remove_profile)
136 +
137 +- reset_button = QtGui.QPushButton('Reset')
138 ++ reset_button = QtWidgets.QPushButton('Reset')
139 + reset_button.clicked.connect(self.reset)
140 + toprow_layout.addStretch()
141 + toprow_layout.addWidget(reset_button)
142 +@@ -192,11 +192,11 @@ class QPaeq(QtGui.QWidget):
143 + def save_profile(self):
144 + #popup dialog box for name
145 + current=self.profile_box.currentIndex()
146 +- profile,ok=QtGui.QInputDialog.getItem(self,'Preset Name','Preset',self.profiles,current)
147 ++ profile,ok=QtWidgets.QInputDialog.getItem(self,'Preset Name','Preset',self.profiles,current)
148 + if not ok or profile=='':
149 + return
150 + if profile in self.profiles:
151 +- mbox=QtGui.QMessageBox(self)
152 ++ mbox=QtWidgets.QMessageBox(self)
153 + mbox.setText('%s preset already exists'%(profile,))
154 + mbox.setInformativeText('Do you want to save over it?')
155 + mbox.setStandardButtons(mbox.Save|mbox.Discard|mbox.Cancel)
156 +@@ -217,7 +217,7 @@ class QPaeq(QtGui.QWidget):
157 + profile=self.profile_box.itemText(x)
158 + self.filter_state.load_profile(profile)
159 + def select_channel(self,x):
160 +- self.filter_state.channel = self.channel_box.itemData(x).toPyObject()
161 ++ self.filter_state.channel = self.channel_box.itemData(x)
162 + self._set_profile_name()
163 + self.filter_state.readback()
164 +
165 +@@ -295,13 +295,13 @@ class QPaeq(QtGui.QWidget):
166 + self.profile_box.blockSignals(False)
167 +
168 +
169 +-class SliderArray(QtGui.QWidget):
170 ++class SliderArray(QtWidgets.QWidget):
171 + def __init__(self,filter_state,parent=None):
172 + super(SliderArray,self).__init__(parent)
173 + #self.setStyleSheet('padding: 0px; border-width: 0px; margin: 0px;')
174 + #self.setStyleSheet('font-family: monospace;'+outline%('blue'))
175 + self.filter_state=filter_state
176 +- self.setLayout(QtGui.QHBoxLayout())
177 ++ self.setLayout(QtWidgets.QHBoxLayout())
178 + self.sub_array=None
179 + self.set_sub_array(SliderArraySub(self.filter_state))
180 + self.inhibit_resize=0
181 +@@ -359,11 +359,11 @@ class SliderArray(QtGui.QWidget):
182 + self.set_sub_array(SliderArraySub(self.filter_state))
183 + self.inhibit_resize-=1
184 +
185 +-class SliderArraySub(QtGui.QWidget):
186 ++class SliderArraySub(QtWidgets.QWidget):
187 + def __init__(self,filter_state,parent=None):
188 + super(SliderArraySub,self).__init__(parent)
189 + self.filter_state=filter_state
190 +- self.setLayout(QtGui.QGridLayout())
191 ++ self.setLayout(QtWidgets.QGridLayout())
192 + self.slider=[None]*len(self.filter_state.frequencies)
193 + self.label=[None]*len(self.slider)
194 + #self.setStyleSheet('padding: 0px; border-width: 0px; margin: 0px;')
195 +@@ -375,7 +375,7 @@ class SliderArraySub(QtGui.QWidget):
196 + self.layout().addWidget(label,1,c,qt.AlignHCenter)
197 + self.layout().setColumnMinimumWidth(c,max(label.sizeHint().width(),slider.sizeHint().width()))
198 + def create_slider(slider_label):
199 +- slider=QtGui.QSlider(QtCore.Qt.Vertical,self)
200 ++ slider=QtWidgets.QSlider(QtCore.Qt.Vertical,self)
201 + label=SliderLabel(slider_label,filter_state,self)
202 + slider.setRange(-1000,2000)
203 + slider.setSingleStep(1)
204 +@@ -461,7 +461,7 @@ class SliderArraySub(QtGui.QWidget):
205 + return int((x-1.0)*1000)
206 + outline='border-width: 1px; border-style: solid; border-color: %s;'
207 +
208 +-class SliderLabel(QtGui.QLabel):
209 ++class SliderLabel(QtWidgets.QLabel):
210 + clicked=QtCore.pyqtSignal()
211 + def __init__(self,label_text,filter_state,parent=None):
212 + super(SliderLabel,self).__init__(parent)
213 +@@ -566,7 +566,7 @@ def subdivide(xs, t_points):
214 +
215 + def main():
216 + dbus.mainloop.qt.DBusQtMainLoop(set_as_default=True)
217 +- app=QtGui.QApplication(sys.argv)
218 ++ app=QtWidgets.QApplication(sys.argv)
219 + qpaeq_main=QPaeq()
220 + qpaeq_main.show()
221 + sys.exit(app.exec_())
222
223 diff --git a/media-sound/pulseaudio/files/pulseaudio-11.1-qpaeq-pyqt5-2.patch b/media-sound/pulseaudio/files/pulseaudio-11.1-qpaeq-pyqt5-2.patch
224 new file mode 100644
225 index 00000000000..7706bfb3416
226 --- /dev/null
227 +++ b/media-sound/pulseaudio/files/pulseaudio-11.1-qpaeq-pyqt5-2.patch
228 @@ -0,0 +1,31 @@
229 +From: Felipe Sateler <fsateler@××××××.org>
230 +Date: Thu, 5 Apr 2018 15:44:26 -0300
231 +Subject: Use the pyqt5 dbus mainloop integration
232 +
233 +Forwarded: https://bugs.freedesktop.org/show_bug.cgi?id=102572
234 +---
235 + src/utils/qpaeq | 4 ++--
236 + 1 file changed, 2 insertions(+), 2 deletions(-)
237 +
238 +diff --git a/src/utils/qpaeq b/src/utils/qpaeq
239 +index 508b233..a319dad 100755
240 +--- a/src/utils/qpaeq
241 ++++ b/src/utils/qpaeq
242 +@@ -20,7 +20,7 @@ import os,math,sys
243 + try:
244 + import PyQt5,sip
245 + from PyQt5 import QtWidgets,QtCore
246 +- import dbus.mainloop.qt
247 ++ import dbus.mainloop.pyqt5
248 + import dbus
249 + except ImportError as e:
250 + sys.stderr.write('There was an error importing needed libraries\n'
251 +@@ -565,7 +565,7 @@ def subdivide(xs, t_points):
252 + return left+right
253 +
254 + def main():
255 +- dbus.mainloop.qt.DBusQtMainLoop(set_as_default=True)
256 ++ dbus.mainloop.pyqt5.DBusQtMainLoop(set_as_default=True)
257 + app=QtWidgets.QApplication(sys.argv)
258 + qpaeq_main=QPaeq()
259 + qpaeq_main.show()
260
261 diff --git a/media-sound/pulseaudio/pulseaudio-11.1-r1.ebuild b/media-sound/pulseaudio/pulseaudio-11.1-r1.ebuild
262 new file mode 100644
263 index 00000000000..f9aee0517a3
264 --- /dev/null
265 +++ b/media-sound/pulseaudio/pulseaudio-11.1-r1.ebuild
266 @@ -0,0 +1,360 @@
267 +# Copyright 1999-2018 Gentoo Foundation
268 +# Distributed under the terms of the GNU General Public License v2
269 +
270 +EAPI=6
271 +
272 +inherit autotools bash-completion-r1 eutils flag-o-matic gnome2-utils linux-info systemd user versionator udev multilib-minimal
273 +
274 +DESCRIPTION="A networked sound server with an advanced plugin system"
275 +HOMEPAGE="https://www.freedesktop.org/wiki/Software/PulseAudio/"
276 +SRC_URI="https://freedesktop.org/software/pulseaudio/releases/${P}.tar.xz"
277 +
278 +# libpulse-simple and libpulse link to libpulse-core; this is daemon's
279 +# library and can link to gdbm and other GPL-only libraries. In this
280 +# cases, we have a fully GPL-2 package. Leaving the rest of the
281 +# GPL-forcing USE flags for those who use them.
282 +# qpaeq equalizer pyqt GUI frontend is AGPL-3+
283 +LICENSE="!gdbm? ( LGPL-2.1 ) gdbm? ( GPL-2 ) equalizer? ( AGPL-3+ )"
284 +
285 +SLOT="0"
286 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~sh ~sparc ~x86 ~amd64-fbsd ~amd64-linux ~x86-linux"
287 +
288 +# +alsa-plugin as discussed in bug #519530
289 +IUSE="+alsa +alsa-plugin +asyncns bluetooth +caps dbus doc equalizer +gdbm +glib
290 +gnome gtk ipv6 jack libsamplerate libressl lirc native-headset neon ofono-headset
291 ++orc oss qt5 realtime selinux sox ssl systemd system-wide tcpd test +udev
292 ++webrtc-aec +X zeroconf"
293 +
294 +# See "*** BLUEZ support not found (requires D-Bus)" in configure.ac
295 +REQUIRED_USE="
296 + bluetooth? ( dbus )
297 + equalizer? ( dbus )
298 + ofono-headset? ( bluetooth )
299 + native-headset? ( bluetooth )
300 + udev? ( || ( alsa oss ) )
301 +"
302 +
303 +# libpcre needed in some cases, bug #472228
304 +RDEPEND="
305 + || (
306 + elibc_glibc? ( virtual/libc )
307 + elibc_uclibc? ( virtual/libc )
308 + dev-libs/libpcre
309 + )
310 + >=media-libs/libsndfile-1.0.20[${MULTILIB_USEDEP}]
311 + X? (
312 + >=x11-libs/libX11-1.4.0[${MULTILIB_USEDEP}]
313 + >=x11-libs/libxcb-1.6[${MULTILIB_USEDEP}]
314 + x11-libs/libSM[${MULTILIB_USEDEP}]
315 + x11-libs/libICE[${MULTILIB_USEDEP}]
316 + x11-libs/libXtst[${MULTILIB_USEDEP}]
317 + )
318 + caps? ( >=sys-libs/libcap-2.22-r2[${MULTILIB_USEDEP}] )
319 + libsamplerate? ( >=media-libs/libsamplerate-0.1.1-r1 )
320 + alsa? ( >=media-libs/alsa-lib-1.0.19 )
321 + glib? ( >=dev-libs/glib-2.4.0:2[${MULTILIB_USEDEP}] )
322 + zeroconf? ( >=net-dns/avahi-0.6.12[dbus] )
323 + jack? ( virtual/jack )
324 + tcpd? ( sys-apps/tcp-wrappers[${MULTILIB_USEDEP}] )
325 + lirc? ( app-misc/lirc )
326 + dbus? ( >=sys-apps/dbus-1.0.0[${MULTILIB_USEDEP}] )
327 + gtk? ( x11-libs/gtk+:3 )
328 + gnome? ( >=gnome-base/gconf-2.4.0 )
329 + bluetooth? (
330 + >=net-wireless/bluez-5
331 + >=sys-apps/dbus-1.0.0
332 + media-libs/sbc
333 + )
334 + asyncns? ( net-libs/libasyncns[${MULTILIB_USEDEP}] )
335 + udev? ( >=virtual/udev-143[hwdb(+)] )
336 + realtime? ( sys-auth/rtkit )
337 + equalizer? ( sci-libs/fftw:3.0 )
338 + ofono-headset? ( >=net-misc/ofono-1.13 )
339 + orc? ( >=dev-lang/orc-0.4.15 )
340 + sox? ( >=media-libs/soxr-0.1.1 )
341 + ssl? (
342 + !libressl? ( dev-libs/openssl:0= )
343 + libressl? ( dev-libs/libressl:= )
344 + )
345 + >=media-libs/speex-1.2.0
346 + media-libs/speexdsp
347 + gdbm? ( sys-libs/gdbm:= )
348 + webrtc-aec? ( >=media-libs/webrtc-audio-processing-0.2 )
349 + systemd? ( sys-apps/systemd:0=[${MULTILIB_USEDEP}] )
350 + dev-libs/libltdl:0
351 + selinux? ( sec-policy/selinux-pulseaudio )
352 +"
353 +# it's a valid RDEPEND, libltdl.so is used for native abi
354 +
355 +DEPEND="${RDEPEND}
356 + sys-devel/m4
357 + doc? ( app-doc/doxygen )
358 + test? ( >=dev-libs/check-0.9.10 )
359 + X? (
360 + x11-base/xorg-proto
361 + >=x11-libs/libXtst-1.0.99.2[${MULTILIB_USEDEP}]
362 + )
363 + dev-libs/libatomic_ops
364 + virtual/pkgconfig
365 + system-wide? ( || ( dev-util/unifdef sys-freebsd/freebsd-ubin ) )
366 + dev-util/intltool
367 + >=sys-devel/gettext-0.18.1
368 +"
369 +# This is a PDEPEND to avoid a circular dep
370 +PDEPEND="
371 + alsa? ( alsa-plugin? ( >=media-plugins/alsa-plugins-1.0.27-r1[pulseaudio,${MULTILIB_USEDEP}] ) )
372 +"
373 +
374 +# alsa-utils dep is for the alsasound init.d script (see bug #155707)
375 +# bluez dep is for the bluetooth init.d script
376 +# PyQt5 dep is for the qpaeq script
377 +RDEPEND="${RDEPEND}
378 + equalizer? ( qt5? ( dev-python/PyQt5[dbus,widgets] ) )
379 + system-wide? (
380 + alsa? ( media-sound/alsa-utils )
381 + bluetooth? ( >=net-wireless/bluez-5 )
382 + )
383 +"
384 +
385 +PATCHES=( "${FILESDIR}/${P}"-qpaeq-pyqt5-{1,2}.patch )
386 +
387 +pkg_pretend() {
388 + CONFIG_CHECK="~HIGH_RES_TIMERS"
389 + WARNING_HIGH_RES_TIMERS="CONFIG_HIGH_RES_TIMERS:\tis not set (required for enabling timer-based scheduling in pulseaudio)\n"
390 + check_extra_config
391 +
392 + if linux_config_exists; then
393 + local snd_hda_prealloc_size=$(linux_chkconfig_string SND_HDA_PREALLOC_SIZE)
394 + if [ -n "${snd_hda_prealloc_size}" ] && [ "${snd_hda_prealloc_size}" -lt 2048 ]; then
395 + ewarn "A preallocated buffer-size of 2048 (kB) or higher is recommended for the HD-audio driver!"
396 + ewarn "CONFIG_SND_HDA_PREALLOC_SIZE=${snd_hda_prealloc_size}"
397 + fi
398 + fi
399 +}
400 +
401 +pkg_setup() {
402 + linux-info_pkg_setup
403 + gnome2_environment_reset #543364
404 +
405 + enewgroup audio 18 # Just make sure it exists
406 +
407 + if use system-wide; then
408 + enewgroup pulse-access
409 + enewgroup pulse
410 + enewuser pulse -1 -1 /var/run/pulse pulse,audio
411 + fi
412 +}
413 +
414 +src_prepare() {
415 + default
416 +
417 + # Skip test that cannot work with sandbox, bug #501846
418 + sed -i -e '/lock-autospawn-test/d' src/Makefile.am || die
419 +
420 + eautoreconf
421 +}
422 +
423 +multilib_src_configure() {
424 + local myconf=()
425 +
426 + if use gdbm; then
427 + myconf+=( --with-database=gdbm )
428 + else
429 + myconf+=( --with-database=simple )
430 + fi
431 +
432 + if use bluetooth; then
433 + if multilib_is_native_abi; then
434 + myconf+=( --enable-bluez5 --disable-bluez4
435 + $(use_enable native-headset bluez5-native-headset)
436 + $(use_enable ofono-headset bluez5-ofono-headset) )
437 + fi
438 + else
439 + myconf+=( --disable-bluez5 --disable-bluez4 )
440 + fi
441 +
442 + myconf+=(
443 + --enable-largefile
444 + $(use_enable glib glib2)
445 + --disable-solaris
446 + $(use_enable asyncns)
447 + $(use_enable oss oss-output)
448 + $(use_enable alsa)
449 + $(use_enable lirc)
450 + $(use_enable neon neon-opt)
451 + $(use_enable tcpd tcpwrap)
452 + $(use_enable jack)
453 + $(use_enable zeroconf avahi)
454 + $(use_enable dbus)
455 + $(use_enable gnome gconf)
456 + $(use_enable gtk gtk3)
457 + $(use_enable libsamplerate samplerate)
458 + $(use_enable orc)
459 + $(use_enable X x11)
460 + $(use_enable test default-build-tests)
461 + $(use_enable udev)
462 + $(use_with sox soxr)
463 + $(use_enable systemd systemd-daemon)
464 + $(use_enable systemd systemd-login)
465 + $(use_enable systemd systemd-journal)
466 + $(use_enable ipv6)
467 + $(use_enable ssl openssl)
468 + $(use_enable webrtc-aec)
469 + $(use_with caps)
470 + $(use_with equalizer fftw)
471 + --disable-adrian-aec
472 + --disable-esound
473 + --localstatedir="${EPREFIX}"/var
474 + --with-udev-rules-dir="${EPREFIX}/$(get_udevdir)"/rules.d
475 + --with-systemduserunitdir=$(systemd_get_userunitdir)
476 + )
477 +
478 + if ! multilib_is_native_abi; then
479 + # disable all the modules and stuff
480 + myconf+=(
481 + --disable-oss-output
482 + --disable-alsa
483 + --disable-lirc
484 + --disable-jack
485 + --disable-avahi
486 + --disable-gconf
487 + --disable-gtk3
488 + --disable-samplerate
489 + --disable-bluez4
490 + --disable-bluez5
491 + --disable-udev
492 + --disable-openssl
493 + --disable-orc
494 + --disable-webrtc-aec
495 + --without-fftw
496 + --without-soxr
497 +
498 + # tests involve random modules, so just do them for the native
499 + --disable-default-build-tests
500 +
501 + # hack around unnecessary checks
502 + # (results don't matter, we're not building anything using it)
503 + ac_cv_lib_ltdl_lt_dladvise_init=yes
504 + --with-database=simple
505 + LIBSPEEX_CFLAGS=' '
506 + LIBSPEEX_LIBS=' '
507 + )
508 + fi
509 +
510 + ECONF_SOURCE=${S} \
511 + econf "${myconf[@]}"
512 +}
513 +
514 +multilib_src_compile() {
515 + if multilib_is_native_abi; then
516 + emake
517 + use doc && emake doxygen
518 + else
519 + local targets=( libpulse.la libpulsedsp.la libpulse-simple.la )
520 + use glib && targets+=( libpulse-mainloop-glib.la )
521 + emake -C src ${targets[*]}
522 + fi
523 +}
524 +
525 +multilib_src_test() {
526 + # We avoid running the toplevel check target because that will run
527 + # po/'s tests too, and they are broken. Officially, it should work
528 + # with intltool 0.41, but that doesn't look like a stable release.
529 + if multilib_is_native_abi; then
530 + emake -C src check
531 + fi
532 +}
533 +
534 +multilib_src_install() {
535 + if multilib_is_native_abi; then
536 + emake -j1 DESTDIR="${D}" bashcompletiondir="$(get_bashcompdir)" install
537 + use doc && dohtml -r doxygen/html/
538 + else
539 + local targets=( libpulse.la libpulse-simple.la )
540 + use glib && targets+=( libpulse-mainloop-glib.la )
541 + emake DESTDIR="${D}" install-pkgconfigDATA
542 + emake DESTDIR="${D}" -C src \
543 + install-libLTLIBRARIES \
544 + install-padsplibLTLIBRARIES \
545 + lib_LTLIBRARIES="${targets[*]}" \
546 + install-pulseincludeHEADERS
547 + fi
548 +}
549 +
550 +multilib_src_install_all() {
551 + # Drop the script entirely if X is disabled
552 + use X || rm "${ED}"/usr/bin/start-pulseaudio-x11
553 +
554 + if use system-wide; then
555 + newconfd "${FILESDIR}/pulseaudio.conf.d" pulseaudio
556 +
557 + use_define() {
558 + local define=${2:-$(echo $1 | tr '[:lower:]' '[:upper:]')}
559 +
560 + use "$1" && echo "-D$define" || echo "-U$define"
561 + }
562 +
563 + unifdef $(use_define zeroconf AVAHI) \
564 + $(use_define alsa) \
565 + $(use_define bluetooth) \
566 + $(use_define udev) \
567 + "${FILESDIR}/pulseaudio.init.d-5" \
568 + > "${T}/pulseaudio"
569 +
570 + doinitd "${T}/pulseaudio"
571 +
572 + systemd_dounit "${FILESDIR}/${PN}.service"
573 + fi
574 +
575 + use zeroconf && sed -i -e '/module-zeroconf-publish/s:^#::' "${ED}/etc/pulse/default.pa"
576 +
577 + dodoc NEWS README todo
578 +
579 + # Create the state directory
580 + use prefix || diropts -o pulse -g pulse -m0755
581 +
582 + # We need /var/run/pulse, bug #442852
583 + use system-wide && systemd_newtmpfilesd "${FILESDIR}/${PN}.tmpfiles" "${PN}.conf"
584 +
585 + # Prevent warnings when system-wide is not used, bug #447694
586 + use system-wide || rm "${ED}"/etc/dbus-1/system.d/pulseaudio-system.conf
587 +
588 + prune_libtool_files --all
589 +}
590 +
591 +pkg_postinst() {
592 + if use system-wide; then
593 + elog "You have enabled the 'system-wide' USE flag for pulseaudio."
594 + elog "This mode should only be used on headless servers, embedded systems,"
595 + elog "or thin clients. It will usually require manual configuration, and is"
596 + elog "incompatible with many expected pulseaudio features."
597 + elog "On normal desktop systems, system-wide mode is STRONGLY DISCOURAGED."
598 + elog "For more information, see"
599 + elog " https://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/WhatIsWrongWithSystemWide/"
600 + elog " https://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/SystemWide/"
601 + elog " https://wiki.gentoo.org/wiki/PulseAudio#Headless_server"
602 + if use gnome ; then
603 + elog
604 + elog "By enabling gnome USE flag, you enabled gconf support. Please note"
605 + elog "that you might need to remove the gnome USE flag or disable the"
606 + elog "gconf module on /etc/pulse/system.pa to be able to use PulseAudio"
607 + elog "with a system-wide instance."
608 + fi
609 + fi
610 +
611 + if use equalizer && ! use qt5; then
612 + elog "You've enabled the 'equalizer' USE-flag but not the 'qt5' USE-flag."
613 + elog "This will build the equalizer module, but the 'qpaeq' tool"
614 + elog "which is required to set equalizer levels will not work."
615 + fi
616 +
617 + if use native-headset && use ofono-headset; then
618 + elog "You have enabled both native and ofono headset profiles. The runtime decision"
619 + elog "which to use is done via the 'headset' argument of module-bluetooth-discover."
620 + fi
621 +
622 + if use libsamplerate; then
623 + elog "The libsamplerate based resamplers are now deprecated, because they offer no"
624 + elog "particular advantage over speex. Upstream suggests disabling them."
625 + fi
626 +}