Gentoo Archives: gentoo-commits

From: Mart Raudsepp <leio@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: media-sound/pulseaudio-daemon/, media-sound/pulseaudio-daemon/files/
Date: Fri, 24 Sep 2021 18:16:11
Message-Id: 1632507357.26646b27529e13f7beb0c78fac339e1d78bf07d4.leio@gentoo
1 commit: 26646b27529e13f7beb0c78fac339e1d78bf07d4
2 Author: Mart Raudsepp <leio <AT> gentoo <DOT> org>
3 AuthorDate: Fri Sep 24 18:07:09 2021 +0000
4 Commit: Mart Raudsepp <leio <AT> gentoo <DOT> org>
5 CommitDate: Fri Sep 24 18:15:57 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=26646b27
7
8 media-sound/pulseaudio-daemon: Add split package for pulseaudio daemon
9
10 Bug: https://bugs.gentoo.org/536780
11 Package-Manager: Portage-3.0.20, Repoman-3.0.2
12 Signed-off-by: Mart Raudsepp <leio <AT> gentoo.org>
13
14 media-sound/pulseaudio-daemon/Manifest | 1 +
15 .../pulseaudio-daemon/files/15.0-daemon-only.patch | 277 ++++++++++++++++++
16 ...pulseaudio-15.0-xice-xsm-xtst-daemon-only.patch | 25 ++
17 .../pulseaudio-daemon/files/pulseaudio.conf.d | 6 +
18 .../pulseaudio-daemon/files/pulseaudio.init.d-5 | 80 ++++++
19 .../pulseaudio-daemon/files/pulseaudio.service | 10 +
20 .../pulseaudio-daemon/files/pulseaudio.tmpfiles | 1 +
21 media-sound/pulseaudio-daemon/metadata.xml | 66 +++++
22 .../pulseaudio-daemon-15.0.ebuild | 320 +++++++++++++++++++++
23 9 files changed, 786 insertions(+)
24
25 diff --git a/media-sound/pulseaudio-daemon/Manifest b/media-sound/pulseaudio-daemon/Manifest
26 new file mode 100644
27 index 00000000000..308d5950874
28 --- /dev/null
29 +++ b/media-sound/pulseaudio-daemon/Manifest
30 @@ -0,0 +1 @@
31 +DIST pulseaudio-15.0.tar.xz 1521760 BLAKE2B a6f7b74fdcfe7f2a993eafb9f465946915a24b6801d3077971b9377290d6c70b3f8640a800abd09d5901db96a20349f31b1beedd9da2249f69b591fb8392f489 SHA512 352ef20384c76c631c0faa73b08e2318902a433712e0c086a5ac7a0ae58873c8d4be8f35879bdec71a93b19ae8e2ba073cacac4d56215bcf58375a0cd9d88833
32
33 diff --git a/media-sound/pulseaudio-daemon/files/15.0-daemon-only.patch b/media-sound/pulseaudio-daemon/files/15.0-daemon-only.patch
34 new file mode 100644
35 index 00000000000..9b18310f9e2
36 --- /dev/null
37 +++ b/media-sound/pulseaudio-daemon/files/15.0-daemon-only.patch
38 @@ -0,0 +1,277 @@
39 +From 5bcbd2ba656ac38ba500dc110cc13dbaa0d77853 Mon Sep 17 00:00:00 2001
40 +From: Mart Raudsepp <mart@××××.tech>
41 +Date: Fri, 24 Sep 2021 15:19:05 +0300
42 +Subject: [PATCH] build-sys: meson: Allow building the daemon only
43 +
44 +---
45 + meson.build | 23 ++++++++++++++++++++---
46 + meson_options.txt | 3 +++
47 + po/meson.build | 3 ---
48 + shell-completion/bash/meson.build | 2 ++
49 + src/daemon/meson.build | 4 ++--
50 + src/meson.build | 11 +++++++++++
51 + src/modules/gsettings/meson.build | 3 +--
52 + src/tests/meson.build | 9 +++++++--
53 + src/utils/meson.build | 10 ++++++----
54 + 9 files changed, 52 insertions(+), 16 deletions(-)
55 +
56 +diff --git a/meson.build b/meson.build
57 +index 63ed62342..420cc6fac 100644
58 +--- a/meson.build
59 ++++ b/meson.build
60 +@@ -53,6 +53,8 @@ libpulse_mainloop_glib_version = '@0@.@1@.@2@'.format(
61 + libpulse_mainloop_glib_version_info[1],
62 + )
63 +
64 ++i18n = import('i18n')
65 ++
66 + # Paths
67 +
68 + prefix = get_option('prefix')
69 +@@ -68,6 +70,7 @@ localedir = join_paths(prefix, get_option('localedir'))
70 + localstatedir = join_paths(prefix, get_option('localstatedir'))
71 + sysconfdir = join_paths(prefix, get_option('sysconfdir'))
72 + privlibdir = join_paths(libdir, 'pulseaudio')
73 ++po_dir = join_paths(meson.current_source_dir(), 'po')
74 +
75 + if host_machine.system() == 'windows'
76 + # Windows only supports loading libraries from the same dir as the executable
77 +@@ -796,20 +799,28 @@ check_dep = dependency('check', version : '>= 0.9.10', required : get_option('te
78 + if get_option('doxygen')
79 + subdir('doxygen')
80 + endif
81 +-subdir('po')
82 ++if not get_option('daemon-only')
83 ++ subdir('po')
84 ++endif
85 + if get_option('man')
86 + subdir('man')
87 + endif
88 + subdir('shell-completion/bash')
89 +-subdir('shell-completion/zsh')
90 ++if not get_option('daemon-only')
91 ++ subdir('shell-completion/zsh')
92 ++endif
93 + subdir('src')
94 +-subdir('vala')
95 ++if not get_option('daemon-only')
96 ++ subdir('vala')
97 ++endif
98 +
99 + # Now generate config.h from everything above
100 + configure_file(output : 'config.h', configuration : cdata)
101 +
102 + # pkg-config files
103 +
104 ++if not get_option('daemon-only')
105 ++
106 + pc_cdata = configuration_data()
107 +
108 + pc_cdata.set('prefix', prefix)
109 +@@ -842,8 +853,12 @@ foreach file : pc_files
110 + install_dir : pkgconfigdir)
111 + endforeach
112 +
113 ++endif # !daemon-only
114 ++
115 + # CMake files
116 +
117 ++if not get_option('daemon-only')
118 ++
119 + m4 = find_program('m4', required: true)
120 +
121 + cmakedir = join_paths(libdir, 'cmake', 'PulseAudio')
122 +@@ -872,6 +887,8 @@ configure_file(
123 + install_dir : cmakedir,
124 + )
125 +
126 ++endif # !daemon-only
127 ++
128 + ############################################################
129 +
130 + # Final summary
131 +diff --git a/meson_options.txt b/meson_options.txt
132 +index bb41a42a7..62828ac5c 100644
133 +--- a/meson_options.txt
134 ++++ b/meson_options.txt
135 +@@ -1,6 +1,9 @@
136 + option('daemon',
137 + type : 'boolean', value : true,
138 + description : 'Enable building and installation of pulseaudio daemon and supporting configuration files')
139 ++option('daemon-only',
140 ++ type : 'boolean', value : false,
141 ++ description : 'Build and install only the pulseaudio daemon and supporting configuration files, relying on a system installation of libpulse')
142 + option('doxygen',
143 + type : 'boolean', value : true,
144 + description : 'Enable building and installation of documentation generated with doxygen')
145 +diff --git a/po/meson.build b/po/meson.build
146 +index 34278db47..33429373c 100644
147 +--- a/po/meson.build
148 ++++ b/po/meson.build
149 +@@ -1,4 +1,3 @@
150 +-i18n = import('i18n')
151 + i18n.gettext(
152 + meson.project_name(),
153 + preset: 'glib',
154 +@@ -7,5 +6,3 @@ i18n.gettext(
155 + args: ['--msgid-bugs-address=https://gitlab.freedesktop.org/pulseaudio/pulseaudio/issues/new',
156 + '--width=90'],
157 + )
158 +-
159 +-po_dir = meson.current_source_dir()
160 +diff --git a/shell-completion/bash/meson.build b/shell-completion/bash/meson.build
161 +index 3ba5cb16f..83d90b94b 100644
162 +--- a/shell-completion/bash/meson.build
163 ++++ b/shell-completion/bash/meson.build
164 +@@ -8,6 +8,7 @@ if bashcompletiondir != 'no'
165 + ]
166 + endif
167 +
168 ++ if not get_option('daemon-only')
169 + aliases += [
170 + 'pacat',
171 + 'pactl',
172 +@@ -16,6 +17,7 @@ if bashcompletiondir != 'no'
173 + 'parec',
174 + 'parecord',
175 + ]
176 ++ endif
177 +
178 + install_data('pulseaudio', install_dir : bashcompletiondir)
179 +
180 +diff --git a/src/daemon/meson.build b/src/daemon/meson.build
181 +index 262e193b2..e8f70a453 100644
182 +--- a/src/daemon/meson.build
183 ++++ b/src/daemon/meson.build
184 +@@ -30,8 +30,8 @@ executable('pulseaudio',
185 + install_rpath : privlibdir,
186 + include_directories : [configinc, topinc],
187 + link_args : ['-ffast-math'],
188 +- link_with : [libpulsecore, libpulsecommon, libpulse],
189 +- dependencies : [ltdl_dep, cap_dep, dbus_dep, libsystemd_dep, dl_dep, libintl_dep, platform_dep, platform_socket_dep],
190 ++ link_with : [libpulsecore],
191 ++ dependencies : [ltdl_dep, cap_dep, dbus_dep, libsystemd_dep, dl_dep, libintl_dep, platform_dep, platform_socket_dep, libpulsecommon_dep, libpulse_dep],
192 + c_args : pa_c_args,
193 + )
194 +
195 +diff --git a/src/meson.build b/src/meson.build
196 +index e2860811b..a56667271 100644
197 +--- a/src/meson.build
198 ++++ b/src/meson.build
199 +@@ -188,6 +188,15 @@ else
200 + endif
201 + # FIXME: Do SIMD things
202 +
203 ++if get_option('daemon-only')
204 ++ libpulsecommon_dep = cc.find_library('pulsecommon-' + pa_version_major_minor, dirs : privlibdir, required : true)
205 ++ libpulse_dep = dependency('libpulse', required : true)
206 ++ libpulse_simple_dep = dependency('libpulse-simple', required : true)
207 ++ if glib_dep.found()
208 ++ libpulse_mainloop_glib_dep = dependency('libpulse-mainloop-glib', required : true)
209 ++ endif
210 ++else
211 ++
212 + libpulsecommon = shared_library('pulsecommon-' + pa_version_major_minor,
213 + libpulsecommon_sources,
214 + libpulsecommon_headers,
215 +@@ -207,6 +216,8 @@ libpulsecommon = shared_library('pulsecommon-' + pa_version_major_minor,
216 + libpulsecommon_dep = declare_dependency(link_with: libpulsecommon)
217 +
218 + subdir('pulse')
219 ++endif
220 ++
221 + if get_option('daemon')
222 + subdir('pulsecore')
223 + subdir('daemon')
224 +diff --git a/src/modules/gsettings/meson.build b/src/modules/gsettings/meson.build
225 +index 68a72c3ff..9604699e7 100644
226 +--- a/src/modules/gsettings/meson.build
227 ++++ b/src/modules/gsettings/meson.build
228 +@@ -8,8 +8,7 @@ gsettings_helper = executable('gsettings-helper',
229 + gsettings_helper_sources,
230 + c_args : pa_c_args,
231 + include_directories : [configinc, topinc],
232 +- link_with : [libpulsecommon, libpulse],
233 +- dependencies : [gio_dep],
234 ++ dependencies : [gio_dep, libpulsecommon_dep, libpulse_dep],
235 + install_dir : pulselibexecdir,
236 + install_rpath : privlibdir,
237 + install : true,
238 +diff --git a/src/tests/meson.build b/src/tests/meson.build
239 +index acd301037..56d71299f 100644
240 +--- a/src/tests/meson.build
241 ++++ b/src/tests/meson.build
242 +@@ -20,8 +20,6 @@ default_tests += [
243 + [ check_dep, libpulse_dep, libpulsecommon_dep ] ],
244 + [ 'json-test', 'json-test.c',
245 + [ check_dep, libpulse_dep, libpulsecommon_dep ] ],
246 +- [ 'mainloop-test', 'mainloop-test.c',
247 +- [ check_dep, libpulse_dep, libpulsecommon_dep ] ],
248 + [ 'proplist-test', 'proplist-test.c',
249 + [ check_dep, libpulse_dep, libpulsecommon_dep ] ],
250 + [ 'thread-mainloop-test', 'thread-mainloop-test.c',
251 +@@ -32,6 +30,13 @@ default_tests += [
252 + [ check_dep, libm_dep, libpulse_dep, libpulsecommon_dep ] ],
253 + ]
254 +
255 ++if not get_option('daemon-only')
256 ++ default_tests += [
257 ++ [ 'mainloop-test', 'mainloop-test.c',
258 ++ [ check_dep, libpulse_dep, libpulsecommon_dep ] ],
259 ++ ]
260 ++endif
261 ++
262 + if get_option('daemon')
263 + default_tests += [
264 + [ 'asyncmsgq-test', 'asyncmsgq-test.c',
265 +diff --git a/src/utils/meson.build b/src/utils/meson.build
266 +index c9635fdb6..7ed6e738f 100644
267 +--- a/src/utils/meson.build
268 ++++ b/src/utils/meson.build
269 +@@ -1,3 +1,4 @@
270 ++if not get_option('daemon-only')
271 + pacat_sources = [
272 + 'pacat.c',
273 + ]
274 +@@ -41,6 +42,7 @@ executable('pactl',
275 + dependencies : [sndfile_dep, libintl_dep],
276 + c_args : pa_c_args,
277 + )
278 ++endif
279 +
280 + if get_option('daemon')
281 + if host_machine.system() != 'windows'
282 +@@ -53,8 +55,7 @@ if get_option('daemon')
283 + install: true,
284 + install_rpath : privlibdir,
285 + include_directories : [configinc, topinc],
286 +- link_with : [libpulsecommon, libpulse],
287 +- dependencies: [libintl_dep],
288 ++ dependencies: [libintl_dep, libpulsecommon_dep, libpulse_dep],
289 + c_args : pa_c_args,
290 + )
291 +
292 +@@ -67,13 +68,13 @@ if get_option('daemon')
293 + install: true,
294 + install_rpath : privlibdir,
295 + include_directories : [configinc, topinc],
296 +- link_with : [libpulsecommon, libpulse],
297 +- dependencies: [libintl_dep],
298 ++ dependencies: [libintl_dep, libpulsecommon_dep, libpulse_dep],
299 + c_args : pa_c_args,
300 + )
301 + endif
302 + endif
303 +
304 ++if not get_option('daemon-only')
305 + if x11_dep.found()
306 + pax11publish_sources = [
307 + 'pax11publish.c',
308 +@@ -121,3 +122,4 @@ if dbus_dep.found() and fftw_dep.found()
309 + endif
310 +
311 + install_data('pa-info', install_dir : bindir)
312 ++endif
313 +--
314 +2.32.0
315 +
316
317 diff --git a/media-sound/pulseaudio-daemon/files/pulseaudio-15.0-xice-xsm-xtst-daemon-only.patch b/media-sound/pulseaudio-daemon/files/pulseaudio-15.0-xice-xsm-xtst-daemon-only.patch
318 new file mode 100644
319 index 00000000000..f3df62031d3
320 --- /dev/null
321 +++ b/media-sound/pulseaudio-daemon/files/pulseaudio-15.0-xice-xsm-xtst-daemon-only.patch
322 @@ -0,0 +1,25 @@
323 +https://bugs.gentoo.org/806052
324 +
325 +commit 42af3ee08381faa5807fde68d4c8ec0d7ad5e9a5
326 +Author: Igor V. Kovalenko <igor.v.kovalenko@×××××.com>
327 +Date: Tue Aug 3 09:43:32 2021 +0300
328 +
329 + build-sys: meson: Require xice, xsm and xtst for daemon only
330 +
331 + Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/613>
332 +
333 +--- a/meson.build
334 ++++ b/meson.build
335 +@@ -681,9 +681,9 @@ endif
336 + x11_dep = dependency('x11-xcb', required : get_option('x11'))
337 + if x11_dep.found()
338 + xcb_dep = dependency('xcb', required : true, version : '>= 1.6')
339 +- ice_dep = dependency('ice', required : true)
340 +- sm_dep = dependency('sm', required : true)
341 +- xtst_dep = dependency('xtst', required : true)
342 ++ ice_dep = dependency('ice', required : get_option('daemon'))
343 ++ sm_dep = dependency('sm', required : get_option('daemon'))
344 ++ xtst_dep = dependency('xtst', required : get_option('daemon'))
345 + cdata.set('HAVE_X11', 1)
346 + if cc.has_function('XSetIOErrorExitHandler', dependencies: x11_dep)
347 + cdata.set('HAVE_XSETIOERROREXITHANDLER', 1)
348
349 diff --git a/media-sound/pulseaudio-daemon/files/pulseaudio.conf.d b/media-sound/pulseaudio-daemon/files/pulseaudio.conf.d
350 new file mode 100644
351 index 00000000000..9e7245344a5
352 --- /dev/null
353 +++ b/media-sound/pulseaudio-daemon/files/pulseaudio.conf.d
354 @@ -0,0 +1,6 @@
355 +# Config file for /etc/init.d/pulseaudio
356 +
357 +# For more see "pulseaudio -h".
358 +
359 +# Startup options
360 +PA_OPTS="--log-target=syslog --disallow-module-loading=1"
361
362 diff --git a/media-sound/pulseaudio-daemon/files/pulseaudio.init.d-5 b/media-sound/pulseaudio-daemon/files/pulseaudio.init.d-5
363 new file mode 100644
364 index 00000000000..a14f5e74aa5
365 --- /dev/null
366 +++ b/media-sound/pulseaudio-daemon/files/pulseaudio.init.d-5
367 @@ -0,0 +1,80 @@
368 +#!/sbin/openrc-run
369 +# Copyright 1999-2021 Gentoo Authors
370 +# Distributed under the terms of the GNU General Public License v2
371 +
372 +depend() {
373 + need localmount
374 + use net
375 +
376 + local script="/etc/pulse/system.pa"
377 +
378 + for opt in ${PA_OPTS}; do
379 + case "$opt" in
380 + --file=*) script="${opt#*=}" ;;
381 + -F*) script="${opt#-F}" ;;
382 + esac
383 + done
384 +
385 + config "$script"
386 +
387 + local needs="$(get_options need)"
388 + if [ -n "${needs}" ]; then
389 + need ${needs}
390 + return
391 + fi
392 +
393 + if egrep -q '^[[:space:]]*load-module[[:space:]]+module-console-kit' "$script"; then
394 + needs="${needs} consolekit"
395 + fi
396 +
397 +#ifdef UDEV
398 + if egrep -q '^[[:space:]]*load-module[[:space:]]+module-udev-detect' "$script"; then
399 + needs="${needs} udev"
400 + fi
401 +#endif
402 +
403 +#ifdef AVAHI
404 + if egrep -q '^[[:space:]]*load-module[[:space:]]+module-zeroconf-publish' "$script"; then
405 + needs="${needs} avahi-daemon"
406 + fi
407 +#endif
408 +
409 +#ifdef BLUETOOTH
410 + if egrep -q '^[[:space:]]*load-module[[:space:]]+module-bt-proximity' "$script"; then
411 + needs="${needs} bluetooth"
412 + fi
413 +#endif
414 +
415 +#ifdef ALSA
416 + if egrep -q '^[[:space:]]*load-module[[:space:]]+module-alsa-(sink|source)' "$script" ||
417 + egrep -q '^[[:space:]]*load-module[[:space:]]+module-(udev-)?detect' "$script" ||
418 + egrep -q '^[[:space:]]*add-autoload-source[[:space:]]+(input|output)[[:space:]]+module-alsa-(sink|source)' "$script"; then
419 + needs="${needs} alsasound"
420 + fi
421 +#endif
422 +
423 + need "${needs}"
424 + save_options need "${needs}"
425 +}
426 +
427 +start() {
428 + if [ -z "${PULSEAUDIO_SHOULD_NOT_GO_SYSTEMWIDE}" ]; then
429 + eerror "Please don't use system wide PulseAudio unless you read the"
430 + eerror "documentation available at http://www.pulseaudio.org/wiki/WhatIsWrongWithSystemMode"
431 + eerror ""
432 + eerror "When you're done, please set the variable PULSEAUDIO_SHOULD_NOT_GO_SYSTEMWIDE in"
433 + eerror "/etc/conf.d/pulseaudio . Please remember that upstream does not support this mode"
434 + eerror "when used for standard desktop configurations."
435 + return 1
436 + fi
437 + ebegin "Starting pulseaudio"
438 + PA_ALL_OPTS="${PA_OPTS} --fail=1 --daemonize=1 --system"
439 + start-stop-daemon --start --exec /usr/bin/pulseaudio -- ${PA_ALL_OPTS}
440 + eend $?
441 +}
442 +
443 +stop() {
444 + ebegin "Stopping pulseaudio"
445 + start-stop-daemon --stop --quiet --exec /usr/bin/pulseaudio --pidfile /var/run/pulse/pid
446 + eend $?
447 +}
448
449 diff --git a/media-sound/pulseaudio-daemon/files/pulseaudio.service b/media-sound/pulseaudio-daemon/files/pulseaudio.service
450 new file mode 100644
451 index 00000000000..c5f0d579992
452 --- /dev/null
453 +++ b/media-sound/pulseaudio-daemon/files/pulseaudio.service
454 @@ -0,0 +1,10 @@
455 +[Unit]
456 +Description=System wide PulseAudio instance
457 +After=syslog.target network.target alsasound.service
458 +
459 +[Service]
460 +Restart=always
461 +ExecStart=/usr/bin/pulseaudio --system --log-target=syslog
462 +
463 +[Install]
464 +WantedBy=multi-user.target
465
466 diff --git a/media-sound/pulseaudio-daemon/files/pulseaudio.tmpfiles b/media-sound/pulseaudio-daemon/files/pulseaudio.tmpfiles
467 new file mode 100644
468 index 00000000000..88374e35574
469 --- /dev/null
470 +++ b/media-sound/pulseaudio-daemon/files/pulseaudio.tmpfiles
471 @@ -0,0 +1 @@
472 +d /var/run/pulse 0755 pulse audio -
473
474 diff --git a/media-sound/pulseaudio-daemon/metadata.xml b/media-sound/pulseaudio-daemon/metadata.xml
475 new file mode 100644
476 index 00000000000..9808d54c65c
477 --- /dev/null
478 +++ b/media-sound/pulseaudio-daemon/metadata.xml
479 @@ -0,0 +1,66 @@
480 +<?xml version="1.0" encoding="UTF-8"?>
481 +<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
482 +<pkgmetadata>
483 + <maintainer type="project">
484 + <email>gnome@g.o</email>
485 + <name>Gentoo GNOME Desktop</name>
486 + </maintainer>
487 + <use>
488 + <flag name="X">
489 + Build the X11 publish module to export PulseAudio information
490 + through X11 protocol for clients to make use. Don't enable this
491 + flag if you want to use a system wide instance. If unsure, enable
492 + this flag.
493 + </flag>
494 + <flag name="alsa-plugin">
495 + Request installing <pkg>media-plugins/alsa-plugins</pkg> with
496 + PulseAudio plugin enabled. This ensures that clients supporting
497 + ALSA only will use PulseAudio.
498 + </flag>
499 + <flag name="elogind">Use <pkg>sys-auth/elogind</pkg> for giving each session a PA client</flag>
500 + <flag name="oss">
501 + Enable OSS sink/source (output/input). Deprecated, upstream does
502 + not support this on systems where other sink/source systems are
503 + available (i.e.: Linux). The padsp wrapper is now always build
504 + if the system supports OSS at all.
505 + </flag>
506 + <flag name="glib">
507 + Build the GSettings PA module.
508 + </flag>
509 + <flag name="system-wide">
510 + Allow preparation and installation of the system-wide init
511 + script for PulseAudio. Since this support is only supported for
512 + embedded situations, do not enable without reading the upstream
513 + instructions at
514 + https://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/WhatIsWrongWithSystemWide/ .
515 + </flag>
516 + <flag name="asyncns">Use libasyncns for asynchronous name resolution.</flag>
517 + <flag name="equalizer">
518 + Enable the equalizer module (requires <pkg>sci-libs/fftw</pkg>).
519 + </flag>
520 + <flag name="ssl">
521 + Use <pkg>dev-libs/openssl</pkg> to provide support for RAOP
522 + (AirPort) streaming.
523 + </flag>
524 + <flag name="gdbm">
525 + Use <pkg>sys-libs/gdbm</pkg> to store PulseAudio
526 + databases. Recommended for desktop usage. This flag causes the
527 + whole package to be licensed under GPL-2 or later.
528 + </flag>
529 + <flag name="webrtc-aec">
530 + Uses the webrtc.org AudioProcessing library for enhancing VoIP calls
531 + greatly in applications that support it by performing acoustic echo
532 + cancellation, analog gain control, noise suppression and other processing.
533 + </flag>
534 + <flag name="systemd">
535 + Build with <pkg>sys-apps/systemd</pkg> support to replace standalone
536 + ConsoleKit.
537 + </flag>
538 + <flag name="native-headset">
539 + Build with native HSP backend for bluez 5.
540 + </flag>
541 + <flag name="ofono-headset">
542 + Build with oFono HFP backend for bluez 5, requires <pkg>net-misc/ofono</pkg>.
543 + </flag>
544 + </use>
545 +</pkgmetadata>
546
547 diff --git a/media-sound/pulseaudio-daemon/pulseaudio-daemon-15.0.ebuild b/media-sound/pulseaudio-daemon/pulseaudio-daemon-15.0.ebuild
548 new file mode 100644
549 index 00000000000..e0d3851c214
550 --- /dev/null
551 +++ b/media-sound/pulseaudio-daemon/pulseaudio-daemon-15.0.ebuild
552 @@ -0,0 +1,320 @@
553 +# Copyright 1999-2021 Gentoo Authors
554 +# Distributed under the terms of the GNU General Public License v2
555 +
556 +EAPI="7"
557 +
558 +MY_PV="${PV/_pre*}"
559 +MY_P="pulseaudio-${MY_PV}"
560 +
561 +inherit bash-completion-r1 gnome2-utils meson optfeature systemd tmpfiles udev
562 +
563 +DESCRIPTION="A networked sound server with an advanced plugin system"
564 +HOMEPAGE="https://www.freedesktop.org/wiki/Software/PulseAudio/"
565 +
566 +if [[ ${PV} = 9999 ]]; then
567 + inherit git-r3
568 + EGIT_BRANCH="master"
569 + EGIT_REPO_URI="https://gitlab.freedesktop.org/pulseaudio/pulseaudio"
570 +else
571 + SRC_URI="https://freedesktop.org/software/pulseaudio/releases/${MY_P}.tar.xz"
572 + KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~riscv ~sparc ~x86 ~amd64-linux ~x86-linux"
573 +fi
574 +
575 +S="${WORKDIR}/${MY_P}"
576 +
577 +# libpulse-simple and libpulse link to libpulse-core; this is daemon's
578 +# library and can link to gdbm and other GPL-only libraries. In this
579 +# cases, we have a fully GPL-2 package. Leaving the rest of the
580 +# GPL-forcing USE flags for those who use them.
581 +LICENSE="!gdbm? ( LGPL-2.1 ) gdbm? ( GPL-2 )"
582 +
583 +SLOT="0"
584 +
585 +# +alsa-plugin as discussed in bug #519530
586 +# TODO: Deal with bluez5-gstreamer - requires ldacenc and rtpldacpay gstreamer elements
587 +# TODO: Find out why webrtc-aec is + prefixed - there's already the always available speexdsp-aec
588 +# NOTE: The current ebuild sets +X almost certainly just for the pulseaudio.desktop file
589 +IUSE="+alsa +alsa-plugin +asyncns bluetooth dbus elogind equalizer +gdbm gstreamer +glib gtk ipv6 jack lirc
590 +native-headset ofono-headset +orc oss selinux sox ssl systemd system-wide tcpd test +udev +webrtc-aec +X zeroconf"
591 +
592 +RESTRICT="!test? ( test )"
593 +
594 +# See "*** BLUEZ support not found (requires D-Bus)" in configure.ac
595 +# Basically all IUSE are either ${MULTILIB_USEDEP} for client libs or they belong under !daemon ()
596 +# We duplicate alsa-plugin, {native,ofono}-headset under daemon to let users deal with them at once
597 +REQUIRED_USE="
598 + alsa-plugin? ( alsa )
599 + bluetooth? ( dbus )
600 + ?? ( elogind systemd )
601 + equalizer? ( dbus )
602 + native-headset? ( bluetooth )
603 + ofono-headset? ( bluetooth )
604 + udev? ( || ( alsa oss ) )
605 + zeroconf? ( dbus )
606 +"
607 +
608 +BDEPEND="
609 + dev-lang/perl
610 + dev-perl/XML-Parser
611 + sys-devel/gettext
612 + virtual/libiconv
613 + virtual/libintl
614 + virtual/pkgconfig
615 + orc? ( >=dev-lang/orc-0.4.15 )
616 + system-wide? ( dev-util/unifdef )
617 +"
618 +
619 +# NOTE:
620 +# - libpcre needed in some cases, bug #472228
621 +# - media-libs/speexdsp is providing echo canceller implementation and used in resampler
622 +# TODO: libatomic_ops is only needed on some architectures and conditions, and then at runtime too
623 +COMMON_DEPEND="
624 + >=media-libs/libpulse-${PV}[glib?]
625 + dev-libs/libatomic_ops
626 + >=media-libs/libsndfile-1.0.20
627 + >=media-libs/speexdsp-1.2
628 + || (
629 + elibc_glibc? ( virtual/libc )
630 + elibc_uclibc? ( virtual/libc )
631 + dev-libs/libpcre:3
632 + )
633 + alsa? ( >=media-libs/alsa-lib-1.0.24 )
634 + asyncns? ( >=net-libs/libasyncns-0.1 )
635 + bluetooth? (
636 + >=net-wireless/bluez-5
637 + media-libs/sbc
638 + )
639 + dev-libs/libltdl
640 + sys-kernel/linux-headers
641 + >=sys-libs/libcap-2.22-r2
642 + dbus? ( >=sys-apps/dbus-1.4.12 )
643 + elogind? ( sys-auth/elogind )
644 + equalizer? (
645 + sci-libs/fftw:3.0
646 + )
647 + gdbm? ( sys-libs/gdbm:= )
648 + glib? ( >=dev-libs/glib-2.28.0:2 )
649 + gstreamer? (
650 + media-libs/gst-plugins-base
651 + >=media-libs/gstreamer-1.14
652 + )
653 + gtk? ( x11-libs/gtk+:3 )
654 + jack? ( virtual/jack )
655 + lirc? ( app-misc/lirc )
656 + ofono-headset? ( >=net-misc/ofono-1.13 )
657 + orc? ( >=dev-lang/orc-0.4.15 )
658 + selinux? ( sec-policy/selinux-pulseaudio )
659 + sox? ( >=media-libs/soxr-0.1.1 )
660 + ssl? ( dev-libs/openssl:= )
661 + systemd? ( sys-apps/systemd:= )
662 + tcpd? ( sys-apps/tcp-wrappers )
663 + udev? ( >=virtual/udev-143[hwdb(+)] )
664 + webrtc-aec? ( >=media-libs/webrtc-audio-processing-0.2:0 )
665 + X? (
666 + >=x11-libs/libxcb-1.6
667 + x11-libs/libICE
668 + x11-libs/libSM
669 + >=x11-libs/libX11-1.4.0
670 + >=x11-libs/libXtst-1.0.99.2
671 + )
672 + zeroconf? ( >=net-dns/avahi-0.6.12[dbus] )
673 + !<media-sound/pulseaudio-15.0-r100
674 +"
675 +
676 +# pulseaudio ships a bundle xmltoman, which uses XML::Parser
677 +DEPEND="
678 + ${COMMON_DEPEND}
679 + test? ( >=dev-libs/check-0.9.10 )
680 + X? ( x11-base/xorg-proto )
681 +"
682 +
683 +# alsa-utils dep is for the alsasound init.d script (see bug 155707); TODO: read it
684 +# NOTE: Only system-wide needs acct-group/audio unless elogind/systemd is not used
685 +RDEPEND="
686 + ${COMMON_DEPEND}
687 + system-wide? (
688 + alsa? ( media-sound/alsa-utils )
689 + acct-user/pulse
690 + acct-group/audio
691 + acct-group/pulse-access
692 + )
693 +"
694 +
695 +# This is a PDEPEND to avoid a circular dep
696 +PDEPEND="
697 + alsa? ( alsa-plugin? ( >=media-plugins/alsa-plugins-1.0.27-r1[pulseaudio] ) )
698 +"
699 +
700 +DOCS=( NEWS README )
701 +
702 +S="${WORKDIR}/${MY_P}"
703 +
704 +PATCHES=(
705 + "${FILESDIR}"/pulseaudio-15.0-xice-xsm-xtst-daemon-only.patch
706 + "${FILESDIR}"/${PV}-daemon-only.patch
707 +)
708 +
709 +src_prepare() {
710 + default
711 +
712 + gnome2_environment_reset
713 +}
714 +
715 +src_configure() {
716 + local emesonargs=(
717 + --localstatedir="${EPREFIX}"/var
718 +
719 + -Ddaemon=true
720 + -Ddaemon-only=true
721 + -Ddoxygen=false
722 + -Dgcov=false
723 + -Dman=false
724 + # tests involve random modules, so just do them for the native # TODO: tests should run always
725 + $(meson_use test tests)
726 + -Ddatabase=$(usex gdbm gdbm simple) # tdb is also an option but no one cares about it
727 + -Dstream-restore-clear-old-devices=true
728 + -Drunning-from-build-tree=false
729 +
730 + # Paths
731 + -Dmodlibexecdir="${EPREFIX}/usr/$(get_libdir)/pulseaudio/modules" # Was $(get_libdir)/${P}
732 + -Dsystemduserunitdir=$(systemd_get_userunitdir)
733 + -Dudevrulesdir="${EPREFIX}$(get_udevdir)/rules.d"
734 + -Dbashcompletiondir="$(get_bashcompdir)" # Alternatively DEPEND on app-shells/bash-completion for pkg-config to provide the value
735 +
736 + # Optional features
737 + $(meson_feature alsa)
738 + $(meson_feature asyncns)
739 + $(meson_feature zeroconf avahi)
740 + $(meson_feature bluetooth bluez5)
741 + -Dbluez5-gstreamer=disabled # no ldacenc/rtpldacpay gst elements packaged yet
742 + $(meson_use native-headset bluez5-native-headset)
743 + $(meson_use ofono-headset bluez5-ofono-headset)
744 + $(meson_feature dbus)
745 + $(meson_feature elogind)
746 + $(meson_feature equalizer fftw)
747 + $(meson_feature glib) # WARNING: toggling this likely changes ABI
748 + $(meson_feature glib gsettings) # Supposedly correct?
749 + $(meson_feature gstreamer)
750 + $(meson_feature gtk)
751 + -Dhal-compat=true # Consider disabling on next revbump
752 + $(meson_use ipv6)
753 + $(meson_feature jack)
754 + $(meson_feature lirc)
755 + $(meson_feature ssl openssl)
756 + $(meson_feature orc)
757 + $(meson_feature oss oss-output)
758 + -Dsamplerate=disabled # Matches upstream
759 + $(meson_feature sox soxr)
760 + -Dspeex=enabled
761 + $(meson_feature systemd)
762 + $(meson_feature tcpd tcpwrap) # TODO: This should technically be enabled for 32bit too, but at runtime it probably is never used without daemon?
763 + $(meson_feature udev)
764 + -Dvalgrind=auto
765 + $(meson_feature X x11)
766 +
767 + # Echo cancellation
768 + -Dadrian-aec=false # Not packaged?
769 + $(meson_feature webrtc-aec)
770 + )
771 +
772 + meson_src_configure
773 +}
774 +
775 +src_install() {
776 + meson_src_install
777 +
778 + # Installed by media-libs/libpulse
779 + rm "${ED}/$(get_bashcompdir)"/pulseaudio || die
780 +
781 + if use system-wide; then
782 + newconfd "${FILESDIR}"/pulseaudio.conf.d pulseaudio
783 +
784 + use_define() {
785 + local define=${2:-$(echo ${1} | tr '[:lower:]' '[:upper:]')}
786 +
787 + use "${1}" && echo "-D${define}" || echo "-U${define}"
788 + }
789 +
790 + unifdef -x 1 \
791 + $(use_define zeroconf AVAHI) \
792 + $(use_define alsa) \
793 + $(use_define bluetooth) \
794 + $(use_define udev) \
795 + "${FILESDIR}"/pulseaudio.init.d-5 \
796 + > "${T}"/pulseaudio \
797 + || die
798 +
799 + doinitd "${T}"/pulseaudio
800 +
801 + systemd_dounit "${FILESDIR}"/pulseaudio.service
802 +
803 + # We need /var/run/pulse, bug 442852
804 + newtmpfiles "${FILESDIR}"/pulseaudio.tmpfiles pulseaudio.conf
805 + else
806 + # Prevent warnings when system-wide is not used, bug 447694
807 + if use dbus; then
808 + rm "${ED}"/etc/dbus-1/system.d/pulseaudio-system.conf || die
809 + fi
810 + fi
811 +
812 + if use zeroconf; then
813 + sed -i \
814 + -e '/module-zeroconf-publish/s:^#::' \
815 + "${ED}/etc/pulse/default.pa" \
816 + || die
817 + fi
818 +
819 + find "${ED}" \( -name '*.a' -o -name '*.la' \) -delete || die
820 +}
821 +
822 +pkg_postinst() {
823 + gnome2_schemas_update
824 +
825 + if use system-wide; then
826 + tmpfiles_process "pulseaudio.conf"
827 +
828 + elog "You have enabled the 'system-wide' USE flag for pulseaudio."
829 + elog "This mode should only be used on headless servers, embedded systems,"
830 + elog "or thin clients. It will usually require manual configuration, and is"
831 + elog "incompatible with many expected pulseaudio features."
832 + elog "On normal desktop systems, system-wide mode is STRONGLY DISCOURAGED."
833 + elog ""
834 + elog "For more information, see"
835 + elog " https://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/WhatIsWrongWithSystemWide/"
836 + elog " https://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/SystemWide/"
837 + elog " https://wiki.gentoo.org/wiki/PulseAudio#Headless_server"
838 + elog ""
839 + fi
840 +
841 + if use equalizer; then
842 + elog "You will need to load some extra modules to make qpaeq work."
843 + elog "You can do that by adding the following two lines in"
844 + elog "/etc/pulse/default.pa and restarting pulseaudio:"
845 + elog "load-module module-equalizer-sink"
846 + elog "load-module module-dbus-protocol"
847 + elog ""
848 + fi
849 +
850 + if use native-headset && use ofono-headset; then
851 + elog "You have enabled both native and ofono headset profiles. The runtime decision"
852 + elog "which to use is done via the 'headset' argument of module-bluetooth-discover."
853 + elog ""
854 + fi
855 +
856 + if use systemd; then
857 + elog "It's recommended to start pulseaudio via its systemd user units:"
858 + elog ""
859 + elog " systemctl --user enable pulseaudio.service pulseaudio.socket"
860 + elog ""
861 + elog "The change from autospawn to user units will take effect after restarting."
862 + elog ""
863 + fi
864 +
865 + optfeature_header "PulseAudio can be enhanced by installing the following:"
866 + use equalizer && optfeature "using the qpaeq script" dev-python/PyQt5[dbus,widgets]
867 + use dbus && optfeature "restricted realtime capabilities via D-Bus" sys-auth/rtkit
868 +}
869 +
870 +pkg_postrm() {
871 + gnome2_schemas_update
872 +}