Gentoo Archives: gentoo-commits

From: Sam James <sam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: media-libs/libpulse/files/, media-libs/libpulse/, ...
Date: Mon, 21 Feb 2022 00:49:20
Message-Id: 1645404539.5c0932d5e4d591710f3299f70c2012383ab268bc.sam@gentoo
1 commit: 5c0932d5e4d591710f3299f70c2012383ab268bc
2 Author: Igor V. Kovalenko <igor.v.kovalenko <AT> gmail <DOT> com>
3 AuthorDate: Sat Feb 19 07:21:06 2022 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Mon Feb 21 00:48:59 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5c0932d5
7
8 media-sound/pulseaudio-daemon: Update 15.0 split build to patches merged upstream
9
10 Added patch moving systemd socket activation to server implementation.
11 No functional changes. This patch is only required to apply upstream
12 daemon/client split patch with minimal adjustment.
13 https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/640
14
15 Updated daemon/client split patch to version merged upstream, rebased to 15.0
16 https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/659
17
18 Signed-off-by: Igor V. Kovalenko <igor.v.kovalenko <AT> gmail.com>
19 Closes: https://github.com/gentoo/gentoo/pull/24217
20 Signed-off-by: Sam James <sam <AT> gentoo.org>
21
22 media-libs/libpulse/files/15.0-no-aec.patch | 45 -
23 ...pulseaudio-15.0-daemon-client-split-build.patch | 1987 ++++++++++++++++++++
24 ...-15.0-move-systemd-socket-activation-code.patch | 284 +++
25 ...ibpulse-15.0.ebuild => libpulse-15.0-r1.ebuild} | 14 +-
26 media-sound/pulseaudio-daemon/Manifest | 1 +
27 .../pulseaudio-daemon/files/15.0-daemon-only.patch | 298 ---
28 ...pulseaudio-15.0-xice-xsm-xtst-daemon-only.patch | 25 -
29 ...5.0.ebuild => pulseaudio-daemon-15.0-r1.ebuild} | 17 +-
30 8 files changed, 2297 insertions(+), 374 deletions(-)
31
32 diff --git a/media-libs/libpulse/files/15.0-no-aec.patch b/media-libs/libpulse/files/15.0-no-aec.patch
33 deleted file mode 100644
34 index bd0b4d58b789..000000000000
35 --- a/media-libs/libpulse/files/15.0-no-aec.patch
36 +++ /dev/null
37 @@ -1,45 +0,0 @@
38 -From 4ea50aa41ff0131b380aef97623be578b702cac7 Mon Sep 17 00:00:00 2001
39 -From: Mart Raudsepp <mart@××××.tech>
40 -Date: Fri, 24 Sep 2021 00:02:40 +0300
41 -Subject: [PATCH] build-sys: meson: Relax sanity checks for daemonless builds
42 -
43 -Echo canceller, udev and speex resampling is only used by the daemon, so
44 -don't error or warn about those in -Ddaemon=false builds.
45 ----
46 - meson.build | 6 +++---
47 - 1 file changed, 3 insertions(+), 3 deletions(-)
48 -
49 -diff --git a/meson.build b/meson.build
50 -index d7e468cab..63ed62342 100644
51 ---- a/meson.build
52 -+++ b/meson.build
53 -@@ -961,7 +961,7 @@ message('\n '.join(summary))
54 -
55 - # Sanity checks
56 -
57 --if not speex_dep.found() and not webrtc_dep.found() and not get_option('adrian-aec')
58 -+if get_option('daemon') and not speex_dep.found() and not webrtc_dep.found() and not get_option('adrian-aec')
59 - error('At least one echo canceller implementation must be available!')
60 - endif
61 -
62 -@@ -981,7 +981,7 @@ if host_machine.system() != 'windows'
63 - ]
64 - warning('\n' + '\n'.join(message))
65 - endif
66 -- if host_machine.system() == 'linux' and not udev_dep.found()
67 -+ if host_machine.system() == 'linux' and not udev_dep.found() and get_option('daemon')
68 - message = [
69 - 'You do not have udev support enabled. It is strongly recommended',
70 - 'that you enable udev support if your platform supports it as it is',
71 -@@ -990,7 +990,7 @@ if host_machine.system() != 'windows'
72 - ]
73 - warning('\n' + '\n'.join(message))
74 - endif
75 -- if not speex_dep.found()
76 -+ if not speex_dep.found() and get_option('daemon')
77 - message = [
78 - 'You do not have speex support enabled. It is strongly recommended',
79 - 'that you enable speex support if your platform supports it as it is',
80 ---
81 -2.32.0
82 -
83
84 diff --git a/media-libs/libpulse/files/pulseaudio-15.0-daemon-client-split-build.patch b/media-libs/libpulse/files/pulseaudio-15.0-daemon-client-split-build.patch
85 new file mode 100644
86 index 000000000000..8e3fbae40767
87 --- /dev/null
88 +++ b/media-libs/libpulse/files/pulseaudio-15.0-daemon-client-split-build.patch
89 @@ -0,0 +1,1987 @@
90 +From 36a1aab8e61cf846a4ee571c19cf1ce8fd7eca9d Mon Sep 17 00:00:00 2001
91 +From: Mart Raudsepp <mart@××××.tech>
92 +Date: Fri, 24 Sep 2021 00:02:40 +0300
93 +Subject: [PATCH 1/8] build-sys: meson: Relax sanity checks for daemonless
94 + builds
95 +
96 +Echo canceller, udev and speex resampling is only used by the daemon, so
97 +don't error or warn about those in -Ddaemon=false builds.
98 +
99 +Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/659>
100 +---
101 + meson.build | 6 +++---
102 + 1 file changed, 3 insertions(+), 3 deletions(-)
103 +
104 +diff --git a/meson.build b/meson.build
105 +index a95fefcd4..d1c419ac2 100644
106 +--- a/meson.build
107 ++++ b/meson.build
108 +@@ -961,7 +961,7 @@ message('\n '.join(summary))
109 +
110 + # Sanity checks
111 +
112 +-if not speex_dep.found() and not webrtc_dep.found() and not get_option('adrian-aec')
113 ++if get_option('daemon') and not speex_dep.found() and not webrtc_dep.found() and not get_option('adrian-aec')
114 + error('At least one echo canceller implementation must be available!')
115 + endif
116 +
117 +@@ -981,7 +981,7 @@ if host_machine.system() != 'windows'
118 + ]
119 + warning('\n' + '\n'.join(message))
120 + endif
121 +- if host_machine.system() == 'linux' and not udev_dep.found()
122 ++ if host_machine.system() == 'linux' and not udev_dep.found() and get_option('daemon')
123 + message = [
124 + 'You do not have udev support enabled. It is strongly recommended',
125 + 'that you enable udev support if your platform supports it as it is',
126 +@@ -990,7 +990,7 @@ if host_machine.system() != 'windows'
127 + ]
128 + warning('\n' + '\n'.join(message))
129 + endif
130 +- if not speex_dep.found()
131 ++ if not speex_dep.found() and get_option('daemon')
132 + message = [
133 + 'You do not have speex support enabled. It is strongly recommended',
134 + 'that you enable speex support if your platform supports it as it is',
135 +--
136 +2.35.1
137 +
138 +
139 +From f63f3a9d7f311720dddef1f46e7c7431e3068c38 Mon Sep 17 00:00:00 2001
140 +From: Mart Raudsepp <mart@××××.tech>
141 +Date: Fri, 24 Sep 2021 15:19:05 +0300
142 +Subject: [PATCH 2/8] build-sys: meson: Allow building the daemon only
143 +
144 +Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/659>
145 +---
146 + man/meson.build | 2 ++
147 + meson.build | 23 ++++++++++++++++++++---
148 + meson_options.txt | 3 +++
149 + po/meson.build | 3 ---
150 + shell-completion/bash/meson.build | 2 ++
151 + src/daemon/meson.build | 4 ++--
152 + src/meson.build | 11 +++++++++++
153 + src/modules/gsettings/meson.build | 3 +--
154 + src/tests/meson.build | 9 +++++++--
155 + src/utils/meson.build | 10 ++++++----
156 + 10 files changed, 54 insertions(+), 16 deletions(-)
157 +
158 +diff --git a/man/meson.build b/man/meson.build
159 +index 31c581a8f..c12ad5e6a 100644
160 +--- a/man/meson.build
161 ++++ b/man/meson.build
162 +@@ -14,6 +14,7 @@ if get_option('daemon')
163 + ]
164 + endif
165 +
166 ++if not get_option('daemon-only')
167 + manpages += [
168 + ['pacat', '1', ['paplay', 'parec', 'parecord', 'pamon']],
169 + ['pactl', '1'],
170 +@@ -31,6 +32,7 @@ if x11_dep.found()
171 + ['pax11publish', '1'],
172 + ]
173 + endif
174 ++endif
175 +
176 + # FIXME: Add esdcompat if HAVE_ESOUND
177 + #manpages += ['esdcompat', '1'],
178 +diff --git a/meson.build b/meson.build
179 +index d1c419ac2..b610a159c 100644
180 +--- a/meson.build
181 ++++ b/meson.build
182 +@@ -53,6 +53,8 @@ libpulse_mainloop_glib_version = '@0@.@1@.@2@'.format(
183 + libpulse_mainloop_glib_version_info[1],
184 + )
185 +
186 ++i18n = import('i18n')
187 ++
188 + # Paths
189 +
190 + prefix = get_option('prefix')
191 +@@ -68,6 +70,7 @@ localedir = join_paths(prefix, get_option('localedir'))
192 + localstatedir = join_paths(prefix, get_option('localstatedir'))
193 + sysconfdir = join_paths(prefix, get_option('sysconfdir'))
194 + privlibdir = join_paths(libdir, 'pulseaudio')
195 ++po_dir = join_paths(meson.current_source_dir(), 'po')
196 +
197 + if host_machine.system() == 'windows'
198 + # Windows only supports loading libraries from the same dir as the executable
199 +@@ -796,20 +799,28 @@ check_dep = dependency('check', version : '>= 0.9.10', required : get_option('te
200 + if get_option('doxygen')
201 + subdir('doxygen')
202 + endif
203 +-subdir('po')
204 ++if not get_option('daemon-only')
205 ++ subdir('po')
206 ++endif
207 + if get_option('man')
208 + subdir('man')
209 + endif
210 + subdir('shell-completion/bash')
211 +-subdir('shell-completion/zsh')
212 ++if not get_option('daemon-only')
213 ++ subdir('shell-completion/zsh')
214 ++endif
215 + subdir('src')
216 +-subdir('vala')
217 ++if not get_option('daemon-only')
218 ++ subdir('vala')
219 ++endif
220 +
221 + # Now generate config.h from everything above
222 + configure_file(output : 'config.h', configuration : cdata)
223 +
224 + # pkg-config files
225 +
226 ++if not get_option('daemon-only')
227 ++
228 + pc_cdata = configuration_data()
229 +
230 + pc_cdata.set('prefix', prefix)
231 +@@ -842,8 +853,12 @@ foreach file : pc_files
232 + install_dir : pkgconfigdir)
233 + endforeach
234 +
235 ++endif # !daemon-only
236 ++
237 + # CMake files
238 +
239 ++if not get_option('daemon-only')
240 ++
241 + m4 = find_program('m4', required: true)
242 +
243 + cmakedir = join_paths(libdir, 'cmake', 'PulseAudio')
244 +@@ -872,6 +887,8 @@ configure_file(
245 + install_dir : cmakedir,
246 + )
247 +
248 ++endif # !daemon-only
249 ++
250 + ############################################################
251 +
252 + # Final summary
253 +diff --git a/meson_options.txt b/meson_options.txt
254 +index bb41a42a7..62828ac5c 100644
255 +--- a/meson_options.txt
256 ++++ b/meson_options.txt
257 +@@ -1,6 +1,9 @@
258 + option('daemon',
259 + type : 'boolean', value : true,
260 + description : 'Enable building and installation of pulseaudio daemon and supporting configuration files')
261 ++option('daemon-only',
262 ++ type : 'boolean', value : false,
263 ++ description : 'Build and install only the pulseaudio daemon and supporting configuration files, relying on a system installation of libpulse')
264 + option('doxygen',
265 + type : 'boolean', value : true,
266 + description : 'Enable building and installation of documentation generated with doxygen')
267 +diff --git a/po/meson.build b/po/meson.build
268 +index 34278db47..33429373c 100644
269 +--- a/po/meson.build
270 ++++ b/po/meson.build
271 +@@ -1,4 +1,3 @@
272 +-i18n = import('i18n')
273 + i18n.gettext(
274 + meson.project_name(),
275 + preset: 'glib',
276 +@@ -7,5 +6,3 @@ i18n.gettext(
277 + args: ['--msgid-bugs-address=https://gitlab.freedesktop.org/pulseaudio/pulseaudio/issues/new',
278 + '--width=90'],
279 + )
280 +-
281 +-po_dir = meson.current_source_dir()
282 +diff --git a/shell-completion/bash/meson.build b/shell-completion/bash/meson.build
283 +index 3ba5cb16f..83d90b94b 100644
284 +--- a/shell-completion/bash/meson.build
285 ++++ b/shell-completion/bash/meson.build
286 +@@ -8,6 +8,7 @@ if bashcompletiondir != 'no'
287 + ]
288 + endif
289 +
290 ++ if not get_option('daemon-only')
291 + aliases += [
292 + 'pacat',
293 + 'pactl',
294 +@@ -16,6 +17,7 @@ if bashcompletiondir != 'no'
295 + 'parec',
296 + 'parecord',
297 + ]
298 ++ endif
299 +
300 + install_data('pulseaudio', install_dir : bashcompletiondir)
301 +
302 +diff --git a/src/daemon/meson.build b/src/daemon/meson.build
303 +index 262e193b2..e8f70a453 100644
304 +--- a/src/daemon/meson.build
305 ++++ b/src/daemon/meson.build
306 +@@ -30,8 +30,8 @@ executable('pulseaudio',
307 + install_rpath : privlibdir,
308 + include_directories : [configinc, topinc],
309 + link_args : ['-ffast-math'],
310 +- link_with : [libpulsecore, libpulsecommon, libpulse],
311 +- dependencies : [ltdl_dep, cap_dep, dbus_dep, libsystemd_dep, dl_dep, libintl_dep, platform_dep, platform_socket_dep],
312 ++ link_with : [libpulsecore],
313 ++ dependencies : [ltdl_dep, cap_dep, dbus_dep, libsystemd_dep, dl_dep, libintl_dep, platform_dep, platform_socket_dep, libpulsecommon_dep, libpulse_dep],
314 + c_args : pa_c_args,
315 + )
316 +
317 +diff --git a/src/meson.build b/src/meson.build
318 +index 59a9b16bf..ce56dbfe3 100644
319 +--- a/src/meson.build
320 ++++ b/src/meson.build
321 +@@ -186,6 +186,15 @@ else
322 + endif
323 + # FIXME: Do SIMD things
324 +
325 ++if get_option('daemon-only')
326 ++ libpulsecommon_dep = cc.find_library('pulsecommon-' + pa_version_major_minor, dirs : privlibdir, required : true)
327 ++ libpulse_dep = dependency('libpulse', required : true)
328 ++ libpulse_simple_dep = dependency('libpulse-simple', required : true)
329 ++ if glib_dep.found()
330 ++ libpulse_mainloop_glib_dep = dependency('libpulse-mainloop-glib', required : true)
331 ++ endif
332 ++else
333 ++
334 + libpulsecommon = shared_library('pulsecommon-' + pa_version_major_minor,
335 + libpulsecommon_sources,
336 + libpulsecommon_headers,
337 +@@ -205,6 +214,8 @@ libpulsecommon = shared_library('pulsecommon-' + pa_version_major_minor,
338 + libpulsecommon_dep = declare_dependency(link_with: libpulsecommon)
339 +
340 + subdir('pulse')
341 ++endif
342 ++
343 + if get_option('daemon')
344 + subdir('pulsecore')
345 + subdir('daemon')
346 +diff --git a/src/modules/gsettings/meson.build b/src/modules/gsettings/meson.build
347 +index 68a72c3ff..9604699e7 100644
348 +--- a/src/modules/gsettings/meson.build
349 ++++ b/src/modules/gsettings/meson.build
350 +@@ -8,8 +8,7 @@ gsettings_helper = executable('gsettings-helper',
351 + gsettings_helper_sources,
352 + c_args : pa_c_args,
353 + include_directories : [configinc, topinc],
354 +- link_with : [libpulsecommon, libpulse],
355 +- dependencies : [gio_dep],
356 ++ dependencies : [gio_dep, libpulsecommon_dep, libpulse_dep],
357 + install_dir : pulselibexecdir,
358 + install_rpath : privlibdir,
359 + install : true,
360 +diff --git a/src/tests/meson.build b/src/tests/meson.build
361 +index acd301037..56d71299f 100644
362 +--- a/src/tests/meson.build
363 ++++ b/src/tests/meson.build
364 +@@ -20,8 +20,6 @@ default_tests += [
365 + [ check_dep, libpulse_dep, libpulsecommon_dep ] ],
366 + [ 'json-test', 'json-test.c',
367 + [ check_dep, libpulse_dep, libpulsecommon_dep ] ],
368 +- [ 'mainloop-test', 'mainloop-test.c',
369 +- [ check_dep, libpulse_dep, libpulsecommon_dep ] ],
370 + [ 'proplist-test', 'proplist-test.c',
371 + [ check_dep, libpulse_dep, libpulsecommon_dep ] ],
372 + [ 'thread-mainloop-test', 'thread-mainloop-test.c',
373 +@@ -32,6 +30,13 @@ default_tests += [
374 + [ check_dep, libm_dep, libpulse_dep, libpulsecommon_dep ] ],
375 + ]
376 +
377 ++if not get_option('daemon-only')
378 ++ default_tests += [
379 ++ [ 'mainloop-test', 'mainloop-test.c',
380 ++ [ check_dep, libpulse_dep, libpulsecommon_dep ] ],
381 ++ ]
382 ++endif
383 ++
384 + if get_option('daemon')
385 + default_tests += [
386 + [ 'asyncmsgq-test', 'asyncmsgq-test.c',
387 +diff --git a/src/utils/meson.build b/src/utils/meson.build
388 +index c9635fdb6..7ed6e738f 100644
389 +--- a/src/utils/meson.build
390 ++++ b/src/utils/meson.build
391 +@@ -1,3 +1,4 @@
392 ++if not get_option('daemon-only')
393 + pacat_sources = [
394 + 'pacat.c',
395 + ]
396 +@@ -41,6 +42,7 @@ executable('pactl',
397 + dependencies : [sndfile_dep, libintl_dep],
398 + c_args : pa_c_args,
399 + )
400 ++endif
401 +
402 + if get_option('daemon')
403 + if host_machine.system() != 'windows'
404 +@@ -53,8 +55,7 @@ if get_option('daemon')
405 + install: true,
406 + install_rpath : privlibdir,
407 + include_directories : [configinc, topinc],
408 +- link_with : [libpulsecommon, libpulse],
409 +- dependencies: [libintl_dep],
410 ++ dependencies: [libintl_dep, libpulsecommon_dep, libpulse_dep],
411 + c_args : pa_c_args,
412 + )
413 +
414 +@@ -67,13 +68,13 @@ if get_option('daemon')
415 + install: true,
416 + install_rpath : privlibdir,
417 + include_directories : [configinc, topinc],
418 +- link_with : [libpulsecommon, libpulse],
419 +- dependencies: [libintl_dep],
420 ++ dependencies: [libintl_dep, libpulsecommon_dep, libpulse_dep],
421 + c_args : pa_c_args,
422 + )
423 + endif
424 + endif
425 +
426 ++if not get_option('daemon-only')
427 + if x11_dep.found()
428 + pax11publish_sources = [
429 + 'pax11publish.c',
430 +@@ -121,3 +122,4 @@ if dbus_dep.found() and fftw_dep.found()
431 + endif
432 +
433 + install_data('pa-info', install_dir : bindir)
434 ++endif
435 +--
436 +2.35.1
437 +
438 +
439 +From c3dba1988c18c59a49a2e3e3fa1451f4fa5db0ce Mon Sep 17 00:00:00 2001
440 +From: "Igor V. Kovalenko" <igor.v.kovalenko@×××××.com>
441 +Date: Thu, 4 Nov 2021 16:35:19 +0300
442 +Subject: [PATCH 3/8] build-sys: meson: change daemon-only to client
443 +
444 +Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/659>
445 +---
446 + man/meson.build | 2 +-
447 + meson.build | 14 +++++++-------
448 + meson_options.txt | 6 +++---
449 + shell-completion/bash/meson.build | 2 +-
450 + src/meson.build | 2 +-
451 + src/tests/meson.build | 2 +-
452 + src/utils/meson.build | 4 ++--
453 + 7 files changed, 16 insertions(+), 16 deletions(-)
454 +
455 +diff --git a/man/meson.build b/man/meson.build
456 +index c12ad5e6a..9b42c2a69 100644
457 +--- a/man/meson.build
458 ++++ b/man/meson.build
459 +@@ -14,7 +14,7 @@ if get_option('daemon')
460 + ]
461 + endif
462 +
463 +-if not get_option('daemon-only')
464 ++if get_option('client')
465 + manpages += [
466 + ['pacat', '1', ['paplay', 'parec', 'parecord', 'pamon']],
467 + ['pactl', '1'],
468 +diff --git a/meson.build b/meson.build
469 +index b610a159c..ded6669b1 100644
470 +--- a/meson.build
471 ++++ b/meson.build
472 +@@ -799,18 +799,18 @@ check_dep = dependency('check', version : '>= 0.9.10', required : get_option('te
473 + if get_option('doxygen')
474 + subdir('doxygen')
475 + endif
476 +-if not get_option('daemon-only')
477 ++if get_option('client')
478 + subdir('po')
479 + endif
480 + if get_option('man')
481 + subdir('man')
482 + endif
483 + subdir('shell-completion/bash')
484 +-if not get_option('daemon-only')
485 ++if get_option('client')
486 + subdir('shell-completion/zsh')
487 + endif
488 + subdir('src')
489 +-if not get_option('daemon-only')
490 ++if get_option('client')
491 + subdir('vala')
492 + endif
493 +
494 +@@ -819,7 +819,7 @@ configure_file(output : 'config.h', configuration : cdata)
495 +
496 + # pkg-config files
497 +
498 +-if not get_option('daemon-only')
499 ++if get_option('client')
500 +
501 + pc_cdata = configuration_data()
502 +
503 +@@ -853,11 +853,11 @@ foreach file : pc_files
504 + install_dir : pkgconfigdir)
505 + endforeach
506 +
507 +-endif # !daemon-only
508 ++endif # client
509 +
510 + # CMake files
511 +
512 +-if not get_option('daemon-only')
513 ++if get_option('client')
514 +
515 + m4 = find_program('m4', required: true)
516 +
517 +@@ -887,7 +887,7 @@ configure_file(
518 + install_dir : cmakedir,
519 + )
520 +
521 +-endif # !daemon-only
522 ++endif # client
523 +
524 + ############################################################
525 +
526 +diff --git a/meson_options.txt b/meson_options.txt
527 +index 62828ac5c..f7e413d1f 100644
528 +--- a/meson_options.txt
529 ++++ b/meson_options.txt
530 +@@ -1,9 +1,9 @@
531 + option('daemon',
532 + type : 'boolean', value : true,
533 + description : 'Enable building and installation of pulseaudio daemon and supporting configuration files')
534 +-option('daemon-only',
535 +- type : 'boolean', value : false,
536 +- description : 'Build and install only the pulseaudio daemon and supporting configuration files, relying on a system installation of libpulse')
537 ++option('client',
538 ++ type : 'boolean', value : true,
539 ++ description : 'Build and install pulseaudio client libraries and utilities')
540 + option('doxygen',
541 + type : 'boolean', value : true,
542 + description : 'Enable building and installation of documentation generated with doxygen')
543 +diff --git a/shell-completion/bash/meson.build b/shell-completion/bash/meson.build
544 +index 83d90b94b..1d5a8cdab 100644
545 +--- a/shell-completion/bash/meson.build
546 ++++ b/shell-completion/bash/meson.build
547 +@@ -8,7 +8,7 @@ if bashcompletiondir != 'no'
548 + ]
549 + endif
550 +
551 +- if not get_option('daemon-only')
552 ++ if get_option('client')
553 + aliases += [
554 + 'pacat',
555 + 'pactl',
556 +diff --git a/src/meson.build b/src/meson.build
557 +index ce56dbfe3..f285fdf45 100644
558 +--- a/src/meson.build
559 ++++ b/src/meson.build
560 +@@ -186,7 +186,7 @@ else
561 + endif
562 + # FIXME: Do SIMD things
563 +
564 +-if get_option('daemon-only')
565 ++if not get_option('client')
566 + libpulsecommon_dep = cc.find_library('pulsecommon-' + pa_version_major_minor, dirs : privlibdir, required : true)
567 + libpulse_dep = dependency('libpulse', required : true)
568 + libpulse_simple_dep = dependency('libpulse-simple', required : true)
569 +diff --git a/src/tests/meson.build b/src/tests/meson.build
570 +index 56d71299f..b76da26cb 100644
571 +--- a/src/tests/meson.build
572 ++++ b/src/tests/meson.build
573 +@@ -30,7 +30,7 @@ default_tests += [
574 + [ check_dep, libm_dep, libpulse_dep, libpulsecommon_dep ] ],
575 + ]
576 +
577 +-if not get_option('daemon-only')
578 ++if get_option('client')
579 + default_tests += [
580 + [ 'mainloop-test', 'mainloop-test.c',
581 + [ check_dep, libpulse_dep, libpulsecommon_dep ] ],
582 +diff --git a/src/utils/meson.build b/src/utils/meson.build
583 +index 7ed6e738f..f67cff4a9 100644
584 +--- a/src/utils/meson.build
585 ++++ b/src/utils/meson.build
586 +@@ -1,4 +1,4 @@
587 +-if not get_option('daemon-only')
588 ++if get_option('client')
589 + pacat_sources = [
590 + 'pacat.c',
591 + ]
592 +@@ -74,7 +74,7 @@ if get_option('daemon')
593 + endif
594 + endif
595 +
596 +-if not get_option('daemon-only')
597 ++if get_option('client')
598 + if x11_dep.found()
599 + pax11publish_sources = [
600 + 'pax11publish.c',
601 +--
602 +2.35.1
603 +
604 +
605 +From 1cb8c867c7cfff71f29f4eb508b92c5139669f33 Mon Sep 17 00:00:00 2001
606 +From: "Igor V. Kovalenko" <igor.v.kovalenko@×××××.com>
607 +Date: Thu, 4 Nov 2021 19:33:32 +0300
608 +Subject: [PATCH 4/8] build-sys: meson: Move remaining tests under daemon and
609 + client builds
610 +
611 +Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/659>
612 +---
613 + src/tests/meson.build | 126 +++++++++++++++++++++---------------------
614 + 1 file changed, 62 insertions(+), 64 deletions(-)
615 +
616 +diff --git a/src/tests/meson.build b/src/tests/meson.build
617 +index b76da26cb..05922a582 100644
618 +--- a/src/tests/meson.build
619 ++++ b/src/tests/meson.build
620 +@@ -9,32 +9,47 @@
621 +
622 + default_tests = []
623 +
624 +-default_tests += [
625 +- [ 'channelmap-test', 'channelmap-test.c',
626 +- [ check_dep, libpulse_dep ] ],
627 +- [ 'core-util-test', 'core-util-test.c',
628 +- [ check_dep, libpulse_dep, libpulsecommon_dep ] ],
629 +- [ 'get-binary-name-test', 'get-binary-name-test.c',
630 +- [ check_dep, libpulse_dep, libpulsecommon_dep ] ],
631 +- [ 'hashmap-test', 'hashmap-test.c',
632 +- [ check_dep, libpulse_dep, libpulsecommon_dep ] ],
633 +- [ 'json-test', 'json-test.c',
634 +- [ check_dep, libpulse_dep, libpulsecommon_dep ] ],
635 +- [ 'proplist-test', 'proplist-test.c',
636 +- [ check_dep, libpulse_dep, libpulsecommon_dep ] ],
637 +- [ 'thread-mainloop-test', 'thread-mainloop-test.c',
638 +- [ check_dep, libpulse_dep, libpulsecommon_dep ] ],
639 +- [ 'utf8-test', 'utf8-test.c',
640 +- [ check_dep, libpulse_dep, libpulsecommon_dep ] ],
641 +- [ 'volume-test', 'volume-test.c',
642 +- [ check_dep, libm_dep, libpulse_dep, libpulsecommon_dep ] ],
643 +-]
644 +-
645 + if get_option('client')
646 ++ default_tests += [
647 ++ [ 'channelmap-test', 'channelmap-test.c',
648 ++ [ check_dep, libpulse_dep ] ],
649 ++ [ 'core-util-test', 'core-util-test.c',
650 ++ [ check_dep, libpulse_dep, libpulsecommon_dep ] ],
651 ++ [ 'get-binary-name-test', 'get-binary-name-test.c',
652 ++ [ check_dep, libpulse_dep, libpulsecommon_dep ] ],
653 ++ [ 'hashmap-test', 'hashmap-test.c',
654 ++ [ check_dep, libpulse_dep, libpulsecommon_dep ] ],
655 ++ [ 'json-test', 'json-test.c',
656 ++ [ check_dep, libpulse_dep, libpulsecommon_dep ] ],
657 ++ [ 'proplist-test', 'proplist-test.c',
658 ++ [ check_dep, libpulse_dep, libpulsecommon_dep ] ],
659 ++ [ 'thread-mainloop-test', 'thread-mainloop-test.c',
660 ++ [ check_dep, libpulse_dep, libpulsecommon_dep ] ],
661 ++ [ 'utf8-test', 'utf8-test.c',
662 ++ [ check_dep, libpulse_dep, libpulsecommon_dep ] ],
663 ++ [ 'volume-test', 'volume-test.c',
664 ++ [ check_dep, libm_dep, libpulse_dep, libpulsecommon_dep ] ],
665 ++ ]
666 ++
667 + default_tests += [
668 + [ 'mainloop-test', 'mainloop-test.c',
669 + [ check_dep, libpulse_dep, libpulsecommon_dep ] ],
670 + ]
671 ++
672 ++ if cc.has_header('sys/eventfd.h')
673 ++ default_tests += [
674 ++ [ 'srbchannel-test', 'srbchannel-test.c',
675 ++ [ check_dep, libpulse_dep, libpulsecommon_dep ] ]
676 ++ ]
677 ++ endif
678 ++
679 ++ if glib_dep.found()
680 ++ default_tests += [
681 ++ [ 'mainloop-test-glib', 'mainloop-test.c',
682 ++ [ check_dep, glib_dep, libpulse_dep, libpulsecommon_dep, libpulse_mainloop_glib_dep ],
683 ++ [], ['-DGLIB_MAIN_LOOP'] ]
684 ++ ]
685 ++ endif
686 + endif
687 +
688 + if get_option('daemon')
689 +@@ -101,16 +116,6 @@ if get_option('daemon')
690 + ]
691 + endif
692 +
693 +-endif
694 +-
695 +-if cc.has_header('sys/eventfd.h')
696 +- default_tests += [
697 +- [ 'srbchannel-test', 'srbchannel-test.c',
698 +- [ check_dep, libpulse_dep, libpulsecommon_dep ] ]
699 +- ]
700 +-endif
701 +-
702 +-if get_option('daemon')
703 + if alsa_dep.found()
704 + default_tests += [
705 + [ 'alsa-mixer-path-test', 'alsa-mixer-path-test.c',
706 +@@ -120,23 +125,24 @@ if get_option('daemon')
707 + endif
708 + endif
709 +
710 +-if glib_dep.found()
711 +- default_tests += [
712 +- [ 'mainloop-test-glib', 'mainloop-test.c',
713 +- [ check_dep, glib_dep, libpulse_dep, libpulsecommon_dep, libpulse_mainloop_glib_dep ],
714 +- [], ['-DGLIB_MAIN_LOOP'] ]
715 +- ]
716 +-endif
717 +-
718 + # No-run tests
719 + norun_tests = []
720 +
721 +-norun_tests += [
722 +- [ 'pacat-simple', 'pacat-simple.c',
723 +- [ libpulse_dep, libpulse_simple_dep ] ],
724 +- [ 'parec-simple', 'parec-simple.c',
725 +- [ libpulse_dep, libpulse_simple_dep ] ],
726 +-]
727 ++if get_option('client')
728 ++ norun_tests += [
729 ++ [ 'pacat-simple', 'pacat-simple.c',
730 ++ [ libpulse_dep, libpulse_simple_dep ] ],
731 ++ [ 'parec-simple', 'parec-simple.c',
732 ++ [ libpulse_dep, libpulse_simple_dep ] ],
733 ++ ]
734 ++
735 ++ if gtk_dep.found() and glib_dep.found()
736 ++ norun_tests += [
737 ++ [ 'gtk-test', 'gtk-test.c',
738 ++ [ gtk_dep, libpulse_dep, libpulse_mainloop_glib_dep ] ]
739 ++ ]
740 ++ endif
741 ++endif
742 +
743 + if get_option('daemon')
744 + norun_tests += [
745 +@@ -182,26 +188,18 @@ if get_option('daemon')
746 + ]
747 + endif
748 +
749 +-endif
750 +-
751 +-if cc.has_function('pthread_setaffinity_np', dependencies : thread_dep)
752 +- norun_tests += [
753 +- [ 'atomic-test', 'atomic-test.c',
754 +- [ check_dep, libpulsecommon_dep, thread_dep ] ]
755 +- ]
756 +-endif
757 +-
758 +-if alsa_dep.found()
759 +- norun_tests += [
760 +- [ 'alsa-time-test', 'alsa-time-test.c', [ alsa_dep, thread_dep ] ]
761 +- ]
762 +-endif
763 ++ if cc.has_function('pthread_setaffinity_np', dependencies : thread_dep)
764 ++ norun_tests += [
765 ++ [ 'atomic-test', 'atomic-test.c',
766 ++ [ check_dep, libpulsecommon_dep, thread_dep ] ]
767 ++ ]
768 ++ endif
769 +
770 +-if gtk_dep.found() and glib_dep.found()
771 +- norun_tests += [
772 +- [ 'gtk-test', 'gtk-test.c',
773 +- [ gtk_dep, libpulse_dep, libpulse_mainloop_glib_dep ] ]
774 +- ]
775 ++ if alsa_dep.found()
776 ++ norun_tests += [
777 ++ [ 'alsa-time-test', 'alsa-time-test.c', [ alsa_dep, thread_dep ] ]
778 ++ ]
779 ++ endif
780 + endif
781 +
782 + # Generate tests
783 +--
784 +2.35.1
785 +
786 +
787 +From c283edc0bac45b2f5efba810e2ccd1d37b54b2ae Mon Sep 17 00:00:00 2001
788 +From: "Igor V. Kovalenko" <igor.v.kovalenko@×××××.com>
789 +Date: Thu, 4 Nov 2021 20:12:03 +0300
790 +Subject: [PATCH 5/8] build-sys: meson: Rearrange dependencies under client and
791 + daemon options
792 +
793 +Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/659>
794 +---
795 + meson.build | 492 +++++++++++++++++++++++++-----------------------
796 + src/meson.build | 3 -
797 + 2 files changed, 258 insertions(+), 237 deletions(-)
798 +
799 +diff --git a/meson.build b/meson.build
800 +index ded6669b1..3afc31c9b 100644
801 +--- a/meson.build
802 ++++ b/meson.build
803 +@@ -568,227 +568,237 @@ if host_machine.cpu_family() == 'arm'
804 + endif
805 + # NEON checks are automatically done by the unstable-simd module
806 +
807 +-if get_option('daemon')
808 +- # FIXME: make sure it's >= 2.2
809 +- ltdl_dep = cc.find_library('ltdl', required : true)
810 +-endif
811 +-
812 +-# FIXME: can meson support libtool -dlopen/-dlpreopen things?
813 +-# and do we still want to support this at all?
814 +-cdata.set('DISABLE_LIBTOOL_PRELOAD', 1)
815 +-
816 +-if get_option('database') == 'tdb'
817 +- database_dep = dependency('tdb')
818 +-elif get_option('database') == 'gdbm'
819 +- database_dep = cc.find_library('gdbm', required : true)
820 +-else
821 +- database_dep = dependency('', required: false)
822 +-endif
823 ++# Dependencies common to client, daemon and modules
824 +
825 + if get_option('ipv6')
826 + cdata.set('HAVE_IPV6', 1)
827 + endif
828 +
829 +-if get_option('legacy-database-entry-format')
830 +- cdata.set('ENABLE_LEGACY_DATABASE_ENTRY_FORMAT', 1)
831 +-endif
832 +-
833 +-if get_option('stream-restore-clear-old-devices')
834 +- cdata.set('STREAM_RESTORE_CLEAR_OLD_DEVICES', 1)
835 +-endif
836 +-
837 +-if get_option('running-from-build-tree')
838 +- cdata.set('HAVE_RUNNING_FROM_BUILD_TREE', 1)
839 +-endif
840 +-
841 +-alsa_dep = dependency('alsa', version : '>= 1.0.24', required : get_option('alsa'))
842 +-if alsa_dep.found()
843 +- cdata.set('HAVE_ALSA', 1)
844 +- cdata.set('HAVE_ALSA_UCM', 1)
845 +-endif
846 +-
847 +-asyncns_dep = dependency('libasyncns', version : '>= 0.1', required : get_option('asyncns'))
848 +-if asyncns_dep.found()
849 +- cdata.set('HAVE_LIBASYNCNS', 1)
850 +-endif
851 +-
852 + dbus_dep = dependency('dbus-1', version : '>= 1.4.12', required : get_option('dbus'))
853 + if dbus_dep.found()
854 + cdata.set('HAVE_DBUS', 1)
855 + endif
856 +
857 +-gio_dep = dependency('gio-2.0', version : '>= 2.26.0')
858 +-if get_option('gsettings').enabled()
859 +- assert(gio_dep.found(), 'GSettings support needs glib I/O library (GIO)')
860 +- cdata.set('HAVE_GSETTINGS', 1)
861 +-else
862 +- cdata.set('HAVE_GSETTINGS', 0)
863 +-endif
864 +-
865 +-glib_dep = dependency('glib-2.0', version : '>= 2.28.0', required: get_option('glib'))
866 +-if glib_dep.found()
867 +- cdata.set('HAVE_GLIB', 1)
868 +-endif
869 +-
870 +-gtk_dep = dependency('gtk+-3.0', required : get_option('gtk'))
871 +-if gtk_dep.found()
872 +- cdata.set('HAVE_GTK', 1)
873 +-endif
874 +-
875 +-have_orcc = false
876 +-orcc_args = []
877 +-orc_dep = dependency('orc-0.4', version : '>= 0.4.11', required : get_option('orc'))
878 +-orcc = find_program('orcc', required : get_option('orc'))
879 +-if orc_dep.found() and orcc.found()
880 +- have_orcc = true
881 +- orcc_args = [orcc]
882 +- #orcc_args = [orcc, '--include', 'glib.h']
883 +- cdata.set('HAVE_ORC', 1)
884 +-else
885 +- cdata.set('DISABLE_ORC', 1)
886 +-endif
887 +-
888 +-samplerate_dep = dependency('samplerate', version : '>= 0.1.0', required : get_option('samplerate'))
889 +-if samplerate_dep.found()
890 +- cdata.set('HAVE_LIBSAMPLERATE', 1)
891 +-endif
892 +-
893 + sndfile_dep = dependency('sndfile', version : '>= 1.0.20')
894 +
895 +-soxr_dep = dependency('soxr', version : '>= 0.1.1', required : get_option('soxr'))
896 +-if soxr_dep.found()
897 +- cdata.set('HAVE_SOXR', 1)
898 +-endif
899 +-
900 + libsystemd_dep = dependency('libsystemd', required : get_option('systemd'))
901 + if libsystemd_dep.found()
902 + cdata.set('HAVE_SYSTEMD_DAEMON', 1)
903 + cdata.set('HAVE_SYSTEMD_LOGIN', 1)
904 + cdata.set('HAVE_SYSTEMD_JOURNAL', 1)
905 + endif
906 +-systemd_dep = dependency('systemd', required : get_option('systemd'))
907 +-if systemd_dep.found() and systemduserunitdir == ''
908 +- systemduserunitdir = systemd_dep.get_pkgconfig_variable('systemduserunitdir')
909 +-endif
910 +-
911 +-libelogind_dep = dependency('libelogind', required : get_option('elogind'))
912 +-if libelogind_dep.found()
913 +- cdata.set('HAVE_SYSTEMD_LOGIN', 1)
914 +-endif
915 +-
916 +-tcpwrap_dep = cc.find_library('wrap', required: get_option('tcpwrap'))
917 +-if cc.has_header('tcpd.h') and cc.has_function('hosts_access', dependencies : tcpwrap_dep)
918 +- cdata.set('HAVE_LIBWRAP', 1)
919 +-endif
920 +
921 + x11_dep = dependency('x11-xcb', required : get_option('x11'))
922 +-if x11_dep.found()
923 +- xcb_dep = dependency('xcb', required : true, version : '>= 1.6')
924 +- ice_dep = dependency('ice', required : get_option('daemon'))
925 +- sm_dep = dependency('sm', required : get_option('daemon'))
926 +- xtst_dep = dependency('xtst', required : get_option('daemon'))
927 +- cdata.set('HAVE_X11', 1)
928 +- if cc.has_function('XSetIOErrorExitHandler', dependencies: x11_dep)
929 +- cdata.set('HAVE_XSETIOERROREXITHANDLER', 1)
930 +- endif
931 +-endif
932 +
933 +-# Module dependencies
934 ++# OSS support
935 + if cc.has_header('sys/soundcard.h', required: get_option('oss-output'))
936 ++ # OSS output via daemon module-detect
937 + cdata.set('HAVE_OSS_OUTPUT', 1)
938 ++ # OSS wrapper
939 + cdata.set('HAVE_OSS_WRAPPER', 1)
940 + cdata.set('PULSEDSP_LOCATION', pulsedsp_location)
941 + endif
942 +
943 +-if get_option('hal-compat')
944 +- cdata.set('HAVE_HAL_COMPAT', 1)
945 +-endif
946 ++# Client library dependencies
947 +
948 +-avahi_dep = dependency('avahi-client', version : '>= 0.6.0', required : get_option('avahi'), disabler : true)
949 +-if avahi_dep.found()
950 +- cdata.set('HAVE_AVAHI', 1)
951 +-else
952 +- cdata.set('HAVE_AVAHI', 0)
953 ++if get_option('client')
954 ++ asyncns_dep = dependency('libasyncns', version : '>= 0.1', required : get_option('asyncns'))
955 ++ if asyncns_dep.found()
956 ++ cdata.set('HAVE_LIBASYNCNS', 1)
957 ++ endif
958 ++
959 ++ glib_dep = dependency('glib-2.0', version : '>= 2.28.0', required: get_option('glib'))
960 ++ if glib_dep.found()
961 ++ cdata.set('HAVE_GLIB', 1)
962 ++ cdata.set('HAVE_GLIB20', 1) # to match the AM_CONDITIONAL for CMake file generation
963 ++ endif
964 ++
965 ++ gtk_dep = dependency('gtk+-3.0', required : get_option('gtk'))
966 ++ if gtk_dep.found()
967 ++ cdata.set('HAVE_GTK', 1)
968 ++ endif
969 + endif
970 +
971 +-sbc_dep = dependency('sbc', version : '>= 1.0', required : false)
972 ++# Daemon and module dependencies
973 +
974 +-bluez_dep = dependency('bluez', required : get_option('bluez5'))
975 ++if get_option('daemon')
976 ++ # FIXME: make sure it's >= 2.2
977 ++ ltdl_dep = cc.find_library('ltdl', required : true)
978 +
979 +-if bluez_dep.found()
980 +- assert(dbus_dep.found(), 'BlueZ requires D-Bus support')
981 +- assert(sbc_dep.found(), 'BlueZ requires SBC support')
982 +- cdata.set('HAVE_SBC', 1)
983 +- cdata.set('HAVE_BLUEZ', 1)
984 +- cdata.set('HAVE_BLUEZ_5', 1)
985 +- if get_option('bluez5-native-headset')
986 +- cdata.set('HAVE_BLUEZ_5_NATIVE_HEADSET', 1)
987 ++ # FIXME: can meson support libtool -dlopen/-dlpreopen things?
988 ++ # and do we still want to support this at all?
989 ++ cdata.set('DISABLE_LIBTOOL_PRELOAD', 1)
990 ++
991 ++ if get_option('database') == 'tdb'
992 ++ database_dep = dependency('tdb')
993 ++ elif get_option('database') == 'gdbm'
994 ++ database_dep = cc.find_library('gdbm', required : true)
995 ++ else
996 ++ database_dep = dependency('', required: false)
997 + endif
998 +- if get_option('bluez5-ofono-headset')
999 +- cdata.set('HAVE_BLUEZ_5_OFONO_HEADSET', 1)
1000 ++
1001 ++ if get_option('legacy-database-entry-format')
1002 ++ cdata.set('ENABLE_LEGACY_DATABASE_ENTRY_FORMAT', 1)
1003 + endif
1004 +-endif
1005 +
1006 +-fftw_dep = dependency('fftw3f', required : get_option('fftw'))
1007 +-if fftw_dep.found()
1008 +- cdata.set('HAVE_FFTW', 1)
1009 +-endif
1010 ++ if get_option('stream-restore-clear-old-devices')
1011 ++ cdata.set('STREAM_RESTORE_CLEAR_OLD_DEVICES', 1)
1012 ++ endif
1013 +
1014 +-jack_dep = dependency('jack', version : '>= 0.117.0', required : get_option('jack'))
1015 +-if jack_dep.found()
1016 +- cdata.set('HAVE_JACK', 1)
1017 +-endif
1018 ++ if get_option('running-from-build-tree')
1019 ++ cdata.set('HAVE_RUNNING_FROM_BUILD_TREE', 1)
1020 ++ endif
1021 +
1022 +-lirc_dep = dependency('lirc', required : get_option('lirc'))
1023 +-if lirc_dep.found()
1024 +- cdata.set('HAVE_LIRC', 1)
1025 +-endif
1026 ++ alsa_dep = dependency('alsa', version : '>= 1.0.24', required : get_option('alsa'))
1027 ++ if alsa_dep.found()
1028 ++ cdata.set('HAVE_ALSA', 1)
1029 ++ cdata.set('HAVE_ALSA_UCM', 1)
1030 ++ endif
1031 +
1032 +-openssl_dep = dependency('openssl', version : '>= 0.9', required : get_option('openssl'))
1033 +-if openssl_dep.found()
1034 +- cdata.set('HAVE_OPENSSL', 1)
1035 +-endif
1036 ++ gio_dep = dependency('gio-2.0', version : '>= 2.26.0')
1037 ++ if get_option('gsettings').enabled()
1038 ++ assert(gio_dep.found(), 'GSettings support needs glib I/O library (GIO)')
1039 ++ cdata.set('HAVE_GSETTINGS', 1)
1040 ++ else
1041 ++ cdata.set('HAVE_GSETTINGS', 0)
1042 ++ endif
1043 +
1044 +-speex_dep = dependency('speexdsp', version : '>= 1.2', required : get_option('speex'))
1045 +-if speex_dep.found()
1046 +- cdata.set('HAVE_SPEEX', 1)
1047 +-endif
1048 ++ have_orcc = false
1049 ++ orcc_args = []
1050 ++ orc_dep = dependency('orc-0.4', version : '>= 0.4.11', required : get_option('orc'))
1051 ++ orcc = find_program('orcc', required : get_option('orc'))
1052 ++ if orc_dep.found() and orcc.found()
1053 ++ have_orcc = true
1054 ++ orcc_args = [orcc]
1055 ++ #orcc_args = [orcc, '--include', 'glib.h']
1056 ++ cdata.set('HAVE_ORC', 1)
1057 ++ else
1058 ++ cdata.set('DISABLE_ORC', 1)
1059 ++ endif
1060 +
1061 +-udev_dep = dependency('libudev', version : '>= 143', required : get_option('udev'))
1062 +-if udev_dep.found()
1063 +- cdata.set('HAVE_UDEV', 1)
1064 +-endif
1065 ++ samplerate_dep = dependency('samplerate', version : '>= 0.1.0', required : get_option('samplerate'))
1066 ++ if samplerate_dep.found()
1067 ++ cdata.set('HAVE_LIBSAMPLERATE', 1)
1068 ++ endif
1069 +
1070 +-webrtc_dep = dependency('webrtc-audio-processing', version : '>= 0.2', required : get_option('webrtc-aec'))
1071 +-if webrtc_dep.found()
1072 +- cdata.set('HAVE_WEBRTC', 1)
1073 +-endif
1074 ++ speex_dep = dependency('speexdsp', version : '>= 1.2', required : get_option('speex'))
1075 ++ if speex_dep.found()
1076 ++ cdata.set('HAVE_SPEEX', 1)
1077 ++ endif
1078 +
1079 +-gst_dep = dependency('gstreamer-1.0', version : '>= 1.14', required : get_option('gstreamer'))
1080 +-gstapp_dep = dependency('gstreamer-app-1.0', required : get_option('gstreamer'))
1081 +-gstrtp_dep = dependency('gstreamer-rtp-1.0', required : get_option('gstreamer'))
1082 ++ soxr_dep = dependency('soxr', version : '>= 0.1.1', required : get_option('soxr'))
1083 ++ if soxr_dep.found()
1084 ++ cdata.set('HAVE_SOXR', 1)
1085 ++ endif
1086 +
1087 +-have_gstreamer = false
1088 +-if gst_dep.found() and gstapp_dep.found() and gstrtp_dep.found()
1089 +- assert(gio_dep.found(), 'GStreamer-based RTP needs glib I/O library (GIO)')
1090 +- have_gstreamer = true
1091 +-endif
1092 ++ webrtc_dep = dependency('webrtc-audio-processing', version : '>= 0.2', required : get_option('webrtc-aec'))
1093 ++ if webrtc_dep.found()
1094 ++ cdata.set('HAVE_WEBRTC', 1)
1095 ++ endif
1096 +
1097 +-bluez5_gst_dep = dependency('gstreamer-1.0', version : '>= 1.14', required : get_option('bluez5-gstreamer'))
1098 +-bluez5_gstapp_dep = dependency('gstreamer-app-1.0', required : get_option('bluez5-gstreamer'))
1099 +-have_bluez5_gstreamer = false
1100 +-if bluez5_gst_dep.found() and bluez5_gstapp_dep.found()
1101 +- have_bluez5_gstreamer = true
1102 +- cdata.set('HAVE_GSTLDAC', 1)
1103 +- cdata.set('HAVE_GSTAPTX', 1)
1104 ++ systemd_dep = dependency('systemd', required : get_option('systemd'))
1105 ++ if systemd_dep.found() and systemduserunitdir == ''
1106 ++ systemduserunitdir = systemd_dep.get_pkgconfig_variable('systemduserunitdir')
1107 ++ endif
1108 ++
1109 ++ libelogind_dep = dependency('libelogind', required : get_option('elogind'))
1110 ++ if libelogind_dep.found()
1111 ++ cdata.set('HAVE_SYSTEMD_LOGIN', 1)
1112 ++ endif
1113 ++
1114 ++ tcpwrap_dep = cc.find_library('wrap', required: get_option('tcpwrap'))
1115 ++ if cc.has_header('tcpd.h') and cc.has_function('hosts_access', dependencies : tcpwrap_dep)
1116 ++ cdata.set('HAVE_LIBWRAP', 1)
1117 ++ endif
1118 ++
1119 ++ if x11_dep.found()
1120 ++ xcb_dep = dependency('xcb', required : true, version : '>= 1.6')
1121 ++ ice_dep = dependency('ice', required : true)
1122 ++ sm_dep = dependency('sm', required : true)
1123 ++ xtst_dep = dependency('xtst', required : true)
1124 ++ cdata.set('HAVE_X11', 1)
1125 ++ if cc.has_function('XSetIOErrorExitHandler', dependencies: x11_dep)
1126 ++ cdata.set('HAVE_XSETIOERROREXITHANDLER', 1)
1127 ++ endif
1128 ++ endif
1129 ++
1130 ++ avahi_dep = dependency('avahi-client', version : '>= 0.6.0', required : get_option('avahi'), disabler : true)
1131 ++ if avahi_dep.found()
1132 ++ cdata.set('HAVE_AVAHI', 1)
1133 ++ else
1134 ++ cdata.set('HAVE_AVAHI', 0)
1135 ++ endif
1136 ++
1137 ++ sbc_dep = dependency('sbc', version : '>= 1.0', required : false)
1138 ++
1139 ++ bluez_dep = dependency('bluez', required : get_option('bluez5'))
1140 ++
1141 ++ if bluez_dep.found()
1142 ++ assert(dbus_dep.found(), 'BlueZ requires D-Bus support')
1143 ++ assert(sbc_dep.found(), 'BlueZ requires SBC support')
1144 ++ cdata.set('HAVE_SBC', 1)
1145 ++ cdata.set('HAVE_BLUEZ', 1)
1146 ++ cdata.set('HAVE_BLUEZ_5', 1)
1147 ++ if get_option('bluez5-native-headset')
1148 ++ cdata.set('HAVE_BLUEZ_5_NATIVE_HEADSET', 1)
1149 ++ endif
1150 ++ if get_option('bluez5-ofono-headset')
1151 ++ cdata.set('HAVE_BLUEZ_5_OFONO_HEADSET', 1)
1152 ++ endif
1153 ++ endif
1154 ++
1155 ++ fftw_dep = dependency('fftw3f', required : get_option('fftw'))
1156 ++ if fftw_dep.found()
1157 ++ cdata.set('HAVE_FFTW', 1)
1158 ++ endif
1159 ++
1160 ++ jack_dep = dependency('jack', version : '>= 0.117.0', required : get_option('jack'))
1161 ++ if jack_dep.found()
1162 ++ cdata.set('HAVE_JACK', 1)
1163 ++ endif
1164 ++
1165 ++ lirc_dep = dependency('lirc', required : get_option('lirc'))
1166 ++ if lirc_dep.found()
1167 ++ cdata.set('HAVE_LIRC', 1)
1168 ++ endif
1169 ++
1170 ++ openssl_dep = dependency('openssl', version : '>= 0.9', required : get_option('openssl'))
1171 ++ if openssl_dep.found()
1172 ++ cdata.set('HAVE_OPENSSL', 1)
1173 ++ endif
1174 ++
1175 ++ udev_dep = dependency('libudev', version : '>= 143', required : get_option('udev'))
1176 ++ if udev_dep.found()
1177 ++ cdata.set('HAVE_UDEV', 1)
1178 ++ endif
1179 ++
1180 ++ if get_option('hal-compat')
1181 ++ cdata.set('HAVE_HAL_COMPAT', 1)
1182 ++ endif
1183 ++
1184 ++ gst_dep = dependency('gstreamer-1.0', version : '>= 1.14', required : get_option('gstreamer'))
1185 ++ gstapp_dep = dependency('gstreamer-app-1.0', required : get_option('gstreamer'))
1186 ++ gstrtp_dep = dependency('gstreamer-rtp-1.0', required : get_option('gstreamer'))
1187 ++
1188 ++ have_gstreamer = false
1189 ++ if gst_dep.found() and gstapp_dep.found() and gstrtp_dep.found()
1190 ++ assert(gio_dep.found(), 'GStreamer-based RTP needs glib I/O library (GIO)')
1191 ++ have_gstreamer = true
1192 ++ endif
1193 ++
1194 ++ bluez5_gst_dep = dependency('gstreamer-1.0', version : '>= 1.14', required : get_option('bluez5-gstreamer'))
1195 ++ bluez5_gstapp_dep = dependency('gstreamer-app-1.0', required : get_option('bluez5-gstreamer'))
1196 ++ have_bluez5_gstreamer = false
1197 ++ if bluez5_gst_dep.found() and bluez5_gstapp_dep.found()
1198 ++ have_bluez5_gstreamer = true
1199 ++ cdata.set('HAVE_GSTLDAC', 1)
1200 ++ cdata.set('HAVE_GSTAPTX', 1)
1201 ++ endif
1202 + endif
1203 +
1204 + # These are required for the CMake file generation
1205 + cdata.set('PA_LIBDIR', libdir)
1206 + cdata.set('PA_INCDIR', includedir)
1207 +-if glib_dep.found()
1208 +- cdata.set('HAVE_GLIB20', 1) # to match the AM_CONDITIONAL for CMake file generation
1209 +-endif
1210 +
1211 + # Test dependencies
1212 +
1213 +@@ -817,10 +827,10 @@ endif
1214 + # Now generate config.h from everything above
1215 + configure_file(output : 'config.h', configuration : cdata)
1216 +
1217 +-# pkg-config files
1218 +-
1219 + if get_option('client')
1220 +
1221 ++# pkg-config files
1222 ++
1223 + pc_cdata = configuration_data()
1224 +
1225 + pc_cdata.set('prefix', prefix)
1226 +@@ -853,12 +863,8 @@ foreach file : pc_files
1227 + install_dir : pkgconfigdir)
1228 + endforeach
1229 +
1230 +-endif # client
1231 +-
1232 + # CMake files
1233 +
1234 +-if get_option('client')
1235 +-
1236 + m4 = find_program('m4', required: true)
1237 +
1238 + cmakedir = join_paths(libdir, 'cmake', 'PulseAudio')
1239 +@@ -918,49 +924,66 @@ summary = [
1240 + # 'LIBS: @0@'.format(${LIBS}),
1241 + '',
1242 + 'Enable pulseaudio daemon: @0@'.format(get_option('daemon')),
1243 ++ 'Enable pulseaudio client: @0@'.format(get_option('client')),
1244 + '',
1245 + 'Enable memfd shared memory: @0@'.format(cdata.has('HAVE_MEMFD')),
1246 + 'Enable X11: @0@'.format(x11_dep.found()),
1247 +- ' Safe X11 I/O errors: @0@'.format(cdata.has('HAVE_XSETIOERROREXITHANDLER')),
1248 +- 'Enable OSS Output: @0@'.format(cdata.has('HAVE_OSS_OUTPUT')),
1249 ++ 'Enable D-Bus: @0@'.format(dbus_dep.found()),
1250 ++ 'Enable systemd integration: @0@'.format(libsystemd_dep.found()),
1251 ++ 'Enable IPv6: @0@'.format(get_option('ipv6')),
1252 ++ 'Enable Gcov coverage: @0@'.format(get_option('gcov')),
1253 ++ 'Enable Valgrind: @0@'.format(cdata.has('HAVE_VALGRIND_MEMCHECK_H')),
1254 ++ 'Enable man pages: @0@'.format(get_option('man')),
1255 ++ 'Enable unit tests: @0@'.format(get_option('tests')),
1256 ++]
1257 ++
1258 ++if get_option('client')
1259 ++summary += [
1260 ++ '',
1261 ++ '--- Pulseaudio client features ---',
1262 ++ '',
1263 ++ 'Enable GLib 2: @0@'.format(glib_dep.found()),
1264 ++ 'Enable Gtk+ 3: @0@'.format(gtk_dep.found()),
1265 ++ 'Enable Async DNS: @0@'.format(asyncns_dep.found()),
1266 + 'Enable OSS Wrapper: @0@'.format(cdata.has('HAVE_OSS_WRAPPER')),
1267 ++]
1268 ++endif
1269 ++
1270 ++if get_option('daemon')
1271 ++summary += [
1272 ++ '',
1273 ++ '--- Pulseaudio daemon features ---',
1274 ++ '',
1275 ++ 'Safe X11 I/O errors: @0@'.format(cdata.has('HAVE_XSETIOERROREXITHANDLER')),
1276 ++ 'Enable Avahi: @0@'.format(avahi_dep.found()),
1277 ++ 'Enable OSS Output: @0@'.format(cdata.has('HAVE_OSS_OUTPUT')),
1278 + # 'Enable EsounD: @0@'.format(${ENABLE_ESOUND}),
1279 + 'Enable Alsa: @0@'.format(alsa_dep.found()),
1280 ++ 'Enable Jack: @0@'.format(jack_dep.found()),
1281 ++ 'Enable LIRC: @0@'.format(lirc_dep.found()),
1282 + # 'Enable CoreAudio: @0@'.format(${ENABLE_COREAUDIO}),
1283 + # 'Enable Solaris: @0@'.format(${ENABLE_SOLARIS}),
1284 + # 'Enable WaveOut: @0@'.format(${ENABLE_WAVEOUT}),
1285 +- 'Enable GLib 2: @0@'.format(glib_dep.found()),
1286 + 'Enable GSettings: @0@'.format(gio_dep.found()),
1287 +- 'Enable Gtk+ 3: @0@'.format(gtk_dep.found()),
1288 +- 'Enable Avahi: @0@'.format(avahi_dep.found()),
1289 +- 'Enable Jack: @0@'.format(jack_dep.found()),
1290 +- 'Enable Async DNS: @0@'.format(asyncns_dep.found()),
1291 +- 'Enable LIRC: @0@'.format(lirc_dep.found()),
1292 +- 'Enable D-Bus: @0@'.format(dbus_dep.found()),
1293 +- ' Enable BlueZ 5: @0@'.format(cdata.has('HAVE_BLUEZ_5')),
1294 +- ' Enable native headsets: @0@'.format(cdata.has('HAVE_BLUEZ_5_NATIVE_HEADSET')),
1295 +- ' Enable ofono headsets: @0@'.format(cdata.has('HAVE_BLUEZ_5_OFONO_HEADSET')),
1296 +- ' Enable GStreamer based codecs: @0@'.format(have_bluez5_gstreamer),
1297 +- 'Enable udev: @0@'.format(udev_dep.found()),
1298 +- ' Enable HAL->udev compat: @0@'.format(get_option('hal-compat')),
1299 +- 'Enable systemd: @0@'.format(libsystemd_dep.found()),
1300 +- 'Enable elogind: @0@'.format(libelogind_dep.found()),
1301 +- 'Enable TCP Wrappers: @0@'.format(tcpwrap_dep.found()),
1302 ++ 'Enable BlueZ 5: @0@'.format(cdata.has('HAVE_BLUEZ_5')),
1303 ++ ' Enable native headsets: @0@'.format(cdata.has('HAVE_BLUEZ_5_NATIVE_HEADSET')),
1304 ++ ' Enable ofono headsets: @0@'.format(cdata.has('HAVE_BLUEZ_5_OFONO_HEADSET')),
1305 ++ ' Enable GStreamer based codecs: @0@'.format(have_bluez5_gstreamer),
1306 ++ 'Enable GStreamer: @0@'.format(have_gstreamer),
1307 + 'Enable libsamplerate: @0@'.format(samplerate_dep.found()),
1308 +- 'Enable IPv6: @0@'.format(get_option('ipv6')),
1309 +- 'Enable OpenSSL (for Airtunes): @0@'.format(openssl_dep.found()),
1310 + 'Enable FFTW: @0@'.format(fftw_dep.found()),
1311 + 'Enable ORC: @0@'.format(have_orcc),
1312 +- 'Enable GStreamer: @0@'.format(have_gstreamer),
1313 + 'Enable Adrian echo canceller: @0@'.format(get_option('adrian-aec')),
1314 + 'Enable Speex (resampler, AEC): @0@'.format(speex_dep.found()),
1315 + 'Enable SoXR (resampler): @0@'.format(soxr_dep.found()),
1316 + 'Enable WebRTC echo canceller: @0@'.format(webrtc_dep.found()),
1317 +- 'Enable Gcov coverage: @0@'.format(get_option('gcov')),
1318 +- 'Enable Valgrind: @0@'.format(cdata.has('HAVE_VALGRIND_MEMCHECK_H')),
1319 +- 'Enable man pages: @0@'.format(get_option('man')),
1320 +- 'Enable unit tests: @0@'.format(get_option('tests')),
1321 + '',
1322 ++ 'Enable udev: @0@'.format(udev_dep.found()),
1323 ++ ' Enable HAL->udev compat: @0@'.format(get_option('hal-compat')),
1324 ++ 'Enable systemd units: @0@'.format(systemd_dep.found()),
1325 ++ 'Enable elogind: @0@'.format(libelogind_dep.found()),
1326 ++ 'Enable TCP Wrappers: @0@'.format(tcpwrap_dep.found()),
1327 ++ 'Enable OpenSSL (for Airtunes): @0@'.format(openssl_dep.found()),
1328 + 'Database: @0@'.format(get_option('database')),
1329 + 'Legacy Database Entry Support: @0@'.format(get_option('legacy-database-entry-format')),
1330 + 'module-stream-restore:',
1331 +@@ -973,6 +996,7 @@ summary = [
1332 + # 'Force preopen: @0@'.format(${FORCE_PREOPEN}),
1333 + # 'Preopened modules: @0@'.format(${PREOPEN_MODS}),
1334 + ]
1335 ++endif
1336 +
1337 + message('\n '.join(summary))
1338 +
1339 +@@ -982,38 +1006,38 @@ if get_option('daemon') and not speex_dep.found() and not webrtc_dep.found() and
1340 + error('At least one echo canceller implementation must be available!')
1341 + endif
1342 +
1343 +-if samplerate_dep.found()
1344 ++if get_option('daemon') and samplerate_dep.found()
1345 + warning('Support for libsamplerate is DEPRECATED')
1346 + endif
1347 +
1348 +-if host_machine.system() != 'windows'
1349 +- if not dbus_dep.found()
1350 +- message = [
1351 +- 'You do not have D-Bus support enabled. It is strongly recommended',
1352 +- 'that you enable D-Bus support if your platform supports it.',
1353 +- 'Many parts of PulseAudio use D-Bus, from ConsoleKit interaction',
1354 +- 'to the Device Reservation Protocol to speak to JACK, Bluetooth',
1355 +- 'support and even a native control protocol for communicating and',
1356 +- 'controlling the PulseAudio daemon itself.',
1357 +- ]
1358 +- warning('\n' + '\n'.join(message))
1359 +- endif
1360 +- if host_machine.system() == 'linux' and not udev_dep.found() and get_option('daemon')
1361 +- message = [
1362 +- 'You do not have udev support enabled. It is strongly recommended',
1363 +- 'that you enable udev support if your platform supports it as it is',
1364 +- 'the primary method used to detect hardware audio devices (on Linux)',
1365 +- 'and is thus a critical part of PulseAudio on that platform.',
1366 +- ]
1367 +- warning('\n' + '\n'.join(message))
1368 +- endif
1369 +- if not speex_dep.found() and get_option('daemon')
1370 +- message = [
1371 +- 'You do not have speex support enabled. It is strongly recommended',
1372 +- 'that you enable speex support if your platform supports it as it is',
1373 +- 'the primary method used for audio resampling and is thus a critical',
1374 +- 'part of PulseAudio on that platform.',
1375 +- ]
1376 +- warning('\n' + '\n'.join(message))
1377 +- endif
1378 ++if host_machine.system() != 'windows' and not dbus_dep.found()
1379 ++ message = [
1380 ++ 'You do not have D-Bus support enabled. It is strongly recommended',
1381 ++ 'that you enable D-Bus support if your platform supports it.',
1382 ++ 'Many parts of PulseAudio use D-Bus, from ConsoleKit interaction',
1383 ++ 'to the Device Reservation Protocol to speak to JACK, Bluetooth',
1384 ++ 'support and even a native control protocol for communicating and',
1385 ++ 'controlling the PulseAudio daemon itself.',
1386 ++ ]
1387 ++ warning('\n' + '\n'.join(message))
1388 ++endif
1389 ++
1390 ++if get_option('daemon') and host_machine.system() == 'linux' and not udev_dep.found()
1391 ++ message = [
1392 ++ 'You do not have udev support enabled. It is strongly recommended',
1393 ++ 'that you enable udev support if your platform supports it as it is',
1394 ++ 'the primary method used to detect hardware audio devices (on Linux)',
1395 ++ 'and is thus a critical part of PulseAudio on that platform.',
1396 ++ ]
1397 ++ warning('\n' + '\n'.join(message))
1398 ++endif
1399 ++
1400 ++if get_option('daemon') and host_machine.system() != 'windows' and not speex_dep.found()
1401 ++ message = [
1402 ++ 'You do not have speex support enabled. It is strongly recommended',
1403 ++ 'that you enable speex support if your platform supports it as it is',
1404 ++ 'the primary method used for audio resampling and is thus a critical',
1405 ++ 'part of PulseAudio on that platform.',
1406 ++ ]
1407 ++ warning('\n' + '\n'.join(message))
1408 + endif
1409 +diff --git a/src/meson.build b/src/meson.build
1410 +index f285fdf45..956350afb 100644
1411 +--- a/src/meson.build
1412 ++++ b/src/meson.build
1413 +@@ -190,9 +190,6 @@ if not get_option('client')
1414 + libpulsecommon_dep = cc.find_library('pulsecommon-' + pa_version_major_minor, dirs : privlibdir, required : true)
1415 + libpulse_dep = dependency('libpulse', required : true)
1416 + libpulse_simple_dep = dependency('libpulse-simple', required : true)
1417 +- if glib_dep.found()
1418 +- libpulse_mainloop_glib_dep = dependency('libpulse-mainloop-glib', required : true)
1419 +- endif
1420 + else
1421 +
1422 + libpulsecommon = shared_library('pulsecommon-' + pa_version_major_minor,
1423 +--
1424 +2.35.1
1425 +
1426 +
1427 +From 75e8621ae7d3cd0bf5341def3452ffef6dbce540 Mon Sep 17 00:00:00 2001
1428 +From: "Igor V. Kovalenko" <igor.v.kovalenko@×××××.com>
1429 +Date: Fri, 5 Nov 2021 00:34:26 +0300
1430 +Subject: [PATCH 6/8] build-sys: meson: Rearrange shell completion between
1431 + daemon and client
1432 +
1433 +Rename bash completion file to pactl and install it with client build.
1434 +Completions specific to daemon are now just symlinks, create target directory
1435 +first to install them.
1436 +
1437 +Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/659>
1438 +---
1439 + meson.build | 4 +--
1440 + shell-completion/bash/meson.build | 28 +++++++++++++--------
1441 + shell-completion/bash/{pulseaudio => pactl} | 0
1442 + shell-completion/zsh/meson.build | 6 +++--
1443 + 4 files changed, 22 insertions(+), 16 deletions(-)
1444 + rename shell-completion/bash/{pulseaudio => pactl} (100%)
1445 +
1446 +diff --git a/meson.build b/meson.build
1447 +index 3afc31c9b..0c4d9689c 100644
1448 +--- a/meson.build
1449 ++++ b/meson.build
1450 +@@ -816,9 +816,7 @@ if get_option('man')
1451 + subdir('man')
1452 + endif
1453 + subdir('shell-completion/bash')
1454 +-if get_option('client')
1455 +- subdir('shell-completion/zsh')
1456 +-endif
1457 ++subdir('shell-completion/zsh')
1458 + subdir('src')
1459 + if get_option('client')
1460 + subdir('vala')
1461 +diff --git a/shell-completion/bash/meson.build b/shell-completion/bash/meson.build
1462 +index 1d5a8cdab..fb406551b 100644
1463 +--- a/shell-completion/bash/meson.build
1464 ++++ b/shell-completion/bash/meson.build
1465 +@@ -3,27 +3,33 @@ if bashcompletiondir != 'no'
1466 +
1467 + if get_option('daemon')
1468 + aliases += [
1469 ++ 'pulseaudio',
1470 + 'pacmd',
1471 + 'pasuspender',
1472 + ]
1473 ++
1474 ++ # Create target directory for symlinks
1475 ++ if meson.version().version_compare('>= 0.60.0')
1476 ++ install_emptydir(bashcompletiondir)
1477 ++ else
1478 ++ meson.add_install_script('sh', '-c', 'mkdir -p $DESTDIR@0@'.format(bashcompletiondir))
1479 ++ endif
1480 + endif
1481 +
1482 + if get_option('client')
1483 +- aliases += [
1484 +- 'pacat',
1485 +- 'pactl',
1486 +- 'padsp',
1487 +- 'paplay',
1488 +- 'parec',
1489 +- 'parecord',
1490 +- ]
1491 ++ aliases += [
1492 ++ 'pacat',
1493 ++ 'padsp',
1494 ++ 'paplay',
1495 ++ 'parec',
1496 ++ 'parecord',
1497 ++ ]
1498 ++ install_data('pactl', install_dir : bashcompletiondir)
1499 + endif
1500 +
1501 +- install_data('pulseaudio', install_dir : bashcompletiondir)
1502 +-
1503 + foreach alias : aliases
1504 + dst = join_paths(bashcompletiondir, alias)
1505 +- cmd = 'ln -fs @0@ $DESTDIR@1@'.format('pulseaudio', dst)
1506 ++ cmd = 'ln -fs @0@ $DESTDIR@1@'.format('pactl', dst)
1507 + meson.add_install_script('sh', '-c', cmd)
1508 + endforeach
1509 + endif
1510 +diff --git a/shell-completion/bash/pulseaudio b/shell-completion/bash/pactl
1511 +similarity index 100%
1512 +rename from shell-completion/bash/pulseaudio
1513 +rename to shell-completion/bash/pactl
1514 +diff --git a/shell-completion/zsh/meson.build b/shell-completion/zsh/meson.build
1515 +index 489be569c..3f133b186 100644
1516 +--- a/shell-completion/zsh/meson.build
1517 ++++ b/shell-completion/zsh/meson.build
1518 +@@ -1,3 +1,5 @@
1519 +-if zshcompletiondir != 'no'
1520 +- install_data('_pulseaudio', install_dir : zshcompletiondir)
1521 ++if get_option('client')
1522 ++ if zshcompletiondir != 'no'
1523 ++ install_data('_pulseaudio', install_dir : zshcompletiondir)
1524 ++ endif
1525 + endif
1526 +--
1527 +2.35.1
1528 +
1529 +
1530 +From 748451220c5c9dbf7110071167b830ba43eea2f0 Mon Sep 17 00:00:00 2001
1531 +From: "Igor V. Kovalenko" <igor.v.kovalenko@×××××.com>
1532 +Date: Fri, 5 Nov 2021 01:52:38 +0300
1533 +Subject: [PATCH 7/8] build-sys: meson: Fix indentation in daemon/client blocks
1534 +
1535 +Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/659>
1536 +---
1537 + man/meson.build | 28 +++----
1538 + meson.build | 110 ++++++++++++++--------------
1539 + src/meson.build | 35 +++++----
1540 + src/utils/meson.build | 166 +++++++++++++++++++++---------------------
1541 + 4 files changed, 169 insertions(+), 170 deletions(-)
1542 +
1543 +diff --git a/man/meson.build b/man/meson.build
1544 +index 9b42c2a69..d72b3cf96 100644
1545 +--- a/man/meson.build
1546 ++++ b/man/meson.build
1547 +@@ -15,23 +15,23 @@ if get_option('daemon')
1548 + endif
1549 +
1550 + if get_option('client')
1551 +-manpages += [
1552 +- ['pacat', '1', ['paplay', 'parec', 'parecord', 'pamon']],
1553 +- ['pactl', '1'],
1554 +- ['pulse-client.conf', '5'],
1555 +-]
1556 +-
1557 +-if cdata.has('HAVE_OSS_WRAPPER')
1558 + manpages += [
1559 +- ['padsp', '1'],
1560 ++ ['pacat', '1', ['paplay', 'parec', 'parecord', 'pamon']],
1561 ++ ['pactl', '1'],
1562 ++ ['pulse-client.conf', '5'],
1563 + ]
1564 +-endif
1565 +
1566 +-if x11_dep.found()
1567 +- manpages += [
1568 +- ['pax11publish', '1'],
1569 +- ]
1570 +-endif
1571 ++ if cdata.has('HAVE_OSS_WRAPPER')
1572 ++ manpages += [
1573 ++ ['padsp', '1'],
1574 ++ ]
1575 ++ endif
1576 ++
1577 ++ if x11_dep.found()
1578 ++ manpages += [
1579 ++ ['pax11publish', '1'],
1580 ++ ]
1581 ++ endif
1582 + endif
1583 +
1584 + # FIXME: Add esdcompat if HAVE_ESOUND
1585 +diff --git a/meson.build b/meson.build
1586 +index 0c4d9689c..178e0cae8 100644
1587 +--- a/meson.build
1588 ++++ b/meson.build
1589 +@@ -827,69 +827,69 @@ configure_file(output : 'config.h', configuration : cdata)
1590 +
1591 + if get_option('client')
1592 +
1593 +-# pkg-config files
1594 +-
1595 +-pc_cdata = configuration_data()
1596 +-
1597 +-pc_cdata.set('prefix', prefix)
1598 +-pc_cdata.set('exec_prefix', prefix)
1599 +-pc_cdata.set('libdir', libdir)
1600 +-pc_cdata.set('includedir', includedir)
1601 +-pc_cdata.set('modlibexecdir', modlibexecdir)
1602 +-pc_cdata.set('PACKAGE_VERSION', pa_version_str)
1603 +-pc_cdata.set('PA_MAJORMINOR', pa_version_major_minor)
1604 +-# FIXME: the line below is wrong. Currently the meson thread dep lacks documentation,
1605 +-# and doesn't allow introspection, ie. none of get_pkgconfig_variable() or
1606 +-# get_configtool_variable() work with it, so we have no way to get this flag right,
1607 +-# unless we do all the work ourselves. See current work in glib, also meson #553.
1608 +-pc_cdata.set('PTHREAD_LIBS', '-pthread')
1609 +-
1610 +-pc_files = [
1611 +- 'libpulse.pc',
1612 +- 'libpulse-simple.pc',
1613 +-]
1614 ++ # pkg-config files
1615 ++
1616 ++ pc_cdata = configuration_data()
1617 ++
1618 ++ pc_cdata.set('prefix', prefix)
1619 ++ pc_cdata.set('exec_prefix', prefix)
1620 ++ pc_cdata.set('libdir', libdir)
1621 ++ pc_cdata.set('includedir', includedir)
1622 ++ pc_cdata.set('modlibexecdir', modlibexecdir)
1623 ++ pc_cdata.set('PACKAGE_VERSION', pa_version_str)
1624 ++ pc_cdata.set('PA_MAJORMINOR', pa_version_major_minor)
1625 ++ # FIXME: the line below is wrong. Currently the meson thread dep lacks documentation,
1626 ++ # and doesn't allow introspection, ie. none of get_pkgconfig_variable() or
1627 ++ # get_configtool_variable() work with it, so we have no way to get this flag right,
1628 ++ # unless we do all the work ourselves. See current work in glib, also meson #553.
1629 ++ pc_cdata.set('PTHREAD_LIBS', '-pthread')
1630 ++
1631 ++ pc_files = [
1632 ++ 'libpulse.pc',
1633 ++ 'libpulse-simple.pc',
1634 ++ ]
1635 +
1636 +-if glib_dep.found()
1637 +- pc_files += 'libpulse-mainloop-glib.pc'
1638 +-endif
1639 ++ if glib_dep.found()
1640 ++ pc_files += 'libpulse-mainloop-glib.pc'
1641 ++ endif
1642 +
1643 +-foreach file : pc_files
1644 +- configure_file(
1645 +- input : file + '.in',
1646 +- output : file,
1647 +- configuration : pc_cdata,
1648 +- install_dir : pkgconfigdir)
1649 +-endforeach
1650 ++ foreach file : pc_files
1651 ++ configure_file(
1652 ++ input : file + '.in',
1653 ++ output : file,
1654 ++ configuration : pc_cdata,
1655 ++ install_dir : pkgconfigdir)
1656 ++ endforeach
1657 +
1658 +-# CMake files
1659 ++ # CMake files
1660 +
1661 +-m4 = find_program('m4', required: true)
1662 ++ m4 = find_program('m4', required: true)
1663 +
1664 +-cmakedir = join_paths(libdir, 'cmake', 'PulseAudio')
1665 ++ cmakedir = join_paths(libdir, 'cmake', 'PulseAudio')
1666 +
1667 +-cmake_template_file = configure_file(
1668 +- input : 'PulseAudioConfig.cmake.in',
1669 +- output : 'PulseAudioConfig.cmake.tmp',
1670 +- configuration: cdata,
1671 +-)
1672 ++ cmake_template_file = configure_file(
1673 ++ input : 'PulseAudioConfig.cmake.in',
1674 ++ output : 'PulseAudioConfig.cmake.tmp',
1675 ++ configuration: cdata,
1676 ++ )
1677 +
1678 +-custom_target('PulseAudioConfig.cmake',
1679 +- input : cmake_template_file,
1680 +- output : 'PulseAudioConfig.cmake',
1681 +- capture : true,
1682 +- command : [m4, '@INPUT@'],
1683 +- build_by_default : true,
1684 +- install : true,
1685 +- install_dir : cmakedir,
1686 +-)
1687 ++ custom_target('PulseAudioConfig.cmake',
1688 ++ input : cmake_template_file,
1689 ++ output : 'PulseAudioConfig.cmake',
1690 ++ capture : true,
1691 ++ command : [m4, '@INPUT@'],
1692 ++ build_by_default : true,
1693 ++ install : true,
1694 ++ install_dir : cmakedir,
1695 ++ )
1696 +
1697 +-configure_file(
1698 +- input : 'PulseAudioConfigVersion.cmake.in',
1699 +- output : 'PulseAudioConfigVersion.cmake',
1700 +- configuration: cdata,
1701 +- install : true,
1702 +- install_dir : cmakedir,
1703 +-)
1704 ++ configure_file(
1705 ++ input : 'PulseAudioConfigVersion.cmake.in',
1706 ++ output : 'PulseAudioConfigVersion.cmake',
1707 ++ configuration: cdata,
1708 ++ install : true,
1709 ++ install_dir : cmakedir,
1710 ++ )
1711 +
1712 + endif # client
1713 +
1714 +diff --git a/src/meson.build b/src/meson.build
1715 +index 956350afb..f191d7f0e 100644
1716 +--- a/src/meson.build
1717 ++++ b/src/meson.build
1718 +@@ -191,26 +191,25 @@ if not get_option('client')
1719 + libpulse_dep = dependency('libpulse', required : true)
1720 + libpulse_simple_dep = dependency('libpulse-simple', required : true)
1721 + else
1722 ++ libpulsecommon = shared_library('pulsecommon-' + pa_version_major_minor,
1723 ++ libpulsecommon_sources,
1724 ++ libpulsecommon_headers,
1725 ++ include_directories : [configinc, topinc],
1726 ++ c_args : [pa_c_args],
1727 ++ link_args : [nodelete_link_args],
1728 ++ install : true,
1729 ++ install_dir : privlibdir,
1730 ++ dependencies : [
1731 ++ libm_dep, thread_dep, dl_dep, shm_dep, iconv_dep, sndfile_dep, dbus_dep,
1732 ++ x11_dep, libsystemd_dep, glib_dep.partial_dependency(compile_args: true),
1733 ++ gtk_dep.partial_dependency(compile_args: true), asyncns_dep, libintl_dep,
1734 ++ platform_dep, platform_socket_dep, execinfo_dep,
1735 ++ ],
1736 ++ implicit_include_directories : false)
1737 +
1738 +-libpulsecommon = shared_library('pulsecommon-' + pa_version_major_minor,
1739 +- libpulsecommon_sources,
1740 +- libpulsecommon_headers,
1741 +- include_directories : [configinc, topinc],
1742 +- c_args : [pa_c_args],
1743 +- link_args : [nodelete_link_args],
1744 +- install : true,
1745 +- install_dir : privlibdir,
1746 +- dependencies : [
1747 +- libm_dep, thread_dep, dl_dep, shm_dep, iconv_dep, sndfile_dep, dbus_dep,
1748 +- x11_dep, libsystemd_dep, glib_dep.partial_dependency(compile_args: true),
1749 +- gtk_dep.partial_dependency(compile_args: true), asyncns_dep, libintl_dep,
1750 +- platform_dep, platform_socket_dep, execinfo_dep,
1751 +- ],
1752 +- implicit_include_directories : false)
1753 ++ libpulsecommon_dep = declare_dependency(link_with: libpulsecommon)
1754 +
1755 +-libpulsecommon_dep = declare_dependency(link_with: libpulsecommon)
1756 +-
1757 +-subdir('pulse')
1758 ++ subdir('pulse')
1759 + endif
1760 +
1761 + if get_option('daemon')
1762 +diff --git a/src/utils/meson.build b/src/utils/meson.build
1763 +index f67cff4a9..28e1fc10a 100644
1764 +--- a/src/utils/meson.build
1765 ++++ b/src/utils/meson.build
1766 +@@ -1,47 +1,47 @@
1767 + if get_option('client')
1768 +-pacat_sources = [
1769 +- 'pacat.c',
1770 +-]
1771 +-
1772 +-pacat_aliases = [
1773 +- 'pamon',
1774 +- 'paplay',
1775 +- 'parec',
1776 +- 'parecord',
1777 +-]
1778 +-
1779 +-executable('pacat',
1780 +- pacat_sources,
1781 +- install: true,
1782 +- install_rpath : privlibdir,
1783 +- include_directories : [configinc, topinc],
1784 +- link_with : [libpulsecommon, libpulse],
1785 +- dependencies : [sndfile_dep, libintl_dep],
1786 +- c_args : pa_c_args,
1787 +-)
1788 +-
1789 +-# Windows doesn't support symbolic links.
1790 +-if host_machine.system() != 'windows'
1791 +- foreach alias : pacat_aliases
1792 +- dst = join_paths(bindir, alias)
1793 +- cmd = 'ln -fs @0@ $DESTDIR@1@'.format('pacat', dst)
1794 +- meson.add_install_script('sh', '-c', cmd)
1795 +- endforeach
1796 +-endif
1797 ++ pacat_sources = [
1798 ++ 'pacat.c',
1799 ++ ]
1800 ++
1801 ++ pacat_aliases = [
1802 ++ 'pamon',
1803 ++ 'paplay',
1804 ++ 'parec',
1805 ++ 'parecord',
1806 ++ ]
1807 ++
1808 ++ executable('pacat',
1809 ++ pacat_sources,
1810 ++ install: true,
1811 ++ install_rpath : privlibdir,
1812 ++ include_directories : [configinc, topinc],
1813 ++ link_with : [libpulsecommon, libpulse],
1814 ++ dependencies : [sndfile_dep, libintl_dep],
1815 ++ c_args : pa_c_args,
1816 ++ )
1817 ++
1818 ++ # Windows doesn't support symbolic links.
1819 ++ if host_machine.system() != 'windows'
1820 ++ foreach alias : pacat_aliases
1821 ++ dst = join_paths(bindir, alias)
1822 ++ cmd = 'ln -fs @0@ $DESTDIR@1@'.format('pacat', dst)
1823 ++ meson.add_install_script('sh', '-c', cmd)
1824 ++ endforeach
1825 ++ endif
1826 +
1827 +-pactl_sources = [
1828 +- 'pactl.c',
1829 +-]
1830 +-
1831 +-executable('pactl',
1832 +- pactl_sources,
1833 +- install: true,
1834 +- install_rpath : privlibdir,
1835 +- include_directories : [configinc, topinc],
1836 +- link_with : [libpulsecommon, libpulse],
1837 +- dependencies : [sndfile_dep, libintl_dep],
1838 +- c_args : pa_c_args,
1839 +-)
1840 ++ pactl_sources = [
1841 ++ 'pactl.c',
1842 ++ ]
1843 ++
1844 ++ executable('pactl',
1845 ++ pactl_sources,
1846 ++ install: true,
1847 ++ install_rpath : privlibdir,
1848 ++ include_directories : [configinc, topinc],
1849 ++ link_with : [libpulsecommon, libpulse],
1850 ++ dependencies : [sndfile_dep, libintl_dep],
1851 ++ c_args : pa_c_args,
1852 ++ )
1853 + endif
1854 +
1855 + if get_option('daemon')
1856 +@@ -75,51 +75,51 @@ if get_option('daemon')
1857 + endif
1858 +
1859 + if get_option('client')
1860 +-if x11_dep.found()
1861 +- pax11publish_sources = [
1862 +- 'pax11publish.c',
1863 +- ]
1864 ++ if x11_dep.found()
1865 ++ pax11publish_sources = [
1866 ++ 'pax11publish.c',
1867 ++ ]
1868 +
1869 +- executable('pax11publish',
1870 +- pax11publish_sources,
1871 +- install: true,
1872 +- install_rpath : privlibdir,
1873 +- include_directories : [configinc, topinc],
1874 +- link_with : [libpulsecommon, libpulse],
1875 +- dependencies : [x11_dep, libintl_dep],
1876 +- c_args : pa_c_args,
1877 +- )
1878 +-endif
1879 ++ executable('pax11publish',
1880 ++ pax11publish_sources,
1881 ++ install: true,
1882 ++ install_rpath : privlibdir,
1883 ++ include_directories : [configinc, topinc],
1884 ++ link_with : [libpulsecommon, libpulse],
1885 ++ dependencies : [x11_dep, libintl_dep],
1886 ++ c_args : pa_c_args,
1887 ++ )
1888 ++ endif
1889 +
1890 +-if cdata.has('HAVE_OSS_WRAPPER')
1891 +- libpulsecommon_sources = [
1892 +- 'padsp.c',
1893 +- ]
1894 ++ if cdata.has('HAVE_OSS_WRAPPER')
1895 ++ libpulsecommon_sources = [
1896 ++ 'padsp.c',
1897 ++ ]
1898 +
1899 +- libpulsedsp = shared_library('pulsedsp',
1900 +- libpulsecommon_sources,
1901 +- install: true,
1902 +- install_dir : padsplibdir,
1903 +- install_rpath : privlibdir,
1904 +- include_directories : [configinc, topinc],
1905 +- link_with : [libpulsecommon, libpulse],
1906 +- link_args : [nodelete_link_args],
1907 +- dependencies: [thread_dep, dl_dep],
1908 +- c_args : [pa_c_args, '-Wno-nonnull-compare']
1909 +- )
1910 ++ libpulsedsp = shared_library('pulsedsp',
1911 ++ libpulsecommon_sources,
1912 ++ install: true,
1913 ++ install_dir : padsplibdir,
1914 ++ install_rpath : privlibdir,
1915 ++ include_directories : [configinc, topinc],
1916 ++ link_with : [libpulsecommon, libpulse],
1917 ++ link_args : [nodelete_link_args],
1918 ++ dependencies: [thread_dep, dl_dep],
1919 ++ c_args : [pa_c_args, '-Wno-nonnull-compare']
1920 ++ )
1921 +
1922 +- configure_file(
1923 +- input : 'padsp.in',
1924 +- output : 'padsp',
1925 +- configuration : cdata,
1926 +- install : true,
1927 +- install_dir : bindir,
1928 +- )
1929 +-endif
1930 ++ configure_file(
1931 ++ input : 'padsp.in',
1932 ++ output : 'padsp',
1933 ++ configuration : cdata,
1934 ++ install : true,
1935 ++ install_dir : bindir,
1936 ++ )
1937 ++ endif
1938 +
1939 +-if dbus_dep.found() and fftw_dep.found()
1940 +- install_data('qpaeq', install_dir : bindir)
1941 +-endif
1942 ++ if dbus_dep.found() and fftw_dep.found()
1943 ++ install_data('qpaeq', install_dir : bindir)
1944 ++ endif
1945 +
1946 +-install_data('pa-info', install_dir : bindir)
1947 ++ install_data('pa-info', install_dir : bindir)
1948 + endif
1949 +--
1950 +2.35.1
1951 +
1952 +
1953 +From 18a81ce6f15e3fd07ed2369f506b342f90c1908a Mon Sep 17 00:00:00 2001
1954 +From: "Igor V. Kovalenko" <igor.v.kovalenko@×××××.com>
1955 +Date: Thu, 11 Nov 2021 01:44:30 +0300
1956 +Subject: [PATCH 8/8] build-sys: meson: Make glib and fftw common dependencies
1957 +
1958 +GSettings module (daemon) requires both gio and glib, move glib to common block.
1959 +qpaeq requires fftw, move fftw to common block.
1960 +
1961 +Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/659>
1962 +---
1963 + meson.build | 26 +++++++++++++-------------
1964 + src/modules/gsettings/meson.build | 2 +-
1965 + src/modules/meson.build | 2 +-
1966 + 3 files changed, 15 insertions(+), 15 deletions(-)
1967 +
1968 +diff --git a/meson.build b/meson.build
1969 +index 178e0cae8..bb829eabc 100644
1970 +--- a/meson.build
1971 ++++ b/meson.build
1972 +@@ -579,6 +579,12 @@ if dbus_dep.found()
1973 + cdata.set('HAVE_DBUS', 1)
1974 + endif
1975 +
1976 ++glib_dep = dependency('glib-2.0', version : '>= 2.28.0', required: get_option('glib'))
1977 ++if glib_dep.found()
1978 ++ cdata.set('HAVE_GLIB', 1)
1979 ++ cdata.set('HAVE_GLIB20', 1) # to match the AM_CONDITIONAL for CMake file generation
1980 ++endif
1981 ++
1982 + sndfile_dep = dependency('sndfile', version : '>= 1.0.20')
1983 +
1984 + libsystemd_dep = dependency('libsystemd', required : get_option('systemd'))
1985 +@@ -599,6 +605,11 @@ if cc.has_header('sys/soundcard.h', required: get_option('oss-output'))
1986 + cdata.set('PULSEDSP_LOCATION', pulsedsp_location)
1987 + endif
1988 +
1989 ++fftw_dep = dependency('fftw3f', required : get_option('fftw'))
1990 ++if fftw_dep.found()
1991 ++ cdata.set('HAVE_FFTW', 1)
1992 ++endif
1993 ++
1994 + # Client library dependencies
1995 +
1996 + if get_option('client')
1997 +@@ -607,12 +618,6 @@ if get_option('client')
1998 + cdata.set('HAVE_LIBASYNCNS', 1)
1999 + endif
2000 +
2001 +- glib_dep = dependency('glib-2.0', version : '>= 2.28.0', required: get_option('glib'))
2002 +- if glib_dep.found()
2003 +- cdata.set('HAVE_GLIB', 1)
2004 +- cdata.set('HAVE_GLIB20', 1) # to match the AM_CONDITIONAL for CMake file generation
2005 +- endif
2006 +-
2007 + gtk_dep = dependency('gtk+-3.0', required : get_option('gtk'))
2008 + if gtk_dep.found()
2009 + cdata.set('HAVE_GTK', 1)
2010 +@@ -747,11 +752,6 @@ if get_option('daemon')
2011 + endif
2012 + endif
2013 +
2014 +- fftw_dep = dependency('fftw3f', required : get_option('fftw'))
2015 +- if fftw_dep.found()
2016 +- cdata.set('HAVE_FFTW', 1)
2017 +- endif
2018 +-
2019 + jack_dep = dependency('jack', version : '>= 0.117.0', required : get_option('jack'))
2020 + if jack_dep.found()
2021 + cdata.set('HAVE_JACK', 1)
2022 +@@ -927,7 +927,9 @@ summary = [
2023 + 'Enable memfd shared memory: @0@'.format(cdata.has('HAVE_MEMFD')),
2024 + 'Enable X11: @0@'.format(x11_dep.found()),
2025 + 'Enable D-Bus: @0@'.format(dbus_dep.found()),
2026 ++ 'Enable GLib 2: @0@'.format(glib_dep.found()),
2027 + 'Enable systemd integration: @0@'.format(libsystemd_dep.found()),
2028 ++ 'Enable FFTW: @0@'.format(fftw_dep.found()),
2029 + 'Enable IPv6: @0@'.format(get_option('ipv6')),
2030 + 'Enable Gcov coverage: @0@'.format(get_option('gcov')),
2031 + 'Enable Valgrind: @0@'.format(cdata.has('HAVE_VALGRIND_MEMCHECK_H')),
2032 +@@ -940,7 +942,6 @@ summary += [
2033 + '',
2034 + '--- Pulseaudio client features ---',
2035 + '',
2036 +- 'Enable GLib 2: @0@'.format(glib_dep.found()),
2037 + 'Enable Gtk+ 3: @0@'.format(gtk_dep.found()),
2038 + 'Enable Async DNS: @0@'.format(asyncns_dep.found()),
2039 + 'Enable OSS Wrapper: @0@'.format(cdata.has('HAVE_OSS_WRAPPER')),
2040 +@@ -969,7 +970,6 @@ summary += [
2041 + ' Enable GStreamer based codecs: @0@'.format(have_bluez5_gstreamer),
2042 + 'Enable GStreamer: @0@'.format(have_gstreamer),
2043 + 'Enable libsamplerate: @0@'.format(samplerate_dep.found()),
2044 +- 'Enable FFTW: @0@'.format(fftw_dep.found()),
2045 + 'Enable ORC: @0@'.format(have_orcc),
2046 + 'Enable Adrian echo canceller: @0@'.format(get_option('adrian-aec')),
2047 + 'Enable Speex (resampler, AEC): @0@'.format(speex_dep.found()),
2048 +diff --git a/src/modules/gsettings/meson.build b/src/modules/gsettings/meson.build
2049 +index 9604699e7..32177e3ec 100644
2050 +--- a/src/modules/gsettings/meson.build
2051 ++++ b/src/modules/gsettings/meson.build
2052 +@@ -8,7 +8,7 @@ gsettings_helper = executable('gsettings-helper',
2053 + gsettings_helper_sources,
2054 + c_args : pa_c_args,
2055 + include_directories : [configinc, topinc],
2056 +- dependencies : [gio_dep, libpulsecommon_dep, libpulse_dep],
2057 ++ dependencies : [gio_dep, glib_dep, libpulsecommon_dep, libpulse_dep],
2058 + install_dir : pulselibexecdir,
2059 + install_rpath : privlibdir,
2060 + install : true,
2061 +diff --git a/src/modules/meson.build b/src/modules/meson.build
2062 +index be72c3b9b..ccc06d001 100644
2063 +--- a/src/modules/meson.build
2064 ++++ b/src/modules/meson.build
2065 +@@ -161,7 +161,7 @@ if dbus_dep.found() and fftw_dep.found()
2066 + ]
2067 + endif
2068 +
2069 +-if get_option('gsettings').enabled() and gio_dep.found()
2070 ++if get_option('gsettings').enabled() and glib_dep.found() and gio_dep.found()
2071 + subdir('gsettings')
2072 + all_modules += [
2073 + [ 'module-gsettings',
2074 +--
2075 +2.35.1
2076 +
2077
2078 diff --git a/media-libs/libpulse/files/pulseaudio-15.0-move-systemd-socket-activation-code.patch b/media-libs/libpulse/files/pulseaudio-15.0-move-systemd-socket-activation-code.patch
2079 new file mode 100644
2080 index 000000000000..51f1314c9b34
2081 --- /dev/null
2082 +++ b/media-libs/libpulse/files/pulseaudio-15.0-move-systemd-socket-activation-code.patch
2083 @@ -0,0 +1,284 @@
2084 +commit 733969ac1917f02923e2a5869a8e14a582e0ba2e
2085 +Author: Igor V. Kovalenko <igor.v.kovalenko@×××××.com>
2086 +Date: Sat Sep 25 13:22:09 2021 +0300
2087 +
2088 + socket-server: Move systemd socket activation code to pulsecore
2089 +
2090 + There is no need to support server sockets in client library. Move all related
2091 + code and tcp-wrappers dependency to pulsecore library.
2092 +
2093 + Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/640>
2094 +
2095 +diff --git a/src/meson.build b/src/meson.build
2096 +index e2860811b..59a9b16bf 100644
2097 +--- a/src/meson.build
2098 ++++ b/src/meson.build
2099 +@@ -57,7 +57,6 @@ libpulsecommon_sources = [
2100 + 'pulsecore/shm.c',
2101 + 'pulsecore/bitset.c',
2102 + 'pulsecore/socket-client.c',
2103 +- 'pulsecore/socket-server.c',
2104 + 'pulsecore/socket-util.c',
2105 + 'pulsecore/strbuf.c',
2106 + 'pulsecore/strlist.c',
2107 +@@ -136,7 +135,6 @@ libpulsecommon_headers = [
2108 + 'pulsecore/shm.h',
2109 + 'pulsecore/bitset.h',
2110 + 'pulsecore/socket-client.h',
2111 +- 'pulsecore/socket-server.h',
2112 + 'pulsecore/socket-util.h',
2113 + 'pulsecore/strbuf.h',
2114 + 'pulsecore/strlist.h',
2115 +@@ -200,7 +198,7 @@ libpulsecommon = shared_library('pulsecommon-' + pa_version_major_minor,
2116 + libm_dep, thread_dep, dl_dep, shm_dep, iconv_dep, sndfile_dep, dbus_dep,
2117 + x11_dep, libsystemd_dep, glib_dep.partial_dependency(compile_args: true),
2118 + gtk_dep.partial_dependency(compile_args: true), asyncns_dep, libintl_dep,
2119 +- platform_dep, tcpwrap_dep, platform_socket_dep, execinfo_dep,
2120 ++ platform_dep, platform_socket_dep, execinfo_dep,
2121 + ],
2122 + implicit_include_directories : false)
2123 +
2124 +diff --git a/src/pulsecore/meson.build b/src/pulsecore/meson.build
2125 +index d7f9ef2cf..b30264b3a 100644
2126 +--- a/src/pulsecore/meson.build
2127 ++++ b/src/pulsecore/meson.build
2128 +@@ -44,6 +44,7 @@ libpulsecore_sources = [
2129 + 'sink.c',
2130 + 'sink-input.c',
2131 + 'sioman.c',
2132 ++ 'socket-server.c',
2133 + 'sound-file-stream.c',
2134 + 'sound-file.c',
2135 + 'source.c',
2136 +@@ -101,6 +102,7 @@ libpulsecore_headers = [
2137 + 'sink-input.h',
2138 + 'sink.h',
2139 + 'sioman.h',
2140 ++ 'socket-server.h',
2141 + 'sound-file-stream.h',
2142 + 'sound-file.h',
2143 + 'source-output.h',
2144 +@@ -222,7 +224,7 @@ libpulsecore = shared_library('pulsecore-' + pa_version_major_minor,
2145 + install_rpath : privlibdir,
2146 + install_dir : privlibdir,
2147 + link_with : libpulsecore_simd_lib,
2148 +- dependencies : [libm_dep, libpulsecommon_dep, ltdl_dep, shm_dep, sndfile_dep, database_dep, dbus_dep, libatomic_ops_dep, orc_dep, samplerate_dep, soxr_dep, speex_dep, x11_dep, libintl_dep, platform_dep, platform_socket_dep,],
2149 ++ dependencies : [libm_dep, libpulsecommon_dep, ltdl_dep, shm_dep, sndfile_dep, database_dep, dbus_dep, libatomic_ops_dep, orc_dep, samplerate_dep, soxr_dep, speex_dep, x11_dep, libsystemd_dep, libintl_dep, platform_dep, tcpwrap_dep, platform_socket_dep,],
2150 + implicit_include_directories : false)
2151 +
2152 + libpulsecore_dep = declare_dependency(link_with: libpulsecore)
2153 +diff --git a/src/pulsecore/socket-server.c b/src/pulsecore/socket-server.c
2154 +index 13d8a99f7..b13012b6d 100644
2155 +--- a/src/pulsecore/socket-server.c
2156 ++++ b/src/pulsecore/socket-server.c
2157 +@@ -642,3 +642,83 @@ char *pa_socket_server_get_address(pa_socket_server *s, char *c, size_t l) {
2158 + return NULL;
2159 + }
2160 + }
2161 ++
2162 ++#ifdef HAVE_SYS_UN_H
2163 ++
2164 ++int pa_unix_socket_is_stale(const char *fn) {
2165 ++ struct sockaddr_un sa;
2166 ++ int fd = -1, ret = -1;
2167 ++
2168 ++ pa_assert(fn);
2169 ++
2170 ++ if ((fd = pa_socket_cloexec(PF_UNIX, SOCK_STREAM, 0)) < 0) {
2171 ++ pa_log("socket(): %s", pa_cstrerror(errno));
2172 ++ goto finish;
2173 ++ }
2174 ++
2175 ++ sa.sun_family = AF_UNIX;
2176 ++ strncpy(sa.sun_path, fn, sizeof(sa.sun_path)-1);
2177 ++ sa.sun_path[sizeof(sa.sun_path) - 1] = 0;
2178 ++
2179 ++ if (connect(fd, (struct sockaddr*) &sa, sizeof(sa)) < 0) {
2180 ++#if !defined(OS_IS_WIN32)
2181 ++ if (errno == ECONNREFUSED)
2182 ++ ret = 1;
2183 ++#else
2184 ++ if (WSAGetLastError() == WSAECONNREFUSED || WSAGetLastError() == WSAEINVAL)
2185 ++ ret = 1;
2186 ++#endif
2187 ++ } else
2188 ++ ret = 0;
2189 ++
2190 ++finish:
2191 ++ if (fd >= 0)
2192 ++ pa_close(fd);
2193 ++
2194 ++ return ret;
2195 ++}
2196 ++
2197 ++int pa_unix_socket_remove_stale(const char *fn) {
2198 ++ int r;
2199 ++
2200 ++ pa_assert(fn);
2201 ++
2202 ++#ifdef HAVE_SYSTEMD_DAEMON
2203 ++ {
2204 ++ int n = sd_listen_fds(0);
2205 ++ if (n > 0) {
2206 ++ for (int i = 0; i < n; ++i) {
2207 ++ if (sd_is_socket_unix(SD_LISTEN_FDS_START + i, SOCK_STREAM, 1, fn, 0) > 0) {
2208 ++ /* This is a socket activated socket, therefore do not consider
2209 ++ * it stale. */
2210 ++ return 0;
2211 ++ }
2212 ++ }
2213 ++ }
2214 ++ }
2215 ++#endif
2216 ++
2217 ++ if ((r = pa_unix_socket_is_stale(fn)) < 0)
2218 ++ return errno != ENOENT ? -1 : 0;
2219 ++
2220 ++ if (!r)
2221 ++ return 0;
2222 ++
2223 ++ /* Yes, here is a race condition. But who cares? */
2224 ++ if (unlink(fn) < 0)
2225 ++ return -1;
2226 ++
2227 ++ return 0;
2228 ++}
2229 ++
2230 ++#else /* HAVE_SYS_UN_H */
2231 ++
2232 ++int pa_unix_socket_is_stale(const char *fn) {
2233 ++ return -1;
2234 ++}
2235 ++
2236 ++int pa_unix_socket_remove_stale(const char *fn) {
2237 ++ return -1;
2238 ++}
2239 ++
2240 ++#endif /* HAVE_SYS_UN_H */
2241 +diff --git a/src/pulsecore/socket-server.h b/src/pulsecore/socket-server.h
2242 +index 0793baf44..b1f093921 100644
2243 +--- a/src/pulsecore/socket-server.h
2244 ++++ b/src/pulsecore/socket-server.h
2245 +@@ -50,4 +50,7 @@ void pa_socket_server_set_callback(pa_socket_server*s, pa_socket_server_on_conne
2246 +
2247 + char *pa_socket_server_get_address(pa_socket_server *s, char *c, size_t l);
2248 +
2249 ++int pa_unix_socket_is_stale(const char *fn);
2250 ++int pa_unix_socket_remove_stale(const char *fn);
2251 ++
2252 + #endif
2253 +diff --git a/src/pulsecore/socket-util.c b/src/pulsecore/socket-util.c
2254 +index f2c8c3c31..4ede0439e 100644
2255 +--- a/src/pulsecore/socket-util.c
2256 ++++ b/src/pulsecore/socket-util.c
2257 +@@ -50,9 +50,6 @@
2258 + #ifdef HAVE_NETDB_H
2259 + #include <netdb.h>
2260 + #endif
2261 +-#ifdef HAVE_SYSTEMD_DAEMON
2262 +-#include <systemd/sd-daemon.h>
2263 +-#endif
2264 +
2265 + #include <pulsecore/core-error.h>
2266 + #include <pulsecore/core-util.h>
2267 +@@ -221,86 +218,6 @@ int pa_socket_set_sndbuf(int fd, size_t l) {
2268 + return 0;
2269 + }
2270 +
2271 +-#ifdef HAVE_SYS_UN_H
2272 +-
2273 +-int pa_unix_socket_is_stale(const char *fn) {
2274 +- struct sockaddr_un sa;
2275 +- int fd = -1, ret = -1;
2276 +-
2277 +- pa_assert(fn);
2278 +-
2279 +- if ((fd = pa_socket_cloexec(PF_UNIX, SOCK_STREAM, 0)) < 0) {
2280 +- pa_log("socket(): %s", pa_cstrerror(errno));
2281 +- goto finish;
2282 +- }
2283 +-
2284 +- sa.sun_family = AF_UNIX;
2285 +- strncpy(sa.sun_path, fn, sizeof(sa.sun_path)-1);
2286 +- sa.sun_path[sizeof(sa.sun_path) - 1] = 0;
2287 +-
2288 +- if (connect(fd, (struct sockaddr*) &sa, sizeof(sa)) < 0) {
2289 +-#if !defined(OS_IS_WIN32)
2290 +- if (errno == ECONNREFUSED)
2291 +- ret = 1;
2292 +-#else
2293 +- if (WSAGetLastError() == WSAECONNREFUSED || WSAGetLastError() == WSAEINVAL)
2294 +- ret = 1;
2295 +-#endif
2296 +- } else
2297 +- ret = 0;
2298 +-
2299 +-finish:
2300 +- if (fd >= 0)
2301 +- pa_close(fd);
2302 +-
2303 +- return ret;
2304 +-}
2305 +-
2306 +-int pa_unix_socket_remove_stale(const char *fn) {
2307 +- int r;
2308 +-
2309 +- pa_assert(fn);
2310 +-
2311 +-#ifdef HAVE_SYSTEMD_DAEMON
2312 +- {
2313 +- int n = sd_listen_fds(0);
2314 +- if (n > 0) {
2315 +- for (int i = 0; i < n; ++i) {
2316 +- if (sd_is_socket_unix(SD_LISTEN_FDS_START + i, SOCK_STREAM, 1, fn, 0) > 0) {
2317 +- /* This is a socket activated socket, therefore do not consider
2318 +- * it stale. */
2319 +- return 0;
2320 +- }
2321 +- }
2322 +- }
2323 +- }
2324 +-#endif
2325 +-
2326 +- if ((r = pa_unix_socket_is_stale(fn)) < 0)
2327 +- return errno != ENOENT ? -1 : 0;
2328 +-
2329 +- if (!r)
2330 +- return 0;
2331 +-
2332 +- /* Yes, here is a race condition. But who cares? */
2333 +- if (unlink(fn) < 0)
2334 +- return -1;
2335 +-
2336 +- return 0;
2337 +-}
2338 +-
2339 +-#else /* HAVE_SYS_UN_H */
2340 +-
2341 +-int pa_unix_socket_is_stale(const char *fn) {
2342 +- return -1;
2343 +-}
2344 +-
2345 +-int pa_unix_socket_remove_stale(const char *fn) {
2346 +- return -1;
2347 +-}
2348 +-
2349 +-#endif /* HAVE_SYS_UN_H */
2350 +-
2351 + bool pa_socket_address_is_local(const struct sockaddr *sa) {
2352 + pa_assert(sa);
2353 +
2354 +diff --git a/src/pulsecore/socket-util.h b/src/pulsecore/socket-util.h
2355 +index f12076936..83c730bd9 100644
2356 +--- a/src/pulsecore/socket-util.h
2357 ++++ b/src/pulsecore/socket-util.h
2358 +@@ -35,9 +35,6 @@ void pa_make_udp_socket_low_delay(int fd);
2359 + int pa_socket_set_sndbuf(int fd, size_t l);
2360 + int pa_socket_set_rcvbuf(int fd, size_t l);
2361 +
2362 +-int pa_unix_socket_is_stale(const char *fn);
2363 +-int pa_unix_socket_remove_stale(const char *fn);
2364 +-
2365 + bool pa_socket_address_is_local(const struct sockaddr *sa);
2366 + bool pa_socket_is_local(int fd);
2367 +
2368
2369 diff --git a/media-libs/libpulse/libpulse-15.0.ebuild b/media-libs/libpulse/libpulse-15.0-r1.ebuild
2370 similarity index 88%
2371 rename from media-libs/libpulse/libpulse-15.0.ebuild
2372 rename to media-libs/libpulse/libpulse-15.0-r1.ebuild
2373 index 44b59893433b..2457ca28651b 100644
2374 --- a/media-libs/libpulse/libpulse-15.0.ebuild
2375 +++ b/media-libs/libpulse/libpulse-15.0-r1.ebuild
2376 @@ -71,9 +71,11 @@ BDEPEND="
2377
2378 DOCS=( NEWS README )
2379
2380 +# patches merged upstream, to be removed with 16.0 bump
2381 PATCHES=(
2382 "${FILESDIR}"/pulseaudio-15.0-xice-xsm-xtst-daemon-only.patch
2383 - "${FILESDIR}"/${PV}-no-aec.patch
2384 + "${FILESDIR}"/pulseaudio-15.0-move-systemd-socket-activation-code.patch
2385 + "${FILESDIR}"/pulseaudio-15.0-daemon-client-split-build.patch
2386 )
2387
2388 src_prepare() {
2389 @@ -87,6 +89,7 @@ multilib_src_configure() {
2390 --localstatedir="${EPREFIX}"/var
2391
2392 -Ddaemon=false
2393 + -Dclient=true
2394 $(meson_native_use_bool doc doxygen)
2395 -Dgcov=false
2396 # tests involve random modules, so just do them for the native # TODO: tests should run always
2397 @@ -171,6 +174,15 @@ multilib_src_install() {
2398 # therefore clear the variable when calling the function that will access it.
2399 DOCS= meson_src_install
2400
2401 + # Upstream installs 'pactl' if client is built, with all symlinks except for
2402 + # 'pulseaudio', 'pacmd' and 'pasuspender' which are installed if server is built.
2403 + # This trips QA warning, workaround:
2404 + # - install missing aliases in media-libs/libpulse (client build)
2405 + # - remove corresponding symlinks in media-sound/pulseaudio-daemonclient (server build)
2406 + bashcomp_alias pactl pulseaudio
2407 + bashcomp_alias pactl pacmd
2408 + bashcomp_alias pactl pasuspender
2409 +
2410 if multilib_is_native_abi; then
2411 if use doc; then
2412 einfo "Installing documentation ..."
2413
2414 diff --git a/media-sound/pulseaudio-daemon/Manifest b/media-sound/pulseaudio-daemon/Manifest
2415 index 308d59508744..620fb8498703 100644
2416 --- a/media-sound/pulseaudio-daemon/Manifest
2417 +++ b/media-sound/pulseaudio-daemon/Manifest
2418 @@ -1 +1,2 @@
2419 DIST pulseaudio-15.0.tar.xz 1521760 BLAKE2B a6f7b74fdcfe7f2a993eafb9f465946915a24b6801d3077971b9377290d6c70b3f8640a800abd09d5901db96a20349f31b1beedd9da2249f69b591fb8392f489 SHA512 352ef20384c76c631c0faa73b08e2318902a433712e0c086a5ac7a0ae58873c8d4be8f35879bdec71a93b19ae8e2ba073cacac4d56215bcf58375a0cd9d88833
2420 +DIST pulseaudio-daemon-15.0-patchset-1.tar.bz2 13739 BLAKE2B 0a9497536481b79ebb9928fc753d44cde30b331890cf7a912f0e038fc270a79e4774fdca209a52b6d50de93e32c30c6636e4d7e57e9daceb90ee80e699599ac8 SHA512 04d98d2a1862cc65cc48837bd3c9d6c8ece4591966bc9d673c8273b445fc63dcc59d8aa891ae8c802ebacacdf56e2790a3f20a95009107c5e5cf6581d1f5f996
2421
2422 diff --git a/media-sound/pulseaudio-daemon/files/15.0-daemon-only.patch b/media-sound/pulseaudio-daemon/files/15.0-daemon-only.patch
2423 deleted file mode 100644
2424 index 4d99c1ebe639..000000000000
2425 --- a/media-sound/pulseaudio-daemon/files/15.0-daemon-only.patch
2426 +++ /dev/null
2427 @@ -1,298 +0,0 @@
2428 -From f4f28cc436a506d1dfbd514968b2976ab31cdf5f Mon Sep 17 00:00:00 2001
2429 -From: Mart Raudsepp <mart@××××.tech>
2430 -Date: Fri, 24 Sep 2021 15:19:05 +0300
2431 -Subject: [PATCH] build-sys: meson: Allow building the daemon only
2432 -
2433 ----
2434 - man/meson.build | 2 ++
2435 - meson.build | 23 ++++++++++++++++++++---
2436 - meson_options.txt | 3 +++
2437 - po/meson.build | 3 ---
2438 - shell-completion/bash/meson.build | 2 ++
2439 - src/daemon/meson.build | 4 ++--
2440 - src/meson.build | 11 +++++++++++
2441 - src/modules/gsettings/meson.build | 3 +--
2442 - src/tests/meson.build | 9 +++++++--
2443 - src/utils/meson.build | 10 ++++++----
2444 - 10 files changed, 54 insertions(+), 16 deletions(-)
2445 -
2446 -diff --git a/man/meson.build b/man/meson.build
2447 -index 31c581a8f..c12ad5e6a 100644
2448 ---- a/man/meson.build
2449 -+++ b/man/meson.build
2450 -@@ -14,6 +14,7 @@ if get_option('daemon')
2451 - ]
2452 - endif
2453 -
2454 -+if not get_option('daemon-only')
2455 - manpages += [
2456 - ['pacat', '1', ['paplay', 'parec', 'parecord', 'pamon']],
2457 - ['pactl', '1'],
2458 -@@ -31,6 +32,7 @@ if x11_dep.found()
2459 - ['pax11publish', '1'],
2460 - ]
2461 - endif
2462 -+endif
2463 -
2464 - # FIXME: Add esdcompat if HAVE_ESOUND
2465 - #manpages += ['esdcompat', '1'],
2466 -diff --git a/meson.build b/meson.build
2467 -index 63ed62342..420cc6fac 100644
2468 ---- a/meson.build
2469 -+++ b/meson.build
2470 -@@ -53,6 +53,8 @@ libpulse_mainloop_glib_version = '@0@.@1@.@2@'.format(
2471 - libpulse_mainloop_glib_version_info[1],
2472 - )
2473 -
2474 -+i18n = import('i18n')
2475 -+
2476 - # Paths
2477 -
2478 - prefix = get_option('prefix')
2479 -@@ -68,6 +70,7 @@ localedir = join_paths(prefix, get_option('localedir'))
2480 - localstatedir = join_paths(prefix, get_option('localstatedir'))
2481 - sysconfdir = join_paths(prefix, get_option('sysconfdir'))
2482 - privlibdir = join_paths(libdir, 'pulseaudio')
2483 -+po_dir = join_paths(meson.current_source_dir(), 'po')
2484 -
2485 - if host_machine.system() == 'windows'
2486 - # Windows only supports loading libraries from the same dir as the executable
2487 -@@ -796,20 +799,28 @@ check_dep = dependency('check', version : '>= 0.9.10', required : get_option('te
2488 - if get_option('doxygen')
2489 - subdir('doxygen')
2490 - endif
2491 --subdir('po')
2492 -+if not get_option('daemon-only')
2493 -+ subdir('po')
2494 -+endif
2495 - if get_option('man')
2496 - subdir('man')
2497 - endif
2498 - subdir('shell-completion/bash')
2499 --subdir('shell-completion/zsh')
2500 -+if not get_option('daemon-only')
2501 -+ subdir('shell-completion/zsh')
2502 -+endif
2503 - subdir('src')
2504 --subdir('vala')
2505 -+if not get_option('daemon-only')
2506 -+ subdir('vala')
2507 -+endif
2508 -
2509 - # Now generate config.h from everything above
2510 - configure_file(output : 'config.h', configuration : cdata)
2511 -
2512 - # pkg-config files
2513 -
2514 -+if not get_option('daemon-only')
2515 -+
2516 - pc_cdata = configuration_data()
2517 -
2518 - pc_cdata.set('prefix', prefix)
2519 -@@ -842,8 +853,12 @@ foreach file : pc_files
2520 - install_dir : pkgconfigdir)
2521 - endforeach
2522 -
2523 -+endif # !daemon-only
2524 -+
2525 - # CMake files
2526 -
2527 -+if not get_option('daemon-only')
2528 -+
2529 - m4 = find_program('m4', required: true)
2530 -
2531 - cmakedir = join_paths(libdir, 'cmake', 'PulseAudio')
2532 -@@ -872,6 +887,8 @@ configure_file(
2533 - install_dir : cmakedir,
2534 - )
2535 -
2536 -+endif # !daemon-only
2537 -+
2538 - ############################################################
2539 -
2540 - # Final summary
2541 -diff --git a/meson_options.txt b/meson_options.txt
2542 -index bb41a42a7..62828ac5c 100644
2543 ---- a/meson_options.txt
2544 -+++ b/meson_options.txt
2545 -@@ -1,6 +1,9 @@
2546 - option('daemon',
2547 - type : 'boolean', value : true,
2548 - description : 'Enable building and installation of pulseaudio daemon and supporting configuration files')
2549 -+option('daemon-only',
2550 -+ type : 'boolean', value : false,
2551 -+ description : 'Build and install only the pulseaudio daemon and supporting configuration files, relying on a system installation of libpulse')
2552 - option('doxygen',
2553 - type : 'boolean', value : true,
2554 - description : 'Enable building and installation of documentation generated with doxygen')
2555 -diff --git a/po/meson.build b/po/meson.build
2556 -index 34278db47..33429373c 100644
2557 ---- a/po/meson.build
2558 -+++ b/po/meson.build
2559 -@@ -1,4 +1,3 @@
2560 --i18n = import('i18n')
2561 - i18n.gettext(
2562 - meson.project_name(),
2563 - preset: 'glib',
2564 -@@ -7,5 +6,3 @@ i18n.gettext(
2565 - args: ['--msgid-bugs-address=https://gitlab.freedesktop.org/pulseaudio/pulseaudio/issues/new',
2566 - '--width=90'],
2567 - )
2568 --
2569 --po_dir = meson.current_source_dir()
2570 -diff --git a/shell-completion/bash/meson.build b/shell-completion/bash/meson.build
2571 -index 3ba5cb16f..83d90b94b 100644
2572 ---- a/shell-completion/bash/meson.build
2573 -+++ b/shell-completion/bash/meson.build
2574 -@@ -8,6 +8,7 @@ if bashcompletiondir != 'no'
2575 - ]
2576 - endif
2577 -
2578 -+ if not get_option('daemon-only')
2579 - aliases += [
2580 - 'pacat',
2581 - 'pactl',
2582 -@@ -16,6 +17,7 @@ if bashcompletiondir != 'no'
2583 - 'parec',
2584 - 'parecord',
2585 - ]
2586 -+ endif
2587 -
2588 - install_data('pulseaudio', install_dir : bashcompletiondir)
2589 -
2590 -diff --git a/src/daemon/meson.build b/src/daemon/meson.build
2591 -index 262e193b2..e8f70a453 100644
2592 ---- a/src/daemon/meson.build
2593 -+++ b/src/daemon/meson.build
2594 -@@ -30,8 +30,8 @@ executable('pulseaudio',
2595 - install_rpath : privlibdir,
2596 - include_directories : [configinc, topinc],
2597 - link_args : ['-ffast-math'],
2598 -- link_with : [libpulsecore, libpulsecommon, libpulse],
2599 -- dependencies : [ltdl_dep, cap_dep, dbus_dep, libsystemd_dep, dl_dep, libintl_dep, platform_dep, platform_socket_dep],
2600 -+ link_with : [libpulsecore],
2601 -+ dependencies : [ltdl_dep, cap_dep, dbus_dep, libsystemd_dep, dl_dep, libintl_dep, platform_dep, platform_socket_dep, libpulsecommon_dep, libpulse_dep],
2602 - c_args : pa_c_args,
2603 - )
2604 -
2605 -diff --git a/src/meson.build b/src/meson.build
2606 -index e2860811b..a56667271 100644
2607 ---- a/src/meson.build
2608 -+++ b/src/meson.build
2609 -@@ -188,6 +188,15 @@ else
2610 - endif
2611 - # FIXME: Do SIMD things
2612 -
2613 -+if get_option('daemon-only')
2614 -+ libpulsecommon_dep = cc.find_library('pulsecommon-' + pa_version_major_minor, dirs : privlibdir, required : true)
2615 -+ libpulse_dep = dependency('libpulse', required : true)
2616 -+ libpulse_simple_dep = dependency('libpulse-simple', required : true)
2617 -+ if glib_dep.found()
2618 -+ libpulse_mainloop_glib_dep = dependency('libpulse-mainloop-glib', required : true)
2619 -+ endif
2620 -+else
2621 -+
2622 - libpulsecommon = shared_library('pulsecommon-' + pa_version_major_minor,
2623 - libpulsecommon_sources,
2624 - libpulsecommon_headers,
2625 -@@ -207,6 +216,8 @@ libpulsecommon = shared_library('pulsecommon-' + pa_version_major_minor,
2626 - libpulsecommon_dep = declare_dependency(link_with: libpulsecommon)
2627 -
2628 - subdir('pulse')
2629 -+endif
2630 -+
2631 - if get_option('daemon')
2632 - subdir('pulsecore')
2633 - subdir('daemon')
2634 -diff --git a/src/modules/gsettings/meson.build b/src/modules/gsettings/meson.build
2635 -index 68a72c3ff..9604699e7 100644
2636 ---- a/src/modules/gsettings/meson.build
2637 -+++ b/src/modules/gsettings/meson.build
2638 -@@ -8,8 +8,7 @@ gsettings_helper = executable('gsettings-helper',
2639 - gsettings_helper_sources,
2640 - c_args : pa_c_args,
2641 - include_directories : [configinc, topinc],
2642 -- link_with : [libpulsecommon, libpulse],
2643 -- dependencies : [gio_dep],
2644 -+ dependencies : [gio_dep, libpulsecommon_dep, libpulse_dep],
2645 - install_dir : pulselibexecdir,
2646 - install_rpath : privlibdir,
2647 - install : true,
2648 -diff --git a/src/tests/meson.build b/src/tests/meson.build
2649 -index acd301037..56d71299f 100644
2650 ---- a/src/tests/meson.build
2651 -+++ b/src/tests/meson.build
2652 -@@ -20,8 +20,6 @@ default_tests += [
2653 - [ check_dep, libpulse_dep, libpulsecommon_dep ] ],
2654 - [ 'json-test', 'json-test.c',
2655 - [ check_dep, libpulse_dep, libpulsecommon_dep ] ],
2656 -- [ 'mainloop-test', 'mainloop-test.c',
2657 -- [ check_dep, libpulse_dep, libpulsecommon_dep ] ],
2658 - [ 'proplist-test', 'proplist-test.c',
2659 - [ check_dep, libpulse_dep, libpulsecommon_dep ] ],
2660 - [ 'thread-mainloop-test', 'thread-mainloop-test.c',
2661 -@@ -32,6 +30,13 @@ default_tests += [
2662 - [ check_dep, libm_dep, libpulse_dep, libpulsecommon_dep ] ],
2663 - ]
2664 -
2665 -+if not get_option('daemon-only')
2666 -+ default_tests += [
2667 -+ [ 'mainloop-test', 'mainloop-test.c',
2668 -+ [ check_dep, libpulse_dep, libpulsecommon_dep ] ],
2669 -+ ]
2670 -+endif
2671 -+
2672 - if get_option('daemon')
2673 - default_tests += [
2674 - [ 'asyncmsgq-test', 'asyncmsgq-test.c',
2675 -diff --git a/src/utils/meson.build b/src/utils/meson.build
2676 -index c9635fdb6..7ed6e738f 100644
2677 ---- a/src/utils/meson.build
2678 -+++ b/src/utils/meson.build
2679 -@@ -1,3 +1,4 @@
2680 -+if not get_option('daemon-only')
2681 - pacat_sources = [
2682 - 'pacat.c',
2683 - ]
2684 -@@ -41,6 +42,7 @@ executable('pactl',
2685 - dependencies : [sndfile_dep, libintl_dep],
2686 - c_args : pa_c_args,
2687 - )
2688 -+endif
2689 -
2690 - if get_option('daemon')
2691 - if host_machine.system() != 'windows'
2692 -@@ -53,8 +55,7 @@ if get_option('daemon')
2693 - install: true,
2694 - install_rpath : privlibdir,
2695 - include_directories : [configinc, topinc],
2696 -- link_with : [libpulsecommon, libpulse],
2697 -- dependencies: [libintl_dep],
2698 -+ dependencies: [libintl_dep, libpulsecommon_dep, libpulse_dep],
2699 - c_args : pa_c_args,
2700 - )
2701 -
2702 -@@ -67,13 +68,13 @@ if get_option('daemon')
2703 - install: true,
2704 - install_rpath : privlibdir,
2705 - include_directories : [configinc, topinc],
2706 -- link_with : [libpulsecommon, libpulse],
2707 -- dependencies: [libintl_dep],
2708 -+ dependencies: [libintl_dep, libpulsecommon_dep, libpulse_dep],
2709 - c_args : pa_c_args,
2710 - )
2711 - endif
2712 - endif
2713 -
2714 -+if not get_option('daemon-only')
2715 - if x11_dep.found()
2716 - pax11publish_sources = [
2717 - 'pax11publish.c',
2718 -@@ -121,3 +122,4 @@ if dbus_dep.found() and fftw_dep.found()
2719 - endif
2720 -
2721 - install_data('pa-info', install_dir : bindir)
2722 -+endif
2723 ---
2724 -2.32.0
2725 -
2726
2727 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
2728 deleted file mode 100644
2729 index f3df62031d34..000000000000
2730 --- a/media-sound/pulseaudio-daemon/files/pulseaudio-15.0-xice-xsm-xtst-daemon-only.patch
2731 +++ /dev/null
2732 @@ -1,25 +0,0 @@
2733 -https://bugs.gentoo.org/806052
2734 -
2735 -commit 42af3ee08381faa5807fde68d4c8ec0d7ad5e9a5
2736 -Author: Igor V. Kovalenko <igor.v.kovalenko@×××××.com>
2737 -Date: Tue Aug 3 09:43:32 2021 +0300
2738 -
2739 - build-sys: meson: Require xice, xsm and xtst for daemon only
2740 -
2741 - Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/613>
2742 -
2743 ---- a/meson.build
2744 -+++ b/meson.build
2745 -@@ -681,9 +681,9 @@ endif
2746 - x11_dep = dependency('x11-xcb', required : get_option('x11'))
2747 - if x11_dep.found()
2748 - xcb_dep = dependency('xcb', required : true, version : '>= 1.6')
2749 -- ice_dep = dependency('ice', required : true)
2750 -- sm_dep = dependency('sm', required : true)
2751 -- xtst_dep = dependency('xtst', required : true)
2752 -+ ice_dep = dependency('ice', required : get_option('daemon'))
2753 -+ sm_dep = dependency('sm', required : get_option('daemon'))
2754 -+ xtst_dep = dependency('xtst', required : get_option('daemon'))
2755 - cdata.set('HAVE_X11', 1)
2756 - if cc.has_function('XSetIOErrorExitHandler', dependencies: x11_dep)
2757 - cdata.set('HAVE_XSETIOERROREXITHANDLER', 1)
2758
2759 diff --git a/media-sound/pulseaudio-daemon/pulseaudio-daemon-15.0.ebuild b/media-sound/pulseaudio-daemon/pulseaudio-daemon-15.0-r1.ebuild
2760 similarity index 93%
2761 rename from media-sound/pulseaudio-daemon/pulseaudio-daemon-15.0.ebuild
2762 rename to media-sound/pulseaudio-daemon/pulseaudio-daemon-15.0-r1.ebuild
2763 index 2af849121400..ca5a0570c89f 100644
2764 --- a/media-sound/pulseaudio-daemon/pulseaudio-daemon-15.0.ebuild
2765 +++ b/media-sound/pulseaudio-daemon/pulseaudio-daemon-15.0-r1.ebuild
2766 @@ -5,7 +5,7 @@ EAPI="7"
2767
2768 MY_PV="${PV/_pre*}"
2769 MY_P="pulseaudio-${MY_PV}"
2770 -
2771 +MY_PATCHSET="${PN}-15.0-patchset-1"
2772 inherit bash-completion-r1 gnome2-utils meson optfeature systemd tmpfiles udev
2773
2774 DESCRIPTION="A networked sound server with an advanced plugin system"
2775 @@ -17,6 +17,7 @@ if [[ ${PV} = 9999 ]]; then
2776 EGIT_REPO_URI="https://gitlab.freedesktop.org/pulseaudio/pulseaudio"
2777 else
2778 SRC_URI="https://freedesktop.org/software/pulseaudio/releases/${MY_P}.tar.xz"
2779 + SRC_URI+=" https://dev.gentoo.org/~sam/distfiles/${CATEGORY}/${PN}/${MY_PATCHSET}.tar.bz2"
2780 KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~riscv ~sparc ~x86 ~amd64-linux ~x86-linux"
2781 fi
2782
2783 @@ -148,9 +149,9 @@ DOCS=( NEWS README )
2784
2785 S="${WORKDIR}/${MY_P}"
2786
2787 +# patches merged upstream, to be removed with 16.0 bump
2788 PATCHES=(
2789 - "${FILESDIR}"/pulseaudio-15.0-xice-xsm-xtst-daemon-only.patch
2790 - "${FILESDIR}"/${PV}-daemon-only.patch
2791 + "${WORKDIR}"/${MY_PATCHSET}/
2792 )
2793
2794 src_prepare() {
2795 @@ -164,7 +165,7 @@ src_configure() {
2796 --localstatedir="${EPREFIX}"/var
2797
2798 -Ddaemon=true
2799 - -Ddaemon-only=true
2800 + -Dclient=false
2801 -Ddoxygen=false
2802 -Dgcov=false
2803 -Dman=true
2804 @@ -222,8 +223,14 @@ src_configure() {
2805 src_install() {
2806 meson_src_install
2807
2808 - # Installed by media-libs/libpulse
2809 + # Upstream installs 'pactl' if client is built, with all symlinks except for
2810 + # 'pulseaudio', 'pacmd' and 'pasuspender' which are installed if server is built.
2811 + # This trips QA warning, workaround:
2812 + # - install missing aliases in media-libs/libpulse (client build)
2813 + # - remove corresponding symlinks in media-sound/pulseaudio-daemonclient (server build)
2814 rm "${D}/$(get_bashcompdir)"/pulseaudio || die
2815 + rm "${D}/$(get_bashcompdir)"/pacmd || die
2816 + rm "${D}/$(get_bashcompdir)"/pasuspender || die
2817
2818 if use system-wide; then
2819 newconfd "${FILESDIR}"/pulseaudio.conf.d pulseaudio