public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: media-libs/libpulse/files/, media-libs/libpulse/, ...
@ 2022-02-21  0:49 Sam James
  0 siblings, 0 replies; only message in thread
From: Sam James @ 2022-02-21  0:49 UTC (permalink / raw
  To: gentoo-commits

commit:     5c0932d5e4d591710f3299f70c2012383ab268bc
Author:     Igor V. Kovalenko <igor.v.kovalenko <AT> gmail <DOT> com>
AuthorDate: Sat Feb 19 07:21:06 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Feb 21 00:48:59 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5c0932d5

media-sound/pulseaudio-daemon: Update 15.0 split build to patches merged upstream

Added patch moving systemd socket activation to server implementation.
No functional changes. This patch is only required to apply upstream
daemon/client split patch with minimal adjustment.
https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/640

Updated daemon/client split patch to version merged upstream, rebased to 15.0
https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/659

Signed-off-by: Igor V. Kovalenko <igor.v.kovalenko <AT> gmail.com>
Closes: https://github.com/gentoo/gentoo/pull/24217
Signed-off-by: Sam James <sam <AT> gentoo.org>

 media-libs/libpulse/files/15.0-no-aec.patch        |   45 -
 ...pulseaudio-15.0-daemon-client-split-build.patch | 1987 ++++++++++++++++++++
 ...-15.0-move-systemd-socket-activation-code.patch |  284 +++
 ...ibpulse-15.0.ebuild => libpulse-15.0-r1.ebuild} |   14 +-
 media-sound/pulseaudio-daemon/Manifest             |    1 +
 .../pulseaudio-daemon/files/15.0-daemon-only.patch |  298 ---
 ...pulseaudio-15.0-xice-xsm-xtst-daemon-only.patch |   25 -
 ...5.0.ebuild => pulseaudio-daemon-15.0-r1.ebuild} |   17 +-
 8 files changed, 2297 insertions(+), 374 deletions(-)

diff --git a/media-libs/libpulse/files/15.0-no-aec.patch b/media-libs/libpulse/files/15.0-no-aec.patch
deleted file mode 100644
index bd0b4d58b789..000000000000
--- a/media-libs/libpulse/files/15.0-no-aec.patch
+++ /dev/null
@@ -1,45 +0,0 @@
-From 4ea50aa41ff0131b380aef97623be578b702cac7 Mon Sep 17 00:00:00 2001
-From: Mart Raudsepp <mart@leio.tech>
-Date: Fri, 24 Sep 2021 00:02:40 +0300
-Subject: [PATCH] build-sys: meson: Relax sanity checks for daemonless builds
-
-Echo canceller, udev and speex resampling is only used by the daemon, so
-don't error or warn about those in -Ddaemon=false builds.
----
- meson.build | 6 +++---
- 1 file changed, 3 insertions(+), 3 deletions(-)
-
-diff --git a/meson.build b/meson.build
-index d7e468cab..63ed62342 100644
---- a/meson.build
-+++ b/meson.build
-@@ -961,7 +961,7 @@ message('\n    '.join(summary))
- 
- # Sanity checks
- 
--if not speex_dep.found() and not webrtc_dep.found() and not get_option('adrian-aec')
-+if get_option('daemon') and not speex_dep.found() and not webrtc_dep.found() and not get_option('adrian-aec')
-   error('At least one echo canceller implementation must be available!')
- endif
- 
-@@ -981,7 +981,7 @@ if host_machine.system() != 'windows'
-     ]
-     warning('\n' + '\n'.join(message))
-   endif
--  if host_machine.system() == 'linux' and not udev_dep.found()
-+  if host_machine.system() == 'linux' and not udev_dep.found() and get_option('daemon')
-     message = [
-       'You do not have udev support enabled. It is strongly recommended',
-       'that you enable udev support if your platform supports it as it is',
-@@ -990,7 +990,7 @@ if host_machine.system() != 'windows'
-     ]
-     warning('\n' + '\n'.join(message))
-   endif
--  if not speex_dep.found()
-+  if not speex_dep.found() and get_option('daemon')
-     message = [
-       'You do not have speex support enabled. It is strongly recommended',
-       'that you enable speex support if your platform supports it as it is',
--- 
-2.32.0
-

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
new file mode 100644
index 000000000000..8e3fbae40767
--- /dev/null
+++ b/media-libs/libpulse/files/pulseaudio-15.0-daemon-client-split-build.patch
@@ -0,0 +1,1987 @@
+From 36a1aab8e61cf846a4ee571c19cf1ce8fd7eca9d Mon Sep 17 00:00:00 2001
+From: Mart Raudsepp <mart@leio.tech>
+Date: Fri, 24 Sep 2021 00:02:40 +0300
+Subject: [PATCH 1/8] build-sys: meson: Relax sanity checks for daemonless
+ builds
+
+Echo canceller, udev and speex resampling is only used by the daemon, so
+don't error or warn about those in -Ddaemon=false builds.
+
+Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/659>
+---
+ meson.build | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/meson.build b/meson.build
+index a95fefcd4..d1c419ac2 100644
+--- a/meson.build
++++ b/meson.build
+@@ -961,7 +961,7 @@ message('\n    '.join(summary))
+ 
+ # Sanity checks
+ 
+-if not speex_dep.found() and not webrtc_dep.found() and not get_option('adrian-aec')
++if get_option('daemon') and not speex_dep.found() and not webrtc_dep.found() and not get_option('adrian-aec')
+   error('At least one echo canceller implementation must be available!')
+ endif
+ 
+@@ -981,7 +981,7 @@ if host_machine.system() != 'windows'
+     ]
+     warning('\n' + '\n'.join(message))
+   endif
+-  if host_machine.system() == 'linux' and not udev_dep.found()
++  if host_machine.system() == 'linux' and not udev_dep.found() and get_option('daemon')
+     message = [
+       'You do not have udev support enabled. It is strongly recommended',
+       'that you enable udev support if your platform supports it as it is',
+@@ -990,7 +990,7 @@ if host_machine.system() != 'windows'
+     ]
+     warning('\n' + '\n'.join(message))
+   endif
+-  if not speex_dep.found()
++  if not speex_dep.found() and get_option('daemon')
+     message = [
+       'You do not have speex support enabled. It is strongly recommended',
+       'that you enable speex support if your platform supports it as it is',
+-- 
+2.35.1
+
+
+From f63f3a9d7f311720dddef1f46e7c7431e3068c38 Mon Sep 17 00:00:00 2001
+From: Mart Raudsepp <mart@leio.tech>
+Date: Fri, 24 Sep 2021 15:19:05 +0300
+Subject: [PATCH 2/8] build-sys: meson: Allow building the daemon only
+
+Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/659>
+---
+ man/meson.build                   |  2 ++
+ meson.build                       | 23 ++++++++++++++++++++---
+ meson_options.txt                 |  3 +++
+ po/meson.build                    |  3 ---
+ shell-completion/bash/meson.build |  2 ++
+ src/daemon/meson.build            |  4 ++--
+ src/meson.build                   | 11 +++++++++++
+ src/modules/gsettings/meson.build |  3 +--
+ src/tests/meson.build             |  9 +++++++--
+ src/utils/meson.build             | 10 ++++++----
+ 10 files changed, 54 insertions(+), 16 deletions(-)
+
+diff --git a/man/meson.build b/man/meson.build
+index 31c581a8f..c12ad5e6a 100644
+--- a/man/meson.build
++++ b/man/meson.build
+@@ -14,6 +14,7 @@ if get_option('daemon')
+   ]
+ endif
+ 
++if not get_option('daemon-only')
+ manpages += [
+   ['pacat', '1', ['paplay', 'parec', 'parecord', 'pamon']],
+   ['pactl', '1'],
+@@ -31,6 +32,7 @@ if x11_dep.found()
+     ['pax11publish', '1'],
+   ]
+ endif
++endif
+ 
+ # FIXME: Add esdcompat if HAVE_ESOUND
+ #manpages += ['esdcompat', '1'],
+diff --git a/meson.build b/meson.build
+index d1c419ac2..b610a159c 100644
+--- a/meson.build
++++ b/meson.build
+@@ -53,6 +53,8 @@ libpulse_mainloop_glib_version = '@0@.@1@.@2@'.format(
+   libpulse_mainloop_glib_version_info[1],
+ )
+ 
++i18n = import('i18n')
++
+ # Paths
+ 
+ prefix = get_option('prefix')
+@@ -68,6 +70,7 @@ localedir = join_paths(prefix, get_option('localedir'))
+ localstatedir = join_paths(prefix, get_option('localstatedir'))
+ sysconfdir = join_paths(prefix, get_option('sysconfdir'))
+ privlibdir = join_paths(libdir, 'pulseaudio')
++po_dir = join_paths(meson.current_source_dir(), 'po')
+ 
+ if host_machine.system() == 'windows'
+   # Windows only supports loading libraries from the same dir as the executable
+@@ -796,20 +799,28 @@ check_dep = dependency('check', version : '>= 0.9.10', required : get_option('te
+ if get_option('doxygen')
+   subdir('doxygen')
+ endif
+-subdir('po')
++if not get_option('daemon-only')
++  subdir('po')
++endif
+ if get_option('man')
+   subdir('man')
+ endif
+ subdir('shell-completion/bash')
+-subdir('shell-completion/zsh')
++if not get_option('daemon-only')
++  subdir('shell-completion/zsh')
++endif
+ subdir('src')
+-subdir('vala')
++if not get_option('daemon-only')
++ subdir('vala')
++endif
+ 
+ # Now generate config.h from everything above
+ configure_file(output : 'config.h', configuration : cdata)
+ 
+ # pkg-config files
+ 
++if not get_option('daemon-only')
++
+ pc_cdata = configuration_data()
+ 
+ pc_cdata.set('prefix', prefix)
+@@ -842,8 +853,12 @@ foreach file : pc_files
+     install_dir : pkgconfigdir)
+ endforeach
+ 
++endif # !daemon-only
++
+ # CMake files
+ 
++if not get_option('daemon-only')
++
+ m4 = find_program('m4', required: true)
+ 
+ cmakedir = join_paths(libdir, 'cmake', 'PulseAudio')
+@@ -872,6 +887,8 @@ configure_file(
+   install_dir : cmakedir,
+ )
+ 
++endif # !daemon-only
++
+ ############################################################
+ 
+ # Final summary
+diff --git a/meson_options.txt b/meson_options.txt
+index bb41a42a7..62828ac5c 100644
+--- a/meson_options.txt
++++ b/meson_options.txt
+@@ -1,6 +1,9 @@
+ option('daemon',
+        type : 'boolean', value : true,
+        description : 'Enable building and installation of pulseaudio daemon and supporting configuration files')
++option('daemon-only',
++       type : 'boolean', value : false,
++       description : 'Build and install only the pulseaudio daemon and supporting configuration files, relying on a system installation of libpulse')
+ option('doxygen',
+        type : 'boolean', value : true,
+        description : 'Enable building and installation of documentation generated with doxygen')
+diff --git a/po/meson.build b/po/meson.build
+index 34278db47..33429373c 100644
+--- a/po/meson.build
++++ b/po/meson.build
+@@ -1,4 +1,3 @@
+-i18n = import('i18n')
+ i18n.gettext(
+   meson.project_name(),
+   preset: 'glib',
+@@ -7,5 +6,3 @@ i18n.gettext(
+   args: ['--msgid-bugs-address=https://gitlab.freedesktop.org/pulseaudio/pulseaudio/issues/new',
+          '--width=90'],
+ )
+-
+-po_dir = meson.current_source_dir()
+diff --git a/shell-completion/bash/meson.build b/shell-completion/bash/meson.build
+index 3ba5cb16f..83d90b94b 100644
+--- a/shell-completion/bash/meson.build
++++ b/shell-completion/bash/meson.build
+@@ -8,6 +8,7 @@ if bashcompletiondir != 'no'
+     ]
+   endif
+ 
++  if not get_option('daemon-only')
+   aliases += [
+     'pacat',
+     'pactl',
+@@ -16,6 +17,7 @@ if bashcompletiondir != 'no'
+     'parec',
+     'parecord',
+   ]
++  endif
+ 
+   install_data('pulseaudio', install_dir : bashcompletiondir)
+ 
+diff --git a/src/daemon/meson.build b/src/daemon/meson.build
+index 262e193b2..e8f70a453 100644
+--- a/src/daemon/meson.build
++++ b/src/daemon/meson.build
+@@ -30,8 +30,8 @@ executable('pulseaudio',
+   install_rpath : privlibdir,
+   include_directories : [configinc, topinc],
+   link_args : ['-ffast-math'],
+-  link_with : [libpulsecore, libpulsecommon, libpulse],
+-  dependencies : [ltdl_dep, cap_dep, dbus_dep, libsystemd_dep, dl_dep, libintl_dep, platform_dep, platform_socket_dep],
++  link_with : [libpulsecore],
++  dependencies : [ltdl_dep, cap_dep, dbus_dep, libsystemd_dep, dl_dep, libintl_dep, platform_dep, platform_socket_dep, libpulsecommon_dep, libpulse_dep],
+   c_args : pa_c_args,
+ )
+ 
+diff --git a/src/meson.build b/src/meson.build
+index 59a9b16bf..ce56dbfe3 100644
+--- a/src/meson.build
++++ b/src/meson.build
+@@ -186,6 +186,15 @@ else
+ endif
+ # FIXME: Do SIMD things
+ 
++if get_option('daemon-only')
++  libpulsecommon_dep = cc.find_library('pulsecommon-' + pa_version_major_minor, dirs : privlibdir, required : true)
++  libpulse_dep = dependency('libpulse', required : true)
++  libpulse_simple_dep = dependency('libpulse-simple', required : true)
++  if glib_dep.found()
++    libpulse_mainloop_glib_dep = dependency('libpulse-mainloop-glib', required : true)
++  endif
++else
++
+ libpulsecommon = shared_library('pulsecommon-' + pa_version_major_minor,
+   libpulsecommon_sources,
+   libpulsecommon_headers,
+@@ -205,6 +214,8 @@ libpulsecommon = shared_library('pulsecommon-' + pa_version_major_minor,
+ libpulsecommon_dep = declare_dependency(link_with: libpulsecommon)
+ 
+ subdir('pulse')
++endif
++
+ if get_option('daemon')
+   subdir('pulsecore')
+   subdir('daemon')
+diff --git a/src/modules/gsettings/meson.build b/src/modules/gsettings/meson.build
+index 68a72c3ff..9604699e7 100644
+--- a/src/modules/gsettings/meson.build
++++ b/src/modules/gsettings/meson.build
+@@ -8,8 +8,7 @@ gsettings_helper = executable('gsettings-helper',
+   gsettings_helper_sources,
+   c_args : pa_c_args,
+   include_directories : [configinc, topinc],
+-  link_with : [libpulsecommon, libpulse],
+-  dependencies : [gio_dep],
++  dependencies : [gio_dep, libpulsecommon_dep, libpulse_dep],
+   install_dir : pulselibexecdir,
+   install_rpath : privlibdir,
+   install : true,
+diff --git a/src/tests/meson.build b/src/tests/meson.build
+index acd301037..56d71299f 100644
+--- a/src/tests/meson.build
++++ b/src/tests/meson.build
+@@ -20,8 +20,6 @@ default_tests += [
+     [ check_dep, libpulse_dep, libpulsecommon_dep ] ],
+   [ 'json-test', 'json-test.c',
+     [ check_dep, libpulse_dep, libpulsecommon_dep ] ],
+-  [ 'mainloop-test', 'mainloop-test.c',
+-    [ check_dep, libpulse_dep, libpulsecommon_dep ] ],
+   [ 'proplist-test', 'proplist-test.c',
+     [ check_dep, libpulse_dep, libpulsecommon_dep ] ],
+   [ 'thread-mainloop-test', 'thread-mainloop-test.c',
+@@ -32,6 +30,13 @@ default_tests += [
+     [ check_dep, libm_dep, libpulse_dep, libpulsecommon_dep ] ],
+ ]
+ 
++if not get_option('daemon-only')
++  default_tests += [
++    [ 'mainloop-test', 'mainloop-test.c',
++      [ check_dep, libpulse_dep, libpulsecommon_dep ] ],
++  ]
++endif
++
+ if get_option('daemon')
+   default_tests += [
+     [ 'asyncmsgq-test', 'asyncmsgq-test.c',
+diff --git a/src/utils/meson.build b/src/utils/meson.build
+index c9635fdb6..7ed6e738f 100644
+--- a/src/utils/meson.build
++++ b/src/utils/meson.build
+@@ -1,3 +1,4 @@
++if not get_option('daemon-only')
+ pacat_sources = [
+   'pacat.c',
+ ]
+@@ -41,6 +42,7 @@ executable('pactl',
+   dependencies : [sndfile_dep, libintl_dep],
+   c_args : pa_c_args,
+ )
++endif
+ 
+ if get_option('daemon')
+   if host_machine.system() != 'windows'
+@@ -53,8 +55,7 @@ if get_option('daemon')
+       install: true,
+       install_rpath : privlibdir,
+       include_directories : [configinc, topinc],
+-      link_with : [libpulsecommon, libpulse],
+-      dependencies: [libintl_dep],
++      dependencies: [libintl_dep, libpulsecommon_dep, libpulse_dep],
+       c_args : pa_c_args,
+     )
+ 
+@@ -67,13 +68,13 @@ if get_option('daemon')
+       install: true,
+       install_rpath : privlibdir,
+       include_directories : [configinc, topinc],
+-      link_with : [libpulsecommon, libpulse],
+-      dependencies: [libintl_dep],
++      dependencies: [libintl_dep, libpulsecommon_dep, libpulse_dep],
+       c_args : pa_c_args,
+     )
+   endif
+ endif
+ 
++if not get_option('daemon-only')
+ if x11_dep.found()
+   pax11publish_sources = [
+     'pax11publish.c',
+@@ -121,3 +122,4 @@ if dbus_dep.found() and fftw_dep.found()
+ endif
+ 
+ install_data('pa-info', install_dir : bindir)
++endif
+-- 
+2.35.1
+
+
+From c3dba1988c18c59a49a2e3e3fa1451f4fa5db0ce Mon Sep 17 00:00:00 2001
+From: "Igor V. Kovalenko" <igor.v.kovalenko@gmail.com>
+Date: Thu, 4 Nov 2021 16:35:19 +0300
+Subject: [PATCH 3/8] build-sys: meson: change daemon-only to client
+
+Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/659>
+---
+ man/meson.build                   |  2 +-
+ meson.build                       | 14 +++++++-------
+ meson_options.txt                 |  6 +++---
+ shell-completion/bash/meson.build |  2 +-
+ src/meson.build                   |  2 +-
+ src/tests/meson.build             |  2 +-
+ src/utils/meson.build             |  4 ++--
+ 7 files changed, 16 insertions(+), 16 deletions(-)
+
+diff --git a/man/meson.build b/man/meson.build
+index c12ad5e6a..9b42c2a69 100644
+--- a/man/meson.build
++++ b/man/meson.build
+@@ -14,7 +14,7 @@ if get_option('daemon')
+   ]
+ endif
+ 
+-if not get_option('daemon-only')
++if get_option('client')
+ manpages += [
+   ['pacat', '1', ['paplay', 'parec', 'parecord', 'pamon']],
+   ['pactl', '1'],
+diff --git a/meson.build b/meson.build
+index b610a159c..ded6669b1 100644
+--- a/meson.build
++++ b/meson.build
+@@ -799,18 +799,18 @@ check_dep = dependency('check', version : '>= 0.9.10', required : get_option('te
+ if get_option('doxygen')
+   subdir('doxygen')
+ endif
+-if not get_option('daemon-only')
++if get_option('client')
+   subdir('po')
+ endif
+ if get_option('man')
+   subdir('man')
+ endif
+ subdir('shell-completion/bash')
+-if not get_option('daemon-only')
++if get_option('client')
+   subdir('shell-completion/zsh')
+ endif
+ subdir('src')
+-if not get_option('daemon-only')
++if get_option('client')
+  subdir('vala')
+ endif
+ 
+@@ -819,7 +819,7 @@ configure_file(output : 'config.h', configuration : cdata)
+ 
+ # pkg-config files
+ 
+-if not get_option('daemon-only')
++if get_option('client')
+ 
+ pc_cdata = configuration_data()
+ 
+@@ -853,11 +853,11 @@ foreach file : pc_files
+     install_dir : pkgconfigdir)
+ endforeach
+ 
+-endif # !daemon-only
++endif # client
+ 
+ # CMake files
+ 
+-if not get_option('daemon-only')
++if get_option('client')
+ 
+ m4 = find_program('m4', required: true)
+ 
+@@ -887,7 +887,7 @@ configure_file(
+   install_dir : cmakedir,
+ )
+ 
+-endif # !daemon-only
++endif # client
+ 
+ ############################################################
+ 
+diff --git a/meson_options.txt b/meson_options.txt
+index 62828ac5c..f7e413d1f 100644
+--- a/meson_options.txt
++++ b/meson_options.txt
+@@ -1,9 +1,9 @@
+ option('daemon',
+        type : 'boolean', value : true,
+        description : 'Enable building and installation of pulseaudio daemon and supporting configuration files')
+-option('daemon-only',
+-       type : 'boolean', value : false,
+-       description : 'Build and install only the pulseaudio daemon and supporting configuration files, relying on a system installation of libpulse')
++option('client',
++       type : 'boolean', value : true,
++       description : 'Build and install pulseaudio client libraries and utilities')
+ option('doxygen',
+        type : 'boolean', value : true,
+        description : 'Enable building and installation of documentation generated with doxygen')
+diff --git a/shell-completion/bash/meson.build b/shell-completion/bash/meson.build
+index 83d90b94b..1d5a8cdab 100644
+--- a/shell-completion/bash/meson.build
++++ b/shell-completion/bash/meson.build
+@@ -8,7 +8,7 @@ if bashcompletiondir != 'no'
+     ]
+   endif
+ 
+-  if not get_option('daemon-only')
++  if get_option('client')
+   aliases += [
+     'pacat',
+     'pactl',
+diff --git a/src/meson.build b/src/meson.build
+index ce56dbfe3..f285fdf45 100644
+--- a/src/meson.build
++++ b/src/meson.build
+@@ -186,7 +186,7 @@ else
+ endif
+ # FIXME: Do SIMD things
+ 
+-if get_option('daemon-only')
++if not get_option('client')
+   libpulsecommon_dep = cc.find_library('pulsecommon-' + pa_version_major_minor, dirs : privlibdir, required : true)
+   libpulse_dep = dependency('libpulse', required : true)
+   libpulse_simple_dep = dependency('libpulse-simple', required : true)
+diff --git a/src/tests/meson.build b/src/tests/meson.build
+index 56d71299f..b76da26cb 100644
+--- a/src/tests/meson.build
++++ b/src/tests/meson.build
+@@ -30,7 +30,7 @@ default_tests += [
+     [ check_dep, libm_dep, libpulse_dep, libpulsecommon_dep ] ],
+ ]
+ 
+-if not get_option('daemon-only')
++if get_option('client')
+   default_tests += [
+     [ 'mainloop-test', 'mainloop-test.c',
+       [ check_dep, libpulse_dep, libpulsecommon_dep ] ],
+diff --git a/src/utils/meson.build b/src/utils/meson.build
+index 7ed6e738f..f67cff4a9 100644
+--- a/src/utils/meson.build
++++ b/src/utils/meson.build
+@@ -1,4 +1,4 @@
+-if not get_option('daemon-only')
++if get_option('client')
+ pacat_sources = [
+   'pacat.c',
+ ]
+@@ -74,7 +74,7 @@ if get_option('daemon')
+   endif
+ endif
+ 
+-if not get_option('daemon-only')
++if get_option('client')
+ if x11_dep.found()
+   pax11publish_sources = [
+     'pax11publish.c',
+-- 
+2.35.1
+
+
+From 1cb8c867c7cfff71f29f4eb508b92c5139669f33 Mon Sep 17 00:00:00 2001
+From: "Igor V. Kovalenko" <igor.v.kovalenko@gmail.com>
+Date: Thu, 4 Nov 2021 19:33:32 +0300
+Subject: [PATCH 4/8] build-sys: meson: Move remaining tests under daemon and
+ client builds
+
+Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/659>
+---
+ src/tests/meson.build | 126 +++++++++++++++++++++---------------------
+ 1 file changed, 62 insertions(+), 64 deletions(-)
+
+diff --git a/src/tests/meson.build b/src/tests/meson.build
+index b76da26cb..05922a582 100644
+--- a/src/tests/meson.build
++++ b/src/tests/meson.build
+@@ -9,32 +9,47 @@
+ 
+ default_tests = []
+ 
+-default_tests += [
+-  [ 'channelmap-test', 'channelmap-test.c',
+-    [ check_dep, libpulse_dep ] ],
+-  [ 'core-util-test', 'core-util-test.c',
+-    [ check_dep, libpulse_dep, libpulsecommon_dep ] ],
+-  [ 'get-binary-name-test', 'get-binary-name-test.c',
+-    [ check_dep, libpulse_dep, libpulsecommon_dep ] ],
+-  [ 'hashmap-test', 'hashmap-test.c',
+-    [ check_dep, libpulse_dep, libpulsecommon_dep ] ],
+-  [ 'json-test', 'json-test.c',
+-    [ check_dep, libpulse_dep, libpulsecommon_dep ] ],
+-  [ 'proplist-test', 'proplist-test.c',
+-    [ check_dep, libpulse_dep, libpulsecommon_dep ] ],
+-  [ 'thread-mainloop-test', 'thread-mainloop-test.c',
+-    [ check_dep, libpulse_dep, libpulsecommon_dep ] ],
+-  [ 'utf8-test', 'utf8-test.c',
+-    [ check_dep, libpulse_dep, libpulsecommon_dep ] ],
+-  [ 'volume-test', 'volume-test.c',
+-    [ check_dep, libm_dep, libpulse_dep, libpulsecommon_dep ] ],
+-]
+-
+ if get_option('client')
++  default_tests += [
++    [ 'channelmap-test', 'channelmap-test.c',
++      [ check_dep, libpulse_dep ] ],
++    [ 'core-util-test', 'core-util-test.c',
++      [ check_dep, libpulse_dep, libpulsecommon_dep ] ],
++    [ 'get-binary-name-test', 'get-binary-name-test.c',
++      [ check_dep, libpulse_dep, libpulsecommon_dep ] ],
++    [ 'hashmap-test', 'hashmap-test.c',
++      [ check_dep, libpulse_dep, libpulsecommon_dep ] ],
++    [ 'json-test', 'json-test.c',
++      [ check_dep, libpulse_dep, libpulsecommon_dep ] ],
++    [ 'proplist-test', 'proplist-test.c',
++      [ check_dep, libpulse_dep, libpulsecommon_dep ] ],
++    [ 'thread-mainloop-test', 'thread-mainloop-test.c',
++      [ check_dep, libpulse_dep, libpulsecommon_dep ] ],
++    [ 'utf8-test', 'utf8-test.c',
++      [ check_dep, libpulse_dep, libpulsecommon_dep ] ],
++    [ 'volume-test', 'volume-test.c',
++      [ check_dep, libm_dep, libpulse_dep, libpulsecommon_dep ] ],
++  ]
++
+   default_tests += [
+     [ 'mainloop-test', 'mainloop-test.c',
+       [ check_dep, libpulse_dep, libpulsecommon_dep ] ],
+   ]
++
++  if cc.has_header('sys/eventfd.h')
++    default_tests += [
++      [ 'srbchannel-test', 'srbchannel-test.c',
++        [ check_dep, libpulse_dep, libpulsecommon_dep ] ]
++    ]
++  endif
++
++  if glib_dep.found()
++    default_tests += [
++      [ 'mainloop-test-glib', 'mainloop-test.c',
++        [ check_dep, glib_dep, libpulse_dep, libpulsecommon_dep, libpulse_mainloop_glib_dep ],
++        [], ['-DGLIB_MAIN_LOOP'] ]
++    ]
++  endif
+ endif
+ 
+ if get_option('daemon')
+@@ -101,16 +116,6 @@ if get_option('daemon')
+     ]
+   endif
+ 
+-endif
+-
+-if cc.has_header('sys/eventfd.h')
+-  default_tests += [
+-    [ 'srbchannel-test', 'srbchannel-test.c',
+-      [ check_dep, libpulse_dep, libpulsecommon_dep ] ]
+-  ]
+-endif
+-
+-if get_option('daemon')
+   if alsa_dep.found()
+     default_tests += [
+       [ 'alsa-mixer-path-test', 'alsa-mixer-path-test.c',
+@@ -120,23 +125,24 @@ if get_option('daemon')
+   endif
+ endif
+ 
+-if glib_dep.found()
+-  default_tests += [
+-    [ 'mainloop-test-glib', 'mainloop-test.c',
+-      [ check_dep, glib_dep, libpulse_dep, libpulsecommon_dep, libpulse_mainloop_glib_dep ],
+-      [], ['-DGLIB_MAIN_LOOP'] ]
+-  ]
+-endif
+-
+ # No-run tests
+ norun_tests = []
+ 
+-norun_tests += [
+-  [ 'pacat-simple', 'pacat-simple.c',
+-    [ libpulse_dep, libpulse_simple_dep ] ],
+-  [ 'parec-simple', 'parec-simple.c',
+-    [ libpulse_dep, libpulse_simple_dep ] ],
+-]
++if get_option('client')
++  norun_tests += [
++    [ 'pacat-simple', 'pacat-simple.c',
++      [ libpulse_dep, libpulse_simple_dep ] ],
++    [ 'parec-simple', 'parec-simple.c',
++      [ libpulse_dep, libpulse_simple_dep ] ],
++  ]
++
++  if gtk_dep.found() and glib_dep.found()
++    norun_tests += [
++      [ 'gtk-test', 'gtk-test.c',
++        [ gtk_dep, libpulse_dep, libpulse_mainloop_glib_dep ] ]
++    ]
++  endif
++endif
+ 
+ if get_option('daemon')
+   norun_tests += [
+@@ -182,26 +188,18 @@ if get_option('daemon')
+     ]
+   endif
+ 
+-endif
+-
+-if cc.has_function('pthread_setaffinity_np', dependencies : thread_dep)
+-  norun_tests += [
+-    [ 'atomic-test', 'atomic-test.c',
+-      [ check_dep, libpulsecommon_dep, thread_dep ] ]
+-  ]
+-endif
+-
+-if alsa_dep.found()
+-  norun_tests += [
+-    [ 'alsa-time-test', 'alsa-time-test.c', [ alsa_dep, thread_dep ] ]
+-  ]
+-endif
++  if cc.has_function('pthread_setaffinity_np', dependencies : thread_dep)
++    norun_tests += [
++      [ 'atomic-test', 'atomic-test.c',
++        [ check_dep, libpulsecommon_dep, thread_dep ] ]
++    ]
++  endif
+ 
+-if gtk_dep.found() and glib_dep.found()
+-  norun_tests += [
+-    [ 'gtk-test', 'gtk-test.c',
+-      [ gtk_dep, libpulse_dep, libpulse_mainloop_glib_dep ] ]
+-  ]
++  if alsa_dep.found()
++    norun_tests += [
++      [ 'alsa-time-test', 'alsa-time-test.c', [ alsa_dep, thread_dep ] ]
++    ]
++  endif
+ endif
+ 
+ # Generate tests
+-- 
+2.35.1
+
+
+From c283edc0bac45b2f5efba810e2ccd1d37b54b2ae Mon Sep 17 00:00:00 2001
+From: "Igor V. Kovalenko" <igor.v.kovalenko@gmail.com>
+Date: Thu, 4 Nov 2021 20:12:03 +0300
+Subject: [PATCH 5/8] build-sys: meson: Rearrange dependencies under client and
+ daemon options
+
+Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/659>
+---
+ meson.build     | 492 +++++++++++++++++++++++++-----------------------
+ src/meson.build |   3 -
+ 2 files changed, 258 insertions(+), 237 deletions(-)
+
+diff --git a/meson.build b/meson.build
+index ded6669b1..3afc31c9b 100644
+--- a/meson.build
++++ b/meson.build
+@@ -568,227 +568,237 @@ if host_machine.cpu_family() == 'arm'
+ endif
+ # NEON checks are automatically done by the unstable-simd module
+ 
+-if get_option('daemon')
+-  # FIXME: make sure it's >= 2.2
+-  ltdl_dep = cc.find_library('ltdl', required : true)
+-endif
+-
+-# FIXME: can meson support libtool -dlopen/-dlpreopen things?
+-#        and do we still want to support this at all?
+-cdata.set('DISABLE_LIBTOOL_PRELOAD', 1)
+-
+-if get_option('database') == 'tdb'
+-  database_dep = dependency('tdb')
+-elif get_option('database') == 'gdbm'
+-  database_dep = cc.find_library('gdbm', required : true)
+-else
+-  database_dep = dependency('', required: false)
+-endif
++# Dependencies common to client, daemon and modules
+ 
+ if get_option('ipv6')
+   cdata.set('HAVE_IPV6', 1)
+ endif
+ 
+-if get_option('legacy-database-entry-format')
+-  cdata.set('ENABLE_LEGACY_DATABASE_ENTRY_FORMAT', 1)
+-endif
+-
+-if get_option('stream-restore-clear-old-devices')
+-  cdata.set('STREAM_RESTORE_CLEAR_OLD_DEVICES', 1)
+-endif
+-
+-if get_option('running-from-build-tree')
+-  cdata.set('HAVE_RUNNING_FROM_BUILD_TREE', 1)
+-endif
+-
+-alsa_dep = dependency('alsa', version : '>= 1.0.24', required : get_option('alsa'))
+-if alsa_dep.found()
+-  cdata.set('HAVE_ALSA', 1)
+-  cdata.set('HAVE_ALSA_UCM', 1)
+-endif
+-
+-asyncns_dep = dependency('libasyncns', version : '>= 0.1', required : get_option('asyncns'))
+-if asyncns_dep.found()
+-  cdata.set('HAVE_LIBASYNCNS', 1)
+-endif
+-
+ dbus_dep = dependency('dbus-1', version : '>= 1.4.12', required : get_option('dbus'))
+ if dbus_dep.found()
+   cdata.set('HAVE_DBUS', 1)
+ endif
+ 
+-gio_dep = dependency('gio-2.0', version : '>= 2.26.0')
+-if get_option('gsettings').enabled()
+-  assert(gio_dep.found(), 'GSettings support needs glib I/O library (GIO)')
+-  cdata.set('HAVE_GSETTINGS', 1)
+-else
+-  cdata.set('HAVE_GSETTINGS', 0)
+-endif
+-
+-glib_dep = dependency('glib-2.0', version : '>= 2.28.0', required: get_option('glib'))
+-if glib_dep.found()
+-  cdata.set('HAVE_GLIB', 1)
+-endif
+-
+-gtk_dep = dependency('gtk+-3.0', required : get_option('gtk'))
+-if gtk_dep.found()
+-  cdata.set('HAVE_GTK', 1)
+-endif
+-
+-have_orcc = false
+-orcc_args = []
+-orc_dep = dependency('orc-0.4', version : '>= 0.4.11', required : get_option('orc'))
+-orcc = find_program('orcc', required : get_option('orc'))
+-if orc_dep.found() and orcc.found()
+-  have_orcc = true
+-  orcc_args = [orcc]
+-  #orcc_args = [orcc, '--include', 'glib.h']
+-  cdata.set('HAVE_ORC', 1)
+-else
+-  cdata.set('DISABLE_ORC', 1)
+-endif
+-
+-samplerate_dep = dependency('samplerate', version : '>= 0.1.0', required : get_option('samplerate'))
+-if samplerate_dep.found()
+-  cdata.set('HAVE_LIBSAMPLERATE', 1)
+-endif
+-
+ sndfile_dep = dependency('sndfile', version : '>= 1.0.20')
+ 
+-soxr_dep = dependency('soxr', version : '>= 0.1.1', required : get_option('soxr'))
+-if soxr_dep.found()
+-  cdata.set('HAVE_SOXR', 1)
+-endif
+-
+ libsystemd_dep = dependency('libsystemd', required : get_option('systemd'))
+ if libsystemd_dep.found()
+   cdata.set('HAVE_SYSTEMD_DAEMON', 1)
+   cdata.set('HAVE_SYSTEMD_LOGIN', 1)
+   cdata.set('HAVE_SYSTEMD_JOURNAL', 1)
+ endif
+-systemd_dep = dependency('systemd', required : get_option('systemd'))
+-if systemd_dep.found() and systemduserunitdir == ''
+-  systemduserunitdir = systemd_dep.get_pkgconfig_variable('systemduserunitdir')
+-endif
+-
+-libelogind_dep = dependency('libelogind', required : get_option('elogind'))
+-if libelogind_dep.found()
+-  cdata.set('HAVE_SYSTEMD_LOGIN', 1)
+-endif
+-
+-tcpwrap_dep = cc.find_library('wrap', required: get_option('tcpwrap'))
+-if cc.has_header('tcpd.h') and cc.has_function('hosts_access', dependencies : tcpwrap_dep)
+-  cdata.set('HAVE_LIBWRAP', 1)
+-endif
+ 
+ x11_dep = dependency('x11-xcb', required : get_option('x11'))
+-if x11_dep.found()
+-  xcb_dep  = dependency('xcb',  required : true, version : '>= 1.6')
+-  ice_dep  = dependency('ice',  required : get_option('daemon'))
+-  sm_dep   = dependency('sm',   required : get_option('daemon'))
+-  xtst_dep = dependency('xtst', required : get_option('daemon'))
+-  cdata.set('HAVE_X11', 1)
+-  if cc.has_function('XSetIOErrorExitHandler', dependencies: x11_dep)
+-    cdata.set('HAVE_XSETIOERROREXITHANDLER', 1)
+-  endif
+-endif
+ 
+-# Module dependencies
++# OSS support
+ if cc.has_header('sys/soundcard.h', required: get_option('oss-output'))
++  # OSS output via daemon module-detect
+   cdata.set('HAVE_OSS_OUTPUT', 1)
++  # OSS wrapper
+   cdata.set('HAVE_OSS_WRAPPER', 1)
+   cdata.set('PULSEDSP_LOCATION', pulsedsp_location)
+ endif
+ 
+-if get_option('hal-compat')
+-  cdata.set('HAVE_HAL_COMPAT', 1)
+-endif
++# Client library dependencies
+ 
+-avahi_dep = dependency('avahi-client', version : '>= 0.6.0', required : get_option('avahi'), disabler : true)
+-if avahi_dep.found()
+-  cdata.set('HAVE_AVAHI', 1)
+-else
+-  cdata.set('HAVE_AVAHI', 0)
++if get_option('client')
++  asyncns_dep = dependency('libasyncns', version : '>= 0.1', required : get_option('asyncns'))
++  if asyncns_dep.found()
++    cdata.set('HAVE_LIBASYNCNS', 1)
++  endif
++
++  glib_dep = dependency('glib-2.0', version : '>= 2.28.0', required: get_option('glib'))
++  if glib_dep.found()
++    cdata.set('HAVE_GLIB', 1)
++    cdata.set('HAVE_GLIB20', 1) # to match the AM_CONDITIONAL for CMake file generation
++  endif
++
++  gtk_dep = dependency('gtk+-3.0', required : get_option('gtk'))
++  if gtk_dep.found()
++    cdata.set('HAVE_GTK', 1)
++  endif
+ endif
+ 
+-sbc_dep = dependency('sbc', version : '>= 1.0', required : false)
++# Daemon and module dependencies
+ 
+-bluez_dep = dependency('bluez', required : get_option('bluez5'))
++if get_option('daemon')
++  # FIXME: make sure it's >= 2.2
++  ltdl_dep = cc.find_library('ltdl', required : true)
+ 
+-if bluez_dep.found()
+-  assert(dbus_dep.found(), 'BlueZ requires D-Bus support')
+-  assert(sbc_dep.found(), 'BlueZ requires SBC support')
+-  cdata.set('HAVE_SBC', 1)
+-  cdata.set('HAVE_BLUEZ', 1)
+-  cdata.set('HAVE_BLUEZ_5', 1)
+-  if get_option('bluez5-native-headset')
+-    cdata.set('HAVE_BLUEZ_5_NATIVE_HEADSET', 1)
++  # FIXME: can meson support libtool -dlopen/-dlpreopen things?
++  #        and do we still want to support this at all?
++  cdata.set('DISABLE_LIBTOOL_PRELOAD', 1)
++
++  if get_option('database') == 'tdb'
++    database_dep = dependency('tdb')
++  elif get_option('database') == 'gdbm'
++    database_dep = cc.find_library('gdbm', required : true)
++  else
++    database_dep = dependency('', required: false)
+   endif
+-  if get_option('bluez5-ofono-headset')
+-    cdata.set('HAVE_BLUEZ_5_OFONO_HEADSET', 1)
++
++  if get_option('legacy-database-entry-format')
++    cdata.set('ENABLE_LEGACY_DATABASE_ENTRY_FORMAT', 1)
+   endif
+-endif
+ 
+-fftw_dep = dependency('fftw3f', required : get_option('fftw'))
+-if fftw_dep.found()
+-  cdata.set('HAVE_FFTW', 1)
+-endif
++  if get_option('stream-restore-clear-old-devices')
++    cdata.set('STREAM_RESTORE_CLEAR_OLD_DEVICES', 1)
++  endif
+ 
+-jack_dep = dependency('jack', version : '>= 0.117.0', required : get_option('jack'))
+-if jack_dep.found()
+-  cdata.set('HAVE_JACK', 1)
+-endif
++  if get_option('running-from-build-tree')
++    cdata.set('HAVE_RUNNING_FROM_BUILD_TREE', 1)
++  endif
+ 
+-lirc_dep = dependency('lirc', required : get_option('lirc'))
+-if lirc_dep.found()
+-  cdata.set('HAVE_LIRC', 1)
+-endif
++  alsa_dep = dependency('alsa', version : '>= 1.0.24', required : get_option('alsa'))
++  if alsa_dep.found()
++    cdata.set('HAVE_ALSA', 1)
++    cdata.set('HAVE_ALSA_UCM', 1)
++  endif
+ 
+-openssl_dep = dependency('openssl', version : '>= 0.9', required : get_option('openssl'))
+-if openssl_dep.found()
+-  cdata.set('HAVE_OPENSSL', 1)
+-endif
++  gio_dep = dependency('gio-2.0', version : '>= 2.26.0')
++  if get_option('gsettings').enabled()
++    assert(gio_dep.found(), 'GSettings support needs glib I/O library (GIO)')
++    cdata.set('HAVE_GSETTINGS', 1)
++  else
++    cdata.set('HAVE_GSETTINGS', 0)
++  endif
+ 
+-speex_dep = dependency('speexdsp', version : '>= 1.2', required : get_option('speex'))
+-if speex_dep.found()
+-  cdata.set('HAVE_SPEEX', 1)
+-endif
++  have_orcc = false
++  orcc_args = []
++  orc_dep = dependency('orc-0.4', version : '>= 0.4.11', required : get_option('orc'))
++  orcc = find_program('orcc', required : get_option('orc'))
++  if orc_dep.found() and orcc.found()
++    have_orcc = true
++    orcc_args = [orcc]
++    #orcc_args = [orcc, '--include', 'glib.h']
++    cdata.set('HAVE_ORC', 1)
++  else
++    cdata.set('DISABLE_ORC', 1)
++  endif
+ 
+-udev_dep = dependency('libudev', version : '>= 143', required : get_option('udev'))
+-if udev_dep.found()
+-  cdata.set('HAVE_UDEV', 1)
+-endif
++  samplerate_dep = dependency('samplerate', version : '>= 0.1.0', required : get_option('samplerate'))
++  if samplerate_dep.found()
++    cdata.set('HAVE_LIBSAMPLERATE', 1)
++  endif
+ 
+-webrtc_dep = dependency('webrtc-audio-processing', version : '>= 0.2', required : get_option('webrtc-aec'))
+-if webrtc_dep.found()
+-  cdata.set('HAVE_WEBRTC', 1)
+-endif
++  speex_dep = dependency('speexdsp', version : '>= 1.2', required : get_option('speex'))
++  if speex_dep.found()
++    cdata.set('HAVE_SPEEX', 1)
++  endif
+ 
+-gst_dep = dependency('gstreamer-1.0', version : '>= 1.14', required : get_option('gstreamer'))
+-gstapp_dep = dependency('gstreamer-app-1.0', required : get_option('gstreamer'))
+-gstrtp_dep = dependency('gstreamer-rtp-1.0', required : get_option('gstreamer'))
++  soxr_dep = dependency('soxr', version : '>= 0.1.1', required : get_option('soxr'))
++  if soxr_dep.found()
++    cdata.set('HAVE_SOXR', 1)
++  endif
+ 
+-have_gstreamer = false
+-if gst_dep.found() and gstapp_dep.found() and gstrtp_dep.found()
+-  assert(gio_dep.found(), 'GStreamer-based RTP needs glib I/O library (GIO)')
+-  have_gstreamer = true
+-endif
++  webrtc_dep = dependency('webrtc-audio-processing', version : '>= 0.2', required : get_option('webrtc-aec'))
++  if webrtc_dep.found()
++    cdata.set('HAVE_WEBRTC', 1)
++  endif
+ 
+-bluez5_gst_dep = dependency('gstreamer-1.0', version : '>= 1.14', required : get_option('bluez5-gstreamer'))
+-bluez5_gstapp_dep = dependency('gstreamer-app-1.0', required : get_option('bluez5-gstreamer'))
+-have_bluez5_gstreamer = false
+-if bluez5_gst_dep.found() and bluez5_gstapp_dep.found()
+-  have_bluez5_gstreamer = true
+-  cdata.set('HAVE_GSTLDAC', 1)
+-  cdata.set('HAVE_GSTAPTX', 1)
++  systemd_dep = dependency('systemd', required : get_option('systemd'))
++  if systemd_dep.found() and systemduserunitdir == ''
++    systemduserunitdir = systemd_dep.get_pkgconfig_variable('systemduserunitdir')
++  endif
++
++  libelogind_dep = dependency('libelogind', required : get_option('elogind'))
++  if libelogind_dep.found()
++    cdata.set('HAVE_SYSTEMD_LOGIN', 1)
++  endif
++
++  tcpwrap_dep = cc.find_library('wrap', required: get_option('tcpwrap'))
++  if cc.has_header('tcpd.h') and cc.has_function('hosts_access', dependencies : tcpwrap_dep)
++    cdata.set('HAVE_LIBWRAP', 1)
++  endif
++
++  if x11_dep.found()
++    xcb_dep  = dependency('xcb',  required : true, version : '>= 1.6')
++    ice_dep  = dependency('ice',  required : true)
++    sm_dep   = dependency('sm',   required : true)
++    xtst_dep = dependency('xtst', required : true)
++    cdata.set('HAVE_X11', 1)
++    if cc.has_function('XSetIOErrorExitHandler', dependencies: x11_dep)
++      cdata.set('HAVE_XSETIOERROREXITHANDLER', 1)
++    endif
++  endif
++
++  avahi_dep = dependency('avahi-client', version : '>= 0.6.0', required : get_option('avahi'), disabler : true)
++  if avahi_dep.found()
++    cdata.set('HAVE_AVAHI', 1)
++  else
++    cdata.set('HAVE_AVAHI', 0)
++  endif
++
++  sbc_dep = dependency('sbc', version : '>= 1.0', required : false)
++
++  bluez_dep = dependency('bluez', required : get_option('bluez5'))
++
++  if bluez_dep.found()
++    assert(dbus_dep.found(), 'BlueZ requires D-Bus support')
++    assert(sbc_dep.found(), 'BlueZ requires SBC support')
++    cdata.set('HAVE_SBC', 1)
++    cdata.set('HAVE_BLUEZ', 1)
++    cdata.set('HAVE_BLUEZ_5', 1)
++    if get_option('bluez5-native-headset')
++      cdata.set('HAVE_BLUEZ_5_NATIVE_HEADSET', 1)
++    endif
++    if get_option('bluez5-ofono-headset')
++      cdata.set('HAVE_BLUEZ_5_OFONO_HEADSET', 1)
++    endif
++  endif
++
++  fftw_dep = dependency('fftw3f', required : get_option('fftw'))
++  if fftw_dep.found()
++    cdata.set('HAVE_FFTW', 1)
++  endif
++
++  jack_dep = dependency('jack', version : '>= 0.117.0', required : get_option('jack'))
++  if jack_dep.found()
++    cdata.set('HAVE_JACK', 1)
++  endif
++
++  lirc_dep = dependency('lirc', required : get_option('lirc'))
++  if lirc_dep.found()
++    cdata.set('HAVE_LIRC', 1)
++  endif
++
++  openssl_dep = dependency('openssl', version : '>= 0.9', required : get_option('openssl'))
++  if openssl_dep.found()
++    cdata.set('HAVE_OPENSSL', 1)
++  endif
++
++  udev_dep = dependency('libudev', version : '>= 143', required : get_option('udev'))
++  if udev_dep.found()
++    cdata.set('HAVE_UDEV', 1)
++  endif
++
++  if get_option('hal-compat')
++    cdata.set('HAVE_HAL_COMPAT', 1)
++  endif
++
++  gst_dep = dependency('gstreamer-1.0', version : '>= 1.14', required : get_option('gstreamer'))
++  gstapp_dep = dependency('gstreamer-app-1.0', required : get_option('gstreamer'))
++  gstrtp_dep = dependency('gstreamer-rtp-1.0', required : get_option('gstreamer'))
++
++  have_gstreamer = false
++  if gst_dep.found() and gstapp_dep.found() and gstrtp_dep.found()
++    assert(gio_dep.found(), 'GStreamer-based RTP needs glib I/O library (GIO)')
++    have_gstreamer = true
++  endif
++
++  bluez5_gst_dep = dependency('gstreamer-1.0', version : '>= 1.14', required : get_option('bluez5-gstreamer'))
++  bluez5_gstapp_dep = dependency('gstreamer-app-1.0', required : get_option('bluez5-gstreamer'))
++  have_bluez5_gstreamer = false
++  if bluez5_gst_dep.found() and bluez5_gstapp_dep.found()
++    have_bluez5_gstreamer = true
++    cdata.set('HAVE_GSTLDAC', 1)
++    cdata.set('HAVE_GSTAPTX', 1)
++  endif
+ endif
+ 
+ # These are required for the CMake file generation
+ cdata.set('PA_LIBDIR', libdir)
+ cdata.set('PA_INCDIR', includedir)
+-if glib_dep.found()
+-  cdata.set('HAVE_GLIB20', 1) # to match the AM_CONDITIONAL for CMake file generation
+-endif
+ 
+ # Test dependencies
+ 
+@@ -817,10 +827,10 @@ endif
+ # Now generate config.h from everything above
+ configure_file(output : 'config.h', configuration : cdata)
+ 
+-# pkg-config files
+-
+ if get_option('client')
+ 
++# pkg-config files
++
+ pc_cdata = configuration_data()
+ 
+ pc_cdata.set('prefix', prefix)
+@@ -853,12 +863,8 @@ foreach file : pc_files
+     install_dir : pkgconfigdir)
+ endforeach
+ 
+-endif # client
+-
+ # CMake files
+ 
+-if get_option('client')
+-
+ m4 = find_program('m4', required: true)
+ 
+ cmakedir = join_paths(libdir, 'cmake', 'PulseAudio')
+@@ -918,49 +924,66 @@ summary = [
+ #  'LIBS:                          @0@'.format(${LIBS}),
+   '',
+   'Enable pulseaudio daemon:      @0@'.format(get_option('daemon')),
++  'Enable pulseaudio client:      @0@'.format(get_option('client')),
+   '',
+   'Enable memfd shared memory:    @0@'.format(cdata.has('HAVE_MEMFD')),
+   'Enable X11:                    @0@'.format(x11_dep.found()),
+-  '  Safe X11 I/O errors:         @0@'.format(cdata.has('HAVE_XSETIOERROREXITHANDLER')),
+-  'Enable OSS Output:             @0@'.format(cdata.has('HAVE_OSS_OUTPUT')),
++  'Enable D-Bus:                  @0@'.format(dbus_dep.found()),
++  'Enable systemd integration:    @0@'.format(libsystemd_dep.found()),
++  'Enable IPv6:                   @0@'.format(get_option('ipv6')),
++  'Enable Gcov coverage:          @0@'.format(get_option('gcov')),
++  'Enable Valgrind:               @0@'.format(cdata.has('HAVE_VALGRIND_MEMCHECK_H')),
++  'Enable man pages:              @0@'.format(get_option('man')),
++  'Enable unit tests:             @0@'.format(get_option('tests')),
++]
++
++if get_option('client')
++summary += [
++  '',
++  '--- Pulseaudio client features ---',
++  '',
++  'Enable GLib 2:                 @0@'.format(glib_dep.found()),
++  'Enable Gtk+ 3:                 @0@'.format(gtk_dep.found()),
++  'Enable Async DNS:              @0@'.format(asyncns_dep.found()),
+   'Enable OSS Wrapper:            @0@'.format(cdata.has('HAVE_OSS_WRAPPER')),
++]
++endif
++
++if get_option('daemon')
++summary += [
++  '',
++  '--- Pulseaudio daemon features ---',
++  '',
++  'Safe X11 I/O errors:           @0@'.format(cdata.has('HAVE_XSETIOERROREXITHANDLER')),
++  'Enable Avahi:                  @0@'.format(avahi_dep.found()),
++  'Enable OSS Output:             @0@'.format(cdata.has('HAVE_OSS_OUTPUT')),
+ #  'Enable EsounD:                 @0@'.format(${ENABLE_ESOUND}),
+   'Enable Alsa:                   @0@'.format(alsa_dep.found()),
++  'Enable Jack:                   @0@'.format(jack_dep.found()),
++  'Enable LIRC:                   @0@'.format(lirc_dep.found()),
+ #  'Enable CoreAudio:              @0@'.format(${ENABLE_COREAUDIO}),
+ #  'Enable Solaris:                @0@'.format(${ENABLE_SOLARIS}),
+ #  'Enable WaveOut:                @0@'.format(${ENABLE_WAVEOUT}),
+-  'Enable GLib 2:                 @0@'.format(glib_dep.found()),
+   'Enable GSettings:              @0@'.format(gio_dep.found()),
+-  'Enable Gtk+ 3:                 @0@'.format(gtk_dep.found()),
+-  'Enable Avahi:                  @0@'.format(avahi_dep.found()),
+-  'Enable Jack:                   @0@'.format(jack_dep.found()),
+-  'Enable Async DNS:              @0@'.format(asyncns_dep.found()),
+-  'Enable LIRC:                   @0@'.format(lirc_dep.found()),
+-  'Enable D-Bus:                  @0@'.format(dbus_dep.found()),
+-  '  Enable BlueZ 5:              @0@'.format(cdata.has('HAVE_BLUEZ_5')),
+-  '    Enable native headsets:    @0@'.format(cdata.has('HAVE_BLUEZ_5_NATIVE_HEADSET')),
+-  '    Enable  ofono headsets:    @0@'.format(cdata.has('HAVE_BLUEZ_5_OFONO_HEADSET')),
+-  '    Enable GStreamer based codecs: @0@'.format(have_bluez5_gstreamer),
+-  'Enable udev:                   @0@'.format(udev_dep.found()),
+-  '  Enable HAL->udev compat:     @0@'.format(get_option('hal-compat')),
+-  'Enable systemd:                @0@'.format(libsystemd_dep.found()),
+-  'Enable elogind:                @0@'.format(libelogind_dep.found()),
+-  'Enable TCP Wrappers:           @0@'.format(tcpwrap_dep.found()),
++  'Enable BlueZ 5:              @0@'.format(cdata.has('HAVE_BLUEZ_5')),
++  '  Enable native headsets:    @0@'.format(cdata.has('HAVE_BLUEZ_5_NATIVE_HEADSET')),
++  '  Enable  ofono headsets:    @0@'.format(cdata.has('HAVE_BLUEZ_5_OFONO_HEADSET')),
++  '  Enable GStreamer based codecs: @0@'.format(have_bluez5_gstreamer),
++  'Enable GStreamer:              @0@'.format(have_gstreamer),
+   'Enable libsamplerate:          @0@'.format(samplerate_dep.found()),
+-  'Enable IPv6:                   @0@'.format(get_option('ipv6')),
+-  'Enable OpenSSL (for Airtunes): @0@'.format(openssl_dep.found()),
+   'Enable FFTW:                   @0@'.format(fftw_dep.found()),
+   'Enable ORC:                    @0@'.format(have_orcc),
+-  'Enable GStreamer:              @0@'.format(have_gstreamer),
+   'Enable Adrian echo canceller:  @0@'.format(get_option('adrian-aec')),
+   'Enable Speex (resampler, AEC): @0@'.format(speex_dep.found()),
+   'Enable SoXR (resampler):       @0@'.format(soxr_dep.found()),
+   'Enable WebRTC echo canceller:  @0@'.format(webrtc_dep.found()),
+-  'Enable Gcov coverage:          @0@'.format(get_option('gcov')),
+-  'Enable Valgrind:               @0@'.format(cdata.has('HAVE_VALGRIND_MEMCHECK_H')),
+-  'Enable man pages:              @0@'.format(get_option('man')),
+-  'Enable unit tests:             @0@'.format(get_option('tests')),
+   '',
++  'Enable udev:                   @0@'.format(udev_dep.found()),
++  '  Enable HAL->udev compat:     @0@'.format(get_option('hal-compat')),
++  'Enable systemd units:          @0@'.format(systemd_dep.found()),
++  'Enable elogind:                @0@'.format(libelogind_dep.found()),
++  'Enable TCP Wrappers:           @0@'.format(tcpwrap_dep.found()),
++  'Enable OpenSSL (for Airtunes): @0@'.format(openssl_dep.found()),
+   'Database:                      @0@'.format(get_option('database')),
+   'Legacy Database Entry Support: @0@'.format(get_option('legacy-database-entry-format')),
+   'module-stream-restore:',
+@@ -973,6 +996,7 @@ summary = [
+ #  'Force preopen:                 @0@'.format(${FORCE_PREOPEN}),
+ #  'Preopened modules:             @0@'.format(${PREOPEN_MODS}),
+ ]
++endif
+ 
+ message('\n    '.join(summary))
+ 
+@@ -982,38 +1006,38 @@ if get_option('daemon') and not speex_dep.found() and not webrtc_dep.found() and
+   error('At least one echo canceller implementation must be available!')
+ endif
+ 
+-if samplerate_dep.found()
++if get_option('daemon') and samplerate_dep.found()
+   warning('Support for libsamplerate is DEPRECATED')
+ endif
+ 
+-if host_machine.system() != 'windows'
+-  if not dbus_dep.found()
+-    message = [
+-      'You do not have D-Bus support enabled. It is strongly recommended',
+-      'that you enable D-Bus support if your platform supports it.',
+-      'Many parts of PulseAudio use D-Bus, from ConsoleKit interaction',
+-      'to the Device Reservation Protocol to speak to JACK, Bluetooth',
+-      'support and even a native control protocol for communicating and',
+-      'controlling the PulseAudio daemon itself.',
+-    ]
+-    warning('\n' + '\n'.join(message))
+-  endif
+-  if host_machine.system() == 'linux' and not udev_dep.found() and get_option('daemon')
+-    message = [
+-      'You do not have udev support enabled. It is strongly recommended',
+-      'that you enable udev support if your platform supports it as it is',
+-      'the primary method used to detect hardware audio devices (on Linux)',
+-      'and is thus a critical part of PulseAudio on that platform.',
+-    ]
+-    warning('\n' + '\n'.join(message))
+-  endif
+-  if not speex_dep.found() and get_option('daemon')
+-    message = [
+-      'You do not have speex support enabled. It is strongly recommended',
+-      'that you enable speex support if your platform supports it as it is',
+-      'the primary method used for audio resampling and is thus a critical',
+-      'part of PulseAudio on that platform.',
+-    ]
+-    warning('\n' + '\n'.join(message))
+-  endif
++if host_machine.system() != 'windows' and not dbus_dep.found()
++  message = [
++    'You do not have D-Bus support enabled. It is strongly recommended',
++    'that you enable D-Bus support if your platform supports it.',
++    'Many parts of PulseAudio use D-Bus, from ConsoleKit interaction',
++    'to the Device Reservation Protocol to speak to JACK, Bluetooth',
++    'support and even a native control protocol for communicating and',
++    'controlling the PulseAudio daemon itself.',
++  ]
++  warning('\n' + '\n'.join(message))
++endif
++
++if get_option('daemon') and host_machine.system() == 'linux' and not udev_dep.found()
++  message = [
++    'You do not have udev support enabled. It is strongly recommended',
++    'that you enable udev support if your platform supports it as it is',
++    'the primary method used to detect hardware audio devices (on Linux)',
++    'and is thus a critical part of PulseAudio on that platform.',
++  ]
++  warning('\n' + '\n'.join(message))
++endif
++
++if get_option('daemon') and host_machine.system() != 'windows' and not speex_dep.found()
++  message = [
++    'You do not have speex support enabled. It is strongly recommended',
++    'that you enable speex support if your platform supports it as it is',
++    'the primary method used for audio resampling and is thus a critical',
++    'part of PulseAudio on that platform.',
++  ]
++  warning('\n' + '\n'.join(message))
+ endif
+diff --git a/src/meson.build b/src/meson.build
+index f285fdf45..956350afb 100644
+--- a/src/meson.build
++++ b/src/meson.build
+@@ -190,9 +190,6 @@ if not get_option('client')
+   libpulsecommon_dep = cc.find_library('pulsecommon-' + pa_version_major_minor, dirs : privlibdir, required : true)
+   libpulse_dep = dependency('libpulse', required : true)
+   libpulse_simple_dep = dependency('libpulse-simple', required : true)
+-  if glib_dep.found()
+-    libpulse_mainloop_glib_dep = dependency('libpulse-mainloop-glib', required : true)
+-  endif
+ else
+ 
+ libpulsecommon = shared_library('pulsecommon-' + pa_version_major_minor,
+-- 
+2.35.1
+
+
+From 75e8621ae7d3cd0bf5341def3452ffef6dbce540 Mon Sep 17 00:00:00 2001
+From: "Igor V. Kovalenko" <igor.v.kovalenko@gmail.com>
+Date: Fri, 5 Nov 2021 00:34:26 +0300
+Subject: [PATCH 6/8] build-sys: meson: Rearrange shell completion between
+ daemon and client
+
+Rename bash completion file to pactl and install it with client build.
+Completions specific to daemon are now just symlinks, create target directory
+first to install them.
+
+Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/659>
+---
+ meson.build                                 |  4 +--
+ shell-completion/bash/meson.build           | 28 +++++++++++++--------
+ shell-completion/bash/{pulseaudio => pactl} |  0
+ shell-completion/zsh/meson.build            |  6 +++--
+ 4 files changed, 22 insertions(+), 16 deletions(-)
+ rename shell-completion/bash/{pulseaudio => pactl} (100%)
+
+diff --git a/meson.build b/meson.build
+index 3afc31c9b..0c4d9689c 100644
+--- a/meson.build
++++ b/meson.build
+@@ -816,9 +816,7 @@ if get_option('man')
+   subdir('man')
+ endif
+ subdir('shell-completion/bash')
+-if get_option('client')
+-  subdir('shell-completion/zsh')
+-endif
++subdir('shell-completion/zsh')
+ subdir('src')
+ if get_option('client')
+  subdir('vala')
+diff --git a/shell-completion/bash/meson.build b/shell-completion/bash/meson.build
+index 1d5a8cdab..fb406551b 100644
+--- a/shell-completion/bash/meson.build
++++ b/shell-completion/bash/meson.build
+@@ -3,27 +3,33 @@ if bashcompletiondir != 'no'
+ 
+   if get_option('daemon')
+     aliases += [
++      'pulseaudio',
+       'pacmd',
+       'pasuspender',
+     ]
++
++    # Create target directory for symlinks
++    if meson.version().version_compare('>= 0.60.0')
++      install_emptydir(bashcompletiondir)
++    else
++      meson.add_install_script('sh', '-c', 'mkdir -p $DESTDIR@0@'.format(bashcompletiondir))
++    endif
+   endif
+ 
+   if get_option('client')
+-  aliases += [
+-    'pacat',
+-    'pactl',
+-    'padsp',
+-    'paplay',
+-    'parec',
+-    'parecord',
+-  ]
++    aliases += [
++      'pacat',
++      'padsp',
++      'paplay',
++      'parec',
++      'parecord',
++    ]
++    install_data('pactl', install_dir : bashcompletiondir)
+   endif
+ 
+-  install_data('pulseaudio', install_dir : bashcompletiondir)
+-
+   foreach alias : aliases
+     dst = join_paths(bashcompletiondir, alias)
+-    cmd = 'ln -fs @0@ $DESTDIR@1@'.format('pulseaudio', dst)
++    cmd = 'ln -fs @0@ $DESTDIR@1@'.format('pactl', dst)
+     meson.add_install_script('sh', '-c', cmd)
+   endforeach
+ endif
+diff --git a/shell-completion/bash/pulseaudio b/shell-completion/bash/pactl
+similarity index 100%
+rename from shell-completion/bash/pulseaudio
+rename to shell-completion/bash/pactl
+diff --git a/shell-completion/zsh/meson.build b/shell-completion/zsh/meson.build
+index 489be569c..3f133b186 100644
+--- a/shell-completion/zsh/meson.build
++++ b/shell-completion/zsh/meson.build
+@@ -1,3 +1,5 @@
+-if zshcompletiondir != 'no'
+-  install_data('_pulseaudio', install_dir : zshcompletiondir)
++if get_option('client')
++  if zshcompletiondir != 'no'
++    install_data('_pulseaudio', install_dir : zshcompletiondir)
++  endif
+ endif
+-- 
+2.35.1
+
+
+From 748451220c5c9dbf7110071167b830ba43eea2f0 Mon Sep 17 00:00:00 2001
+From: "Igor V. Kovalenko" <igor.v.kovalenko@gmail.com>
+Date: Fri, 5 Nov 2021 01:52:38 +0300
+Subject: [PATCH 7/8] build-sys: meson: Fix indentation in daemon/client blocks
+
+Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/659>
+---
+ man/meson.build       |  28 +++----
+ meson.build           | 110 ++++++++++++++--------------
+ src/meson.build       |  35 +++++----
+ src/utils/meson.build | 166 +++++++++++++++++++++---------------------
+ 4 files changed, 169 insertions(+), 170 deletions(-)
+
+diff --git a/man/meson.build b/man/meson.build
+index 9b42c2a69..d72b3cf96 100644
+--- a/man/meson.build
++++ b/man/meson.build
+@@ -15,23 +15,23 @@ if get_option('daemon')
+ endif
+ 
+ if get_option('client')
+-manpages += [
+-  ['pacat', '1', ['paplay', 'parec', 'parecord', 'pamon']],
+-  ['pactl', '1'],
+-  ['pulse-client.conf', '5'],
+-]
+-
+-if cdata.has('HAVE_OSS_WRAPPER')
+   manpages += [
+-    ['padsp', '1'],
++    ['pacat', '1', ['paplay', 'parec', 'parecord', 'pamon']],
++    ['pactl', '1'],
++    ['pulse-client.conf', '5'],
+   ]
+-endif
+ 
+-if x11_dep.found()
+-  manpages += [
+-    ['pax11publish', '1'],
+-  ]
+-endif
++  if cdata.has('HAVE_OSS_WRAPPER')
++    manpages += [
++      ['padsp', '1'],
++    ]
++  endif
++
++  if x11_dep.found()
++    manpages += [
++      ['pax11publish', '1'],
++    ]
++  endif
+ endif
+ 
+ # FIXME: Add esdcompat if HAVE_ESOUND
+diff --git a/meson.build b/meson.build
+index 0c4d9689c..178e0cae8 100644
+--- a/meson.build
++++ b/meson.build
+@@ -827,69 +827,69 @@ configure_file(output : 'config.h', configuration : cdata)
+ 
+ if get_option('client')
+ 
+-# pkg-config files
+-
+-pc_cdata = configuration_data()
+-
+-pc_cdata.set('prefix', prefix)
+-pc_cdata.set('exec_prefix', prefix)
+-pc_cdata.set('libdir', libdir)
+-pc_cdata.set('includedir', includedir)
+-pc_cdata.set('modlibexecdir', modlibexecdir)
+-pc_cdata.set('PACKAGE_VERSION', pa_version_str)
+-pc_cdata.set('PA_MAJORMINOR', pa_version_major_minor)
+-# FIXME: the line below is wrong. Currently the meson thread dep lacks documentation,
+-# and doesn't allow introspection, ie. none of get_pkgconfig_variable() or
+-# get_configtool_variable() work with it, so we have no way to get this flag right,
+-# unless we do all the work ourselves. See current work in glib, also meson #553.
+-pc_cdata.set('PTHREAD_LIBS', '-pthread')
+-
+-pc_files = [
+-  'libpulse.pc',
+-  'libpulse-simple.pc',
+-]
++  # pkg-config files
++
++  pc_cdata = configuration_data()
++
++  pc_cdata.set('prefix', prefix)
++  pc_cdata.set('exec_prefix', prefix)
++  pc_cdata.set('libdir', libdir)
++  pc_cdata.set('includedir', includedir)
++  pc_cdata.set('modlibexecdir', modlibexecdir)
++  pc_cdata.set('PACKAGE_VERSION', pa_version_str)
++  pc_cdata.set('PA_MAJORMINOR', pa_version_major_minor)
++  # FIXME: the line below is wrong. Currently the meson thread dep lacks documentation,
++  # and doesn't allow introspection, ie. none of get_pkgconfig_variable() or
++  # get_configtool_variable() work with it, so we have no way to get this flag right,
++  # unless we do all the work ourselves. See current work in glib, also meson #553.
++  pc_cdata.set('PTHREAD_LIBS', '-pthread')
++
++  pc_files = [
++    'libpulse.pc',
++    'libpulse-simple.pc',
++  ]
+ 
+-if glib_dep.found()
+-  pc_files += 'libpulse-mainloop-glib.pc'
+-endif
++  if glib_dep.found()
++    pc_files += 'libpulse-mainloop-glib.pc'
++  endif
+ 
+-foreach file : pc_files
+-  configure_file(
+-    input : file + '.in',
+-    output : file,
+-    configuration : pc_cdata,
+-    install_dir : pkgconfigdir)
+-endforeach
++  foreach file : pc_files
++    configure_file(
++      input : file + '.in',
++      output : file,
++      configuration : pc_cdata,
++      install_dir : pkgconfigdir)
++  endforeach
+ 
+-# CMake files
++  # CMake files
+ 
+-m4 = find_program('m4', required: true)
++  m4 = find_program('m4', required: true)
+ 
+-cmakedir = join_paths(libdir, 'cmake', 'PulseAudio')
++  cmakedir = join_paths(libdir, 'cmake', 'PulseAudio')
+ 
+-cmake_template_file = configure_file(
+-  input : 'PulseAudioConfig.cmake.in',
+-  output : 'PulseAudioConfig.cmake.tmp',
+-  configuration: cdata,
+-)
++  cmake_template_file = configure_file(
++    input : 'PulseAudioConfig.cmake.in',
++    output : 'PulseAudioConfig.cmake.tmp',
++    configuration: cdata,
++  )
+ 
+-custom_target('PulseAudioConfig.cmake',
+-  input : cmake_template_file,
+-  output : 'PulseAudioConfig.cmake',
+-  capture : true,
+-  command : [m4, '@INPUT@'],
+-  build_by_default : true,
+-  install : true,
+-  install_dir : cmakedir,
+-)
++  custom_target('PulseAudioConfig.cmake',
++    input : cmake_template_file,
++    output : 'PulseAudioConfig.cmake',
++    capture : true,
++    command : [m4, '@INPUT@'],
++    build_by_default : true,
++    install : true,
++    install_dir : cmakedir,
++  )
+ 
+-configure_file(
+-  input : 'PulseAudioConfigVersion.cmake.in',
+-  output : 'PulseAudioConfigVersion.cmake',
+-  configuration: cdata,
+-  install : true,
+-  install_dir : cmakedir,
+-)
++  configure_file(
++    input : 'PulseAudioConfigVersion.cmake.in',
++    output : 'PulseAudioConfigVersion.cmake',
++    configuration: cdata,
++    install : true,
++    install_dir : cmakedir,
++  )
+ 
+ endif # client
+ 
+diff --git a/src/meson.build b/src/meson.build
+index 956350afb..f191d7f0e 100644
+--- a/src/meson.build
++++ b/src/meson.build
+@@ -191,26 +191,25 @@ if not get_option('client')
+   libpulse_dep = dependency('libpulse', required : true)
+   libpulse_simple_dep = dependency('libpulse-simple', required : true)
+ else
++  libpulsecommon = shared_library('pulsecommon-' + pa_version_major_minor,
++    libpulsecommon_sources,
++    libpulsecommon_headers,
++    include_directories : [configinc, topinc],
++    c_args : [pa_c_args],
++    link_args : [nodelete_link_args],
++    install : true,
++    install_dir : privlibdir,
++    dependencies : [
++      libm_dep, thread_dep, dl_dep, shm_dep, iconv_dep, sndfile_dep, dbus_dep,
++      x11_dep, libsystemd_dep, glib_dep.partial_dependency(compile_args: true),
++      gtk_dep.partial_dependency(compile_args: true), asyncns_dep, libintl_dep,
++      platform_dep, platform_socket_dep, execinfo_dep,
++    ],
++    implicit_include_directories : false)
+ 
+-libpulsecommon = shared_library('pulsecommon-' + pa_version_major_minor,
+-  libpulsecommon_sources,
+-  libpulsecommon_headers,
+-  include_directories : [configinc, topinc],
+-  c_args : [pa_c_args],
+-  link_args : [nodelete_link_args],
+-  install : true,
+-  install_dir : privlibdir,
+-  dependencies : [
+-    libm_dep, thread_dep, dl_dep, shm_dep, iconv_dep, sndfile_dep, dbus_dep,
+-    x11_dep, libsystemd_dep, glib_dep.partial_dependency(compile_args: true),
+-    gtk_dep.partial_dependency(compile_args: true), asyncns_dep, libintl_dep,
+-    platform_dep, platform_socket_dep, execinfo_dep,
+-  ],
+-  implicit_include_directories : false)
++  libpulsecommon_dep = declare_dependency(link_with: libpulsecommon)
+ 
+-libpulsecommon_dep = declare_dependency(link_with: libpulsecommon)
+-
+-subdir('pulse')
++  subdir('pulse')
+ endif
+ 
+ if get_option('daemon')
+diff --git a/src/utils/meson.build b/src/utils/meson.build
+index f67cff4a9..28e1fc10a 100644
+--- a/src/utils/meson.build
++++ b/src/utils/meson.build
+@@ -1,47 +1,47 @@
+ if get_option('client')
+-pacat_sources = [
+-  'pacat.c',
+-]
+-
+-pacat_aliases = [
+-  'pamon',
+-  'paplay',
+-  'parec',
+-  'parecord',
+-]
+-
+-executable('pacat',
+-  pacat_sources,
+-  install: true,
+-  install_rpath : privlibdir,
+-  include_directories : [configinc, topinc],
+-  link_with : [libpulsecommon, libpulse],
+-  dependencies : [sndfile_dep, libintl_dep],
+-  c_args : pa_c_args,
+-)
+-
+-# Windows doesn't support symbolic links.
+-if host_machine.system() != 'windows'
+-  foreach alias : pacat_aliases
+-    dst = join_paths(bindir, alias)
+-    cmd = 'ln -fs @0@ $DESTDIR@1@'.format('pacat', dst)
+-    meson.add_install_script('sh', '-c', cmd)
+-  endforeach
+-endif
++  pacat_sources = [
++    'pacat.c',
++  ]
++
++  pacat_aliases = [
++    'pamon',
++    'paplay',
++    'parec',
++    'parecord',
++  ]
++
++  executable('pacat',
++    pacat_sources,
++    install: true,
++    install_rpath : privlibdir,
++    include_directories : [configinc, topinc],
++    link_with : [libpulsecommon, libpulse],
++    dependencies : [sndfile_dep, libintl_dep],
++    c_args : pa_c_args,
++  )
++
++  # Windows doesn't support symbolic links.
++  if host_machine.system() != 'windows'
++    foreach alias : pacat_aliases
++      dst = join_paths(bindir, alias)
++      cmd = 'ln -fs @0@ $DESTDIR@1@'.format('pacat', dst)
++      meson.add_install_script('sh', '-c', cmd)
++    endforeach
++  endif
+ 
+-pactl_sources = [
+-  'pactl.c',
+-]
+-
+-executable('pactl',
+-  pactl_sources,
+-  install: true,
+-  install_rpath : privlibdir,
+-  include_directories : [configinc, topinc],
+-  link_with : [libpulsecommon, libpulse],
+-  dependencies : [sndfile_dep, libintl_dep],
+-  c_args : pa_c_args,
+-)
++  pactl_sources = [
++    'pactl.c',
++  ]
++
++  executable('pactl',
++    pactl_sources,
++    install: true,
++    install_rpath : privlibdir,
++    include_directories : [configinc, topinc],
++    link_with : [libpulsecommon, libpulse],
++    dependencies : [sndfile_dep, libintl_dep],
++    c_args : pa_c_args,
++  )
+ endif
+ 
+ if get_option('daemon')
+@@ -75,51 +75,51 @@ if get_option('daemon')
+ endif
+ 
+ if get_option('client')
+-if x11_dep.found()
+-  pax11publish_sources = [
+-    'pax11publish.c',
+-  ]
++  if x11_dep.found()
++    pax11publish_sources = [
++      'pax11publish.c',
++    ]
+ 
+-  executable('pax11publish',
+-    pax11publish_sources,
+-    install: true,
+-    install_rpath : privlibdir,
+-    include_directories : [configinc, topinc],
+-    link_with : [libpulsecommon, libpulse],
+-    dependencies : [x11_dep, libintl_dep],
+-    c_args : pa_c_args,
+-  )
+-endif
++    executable('pax11publish',
++      pax11publish_sources,
++      install: true,
++      install_rpath : privlibdir,
++      include_directories : [configinc, topinc],
++      link_with : [libpulsecommon, libpulse],
++      dependencies : [x11_dep, libintl_dep],
++      c_args : pa_c_args,
++    )
++  endif
+ 
+-if cdata.has('HAVE_OSS_WRAPPER')
+-  libpulsecommon_sources = [
+-    'padsp.c',
+-  ]
++  if cdata.has('HAVE_OSS_WRAPPER')
++    libpulsecommon_sources = [
++      'padsp.c',
++    ]
+ 
+-  libpulsedsp = shared_library('pulsedsp',
+-    libpulsecommon_sources,
+-    install: true,
+-    install_dir : padsplibdir,
+-    install_rpath : privlibdir,
+-    include_directories : [configinc, topinc],
+-    link_with : [libpulsecommon, libpulse],
+-    link_args : [nodelete_link_args],
+-    dependencies: [thread_dep, dl_dep],
+-    c_args : [pa_c_args, '-Wno-nonnull-compare']
+-  )
++    libpulsedsp = shared_library('pulsedsp',
++      libpulsecommon_sources,
++      install: true,
++      install_dir : padsplibdir,
++      install_rpath : privlibdir,
++      include_directories : [configinc, topinc],
++      link_with : [libpulsecommon, libpulse],
++      link_args : [nodelete_link_args],
++      dependencies: [thread_dep, dl_dep],
++      c_args : [pa_c_args, '-Wno-nonnull-compare']
++    )
+ 
+-  configure_file(
+-    input : 'padsp.in',
+-    output : 'padsp',
+-    configuration : cdata,
+-    install : true,
+-    install_dir : bindir,
+-  )
+-endif
++    configure_file(
++      input : 'padsp.in',
++      output : 'padsp',
++      configuration : cdata,
++      install : true,
++      install_dir : bindir,
++    )
++  endif
+ 
+-if dbus_dep.found() and fftw_dep.found()
+-  install_data('qpaeq', install_dir : bindir)
+-endif
++  if dbus_dep.found() and fftw_dep.found()
++    install_data('qpaeq', install_dir : bindir)
++  endif
+ 
+-install_data('pa-info', install_dir : bindir)
++  install_data('pa-info', install_dir : bindir)
+ endif
+-- 
+2.35.1
+
+
+From 18a81ce6f15e3fd07ed2369f506b342f90c1908a Mon Sep 17 00:00:00 2001
+From: "Igor V. Kovalenko" <igor.v.kovalenko@gmail.com>
+Date: Thu, 11 Nov 2021 01:44:30 +0300
+Subject: [PATCH 8/8] build-sys: meson: Make glib and fftw common dependencies
+
+GSettings module (daemon) requires both gio and glib, move glib to common block.
+qpaeq requires fftw, move fftw to common block.
+
+Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/659>
+---
+ meson.build                       | 26 +++++++++++++-------------
+ src/modules/gsettings/meson.build |  2 +-
+ src/modules/meson.build           |  2 +-
+ 3 files changed, 15 insertions(+), 15 deletions(-)
+
+diff --git a/meson.build b/meson.build
+index 178e0cae8..bb829eabc 100644
+--- a/meson.build
++++ b/meson.build
+@@ -579,6 +579,12 @@ if dbus_dep.found()
+   cdata.set('HAVE_DBUS', 1)
+ endif
+ 
++glib_dep = dependency('glib-2.0', version : '>= 2.28.0', required: get_option('glib'))
++if glib_dep.found()
++  cdata.set('HAVE_GLIB', 1)
++  cdata.set('HAVE_GLIB20', 1) # to match the AM_CONDITIONAL for CMake file generation
++endif
++
+ sndfile_dep = dependency('sndfile', version : '>= 1.0.20')
+ 
+ libsystemd_dep = dependency('libsystemd', required : get_option('systemd'))
+@@ -599,6 +605,11 @@ if cc.has_header('sys/soundcard.h', required: get_option('oss-output'))
+   cdata.set('PULSEDSP_LOCATION', pulsedsp_location)
+ endif
+ 
++fftw_dep = dependency('fftw3f', required : get_option('fftw'))
++if fftw_dep.found()
++  cdata.set('HAVE_FFTW', 1)
++endif
++
+ # Client library dependencies
+ 
+ if get_option('client')
+@@ -607,12 +618,6 @@ if get_option('client')
+     cdata.set('HAVE_LIBASYNCNS', 1)
+   endif
+ 
+-  glib_dep = dependency('glib-2.0', version : '>= 2.28.0', required: get_option('glib'))
+-  if glib_dep.found()
+-    cdata.set('HAVE_GLIB', 1)
+-    cdata.set('HAVE_GLIB20', 1) # to match the AM_CONDITIONAL for CMake file generation
+-  endif
+-
+   gtk_dep = dependency('gtk+-3.0', required : get_option('gtk'))
+   if gtk_dep.found()
+     cdata.set('HAVE_GTK', 1)
+@@ -747,11 +752,6 @@ if get_option('daemon')
+     endif
+   endif
+ 
+-  fftw_dep = dependency('fftw3f', required : get_option('fftw'))
+-  if fftw_dep.found()
+-    cdata.set('HAVE_FFTW', 1)
+-  endif
+-
+   jack_dep = dependency('jack', version : '>= 0.117.0', required : get_option('jack'))
+   if jack_dep.found()
+     cdata.set('HAVE_JACK', 1)
+@@ -927,7 +927,9 @@ summary = [
+   'Enable memfd shared memory:    @0@'.format(cdata.has('HAVE_MEMFD')),
+   'Enable X11:                    @0@'.format(x11_dep.found()),
+   'Enable D-Bus:                  @0@'.format(dbus_dep.found()),
++  'Enable GLib 2:                 @0@'.format(glib_dep.found()),
+   'Enable systemd integration:    @0@'.format(libsystemd_dep.found()),
++  'Enable FFTW:                   @0@'.format(fftw_dep.found()),
+   'Enable IPv6:                   @0@'.format(get_option('ipv6')),
+   'Enable Gcov coverage:          @0@'.format(get_option('gcov')),
+   'Enable Valgrind:               @0@'.format(cdata.has('HAVE_VALGRIND_MEMCHECK_H')),
+@@ -940,7 +942,6 @@ summary += [
+   '',
+   '--- Pulseaudio client features ---',
+   '',
+-  'Enable GLib 2:                 @0@'.format(glib_dep.found()),
+   'Enable Gtk+ 3:                 @0@'.format(gtk_dep.found()),
+   'Enable Async DNS:              @0@'.format(asyncns_dep.found()),
+   'Enable OSS Wrapper:            @0@'.format(cdata.has('HAVE_OSS_WRAPPER')),
+@@ -969,7 +970,6 @@ summary += [
+   '  Enable GStreamer based codecs: @0@'.format(have_bluez5_gstreamer),
+   'Enable GStreamer:              @0@'.format(have_gstreamer),
+   'Enable libsamplerate:          @0@'.format(samplerate_dep.found()),
+-  'Enable FFTW:                   @0@'.format(fftw_dep.found()),
+   'Enable ORC:                    @0@'.format(have_orcc),
+   'Enable Adrian echo canceller:  @0@'.format(get_option('adrian-aec')),
+   'Enable Speex (resampler, AEC): @0@'.format(speex_dep.found()),
+diff --git a/src/modules/gsettings/meson.build b/src/modules/gsettings/meson.build
+index 9604699e7..32177e3ec 100644
+--- a/src/modules/gsettings/meson.build
++++ b/src/modules/gsettings/meson.build
+@@ -8,7 +8,7 @@ gsettings_helper = executable('gsettings-helper',
+   gsettings_helper_sources,
+   c_args : pa_c_args,
+   include_directories : [configinc, topinc],
+-  dependencies : [gio_dep, libpulsecommon_dep, libpulse_dep],
++  dependencies : [gio_dep, glib_dep, libpulsecommon_dep, libpulse_dep],
+   install_dir : pulselibexecdir,
+   install_rpath : privlibdir,
+   install : true,
+diff --git a/src/modules/meson.build b/src/modules/meson.build
+index be72c3b9b..ccc06d001 100644
+--- a/src/modules/meson.build
++++ b/src/modules/meson.build
+@@ -161,7 +161,7 @@ if dbus_dep.found() and fftw_dep.found()
+   ]
+ endif
+ 
+-if get_option('gsettings').enabled() and gio_dep.found()
++if get_option('gsettings').enabled() and glib_dep.found() and gio_dep.found()
+   subdir('gsettings')
+   all_modules += [
+     [ 'module-gsettings',
+-- 
+2.35.1
+

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
new file mode 100644
index 000000000000..51f1314c9b34
--- /dev/null
+++ b/media-libs/libpulse/files/pulseaudio-15.0-move-systemd-socket-activation-code.patch
@@ -0,0 +1,284 @@
+commit 733969ac1917f02923e2a5869a8e14a582e0ba2e
+Author: Igor V. Kovalenko <igor.v.kovalenko@gmail.com>
+Date:   Sat Sep 25 13:22:09 2021 +0300
+
+    socket-server: Move systemd socket activation code to pulsecore
+    
+    There is no need to support server sockets in client library. Move all related
+    code and tcp-wrappers dependency to pulsecore library.
+    
+    Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/640>
+
+diff --git a/src/meson.build b/src/meson.build
+index e2860811b..59a9b16bf 100644
+--- a/src/meson.build
++++ b/src/meson.build
+@@ -57,7 +57,6 @@ libpulsecommon_sources = [
+   'pulsecore/shm.c',
+   'pulsecore/bitset.c',
+   'pulsecore/socket-client.c',
+-  'pulsecore/socket-server.c',
+   'pulsecore/socket-util.c',
+   'pulsecore/strbuf.c',
+   'pulsecore/strlist.c',
+@@ -136,7 +135,6 @@ libpulsecommon_headers = [
+   'pulsecore/shm.h',
+   'pulsecore/bitset.h',
+   'pulsecore/socket-client.h',
+-  'pulsecore/socket-server.h',
+   'pulsecore/socket-util.h',
+   'pulsecore/strbuf.h',
+   'pulsecore/strlist.h',
+@@ -200,7 +198,7 @@ libpulsecommon = shared_library('pulsecommon-' + pa_version_major_minor,
+     libm_dep, thread_dep, dl_dep, shm_dep, iconv_dep, sndfile_dep, dbus_dep,
+     x11_dep, libsystemd_dep, glib_dep.partial_dependency(compile_args: true),
+     gtk_dep.partial_dependency(compile_args: true), asyncns_dep, libintl_dep,
+-    platform_dep, tcpwrap_dep, platform_socket_dep, execinfo_dep,
++    platform_dep, platform_socket_dep, execinfo_dep,
+   ],
+   implicit_include_directories : false)
+ 
+diff --git a/src/pulsecore/meson.build b/src/pulsecore/meson.build
+index d7f9ef2cf..b30264b3a 100644
+--- a/src/pulsecore/meson.build
++++ b/src/pulsecore/meson.build
+@@ -44,6 +44,7 @@ libpulsecore_sources = [
+   'sink.c',
+   'sink-input.c',
+   'sioman.c',
++  'socket-server.c',
+   'sound-file-stream.c',
+   'sound-file.c',
+   'source.c',
+@@ -101,6 +102,7 @@ libpulsecore_headers = [
+   'sink-input.h',
+   'sink.h',
+   'sioman.h',
++  'socket-server.h',
+   'sound-file-stream.h',
+   'sound-file.h',
+   'source-output.h',
+@@ -222,7 +224,7 @@ libpulsecore = shared_library('pulsecore-' + pa_version_major_minor,
+   install_rpath : privlibdir,
+   install_dir : privlibdir,
+   link_with : libpulsecore_simd_lib,
+-  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,],
++  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,],
+   implicit_include_directories : false)
+ 
+ libpulsecore_dep = declare_dependency(link_with: libpulsecore)
+diff --git a/src/pulsecore/socket-server.c b/src/pulsecore/socket-server.c
+index 13d8a99f7..b13012b6d 100644
+--- a/src/pulsecore/socket-server.c
++++ b/src/pulsecore/socket-server.c
+@@ -642,3 +642,83 @@ char *pa_socket_server_get_address(pa_socket_server *s, char *c, size_t l) {
+             return NULL;
+     }
+ }
++
++#ifdef HAVE_SYS_UN_H
++
++int pa_unix_socket_is_stale(const char *fn) {
++    struct sockaddr_un sa;
++    int fd = -1, ret = -1;
++
++    pa_assert(fn);
++
++    if ((fd = pa_socket_cloexec(PF_UNIX, SOCK_STREAM, 0)) < 0) {
++        pa_log("socket(): %s", pa_cstrerror(errno));
++        goto finish;
++    }
++
++    sa.sun_family = AF_UNIX;
++    strncpy(sa.sun_path, fn, sizeof(sa.sun_path)-1);
++    sa.sun_path[sizeof(sa.sun_path) - 1] = 0;
++
++    if (connect(fd, (struct sockaddr*) &sa, sizeof(sa)) < 0) {
++#if !defined(OS_IS_WIN32)
++        if (errno == ECONNREFUSED)
++            ret = 1;
++#else
++        if (WSAGetLastError() == WSAECONNREFUSED || WSAGetLastError() == WSAEINVAL)
++            ret = 1;
++#endif
++    } else
++        ret = 0;
++
++finish:
++    if (fd >= 0)
++        pa_close(fd);
++
++    return ret;
++}
++
++int pa_unix_socket_remove_stale(const char *fn) {
++    int r;
++
++    pa_assert(fn);
++
++#ifdef HAVE_SYSTEMD_DAEMON
++    {
++        int n = sd_listen_fds(0);
++        if (n > 0) {
++            for (int i = 0; i < n; ++i) {
++                if (sd_is_socket_unix(SD_LISTEN_FDS_START + i, SOCK_STREAM, 1, fn, 0) > 0) {
++                    /* This is a socket activated socket, therefore do not consider
++                    * it stale. */
++                    return 0;
++                }
++            }
++        }
++    }
++#endif
++
++    if ((r = pa_unix_socket_is_stale(fn)) < 0)
++        return errno != ENOENT ? -1 : 0;
++
++    if (!r)
++        return 0;
++
++    /* Yes, here is a race condition. But who cares? */
++    if (unlink(fn) < 0)
++        return -1;
++
++    return 0;
++}
++
++#else /* HAVE_SYS_UN_H */
++
++int pa_unix_socket_is_stale(const char *fn) {
++    return -1;
++}
++
++int pa_unix_socket_remove_stale(const char *fn) {
++    return -1;
++}
++
++#endif /* HAVE_SYS_UN_H */
+diff --git a/src/pulsecore/socket-server.h b/src/pulsecore/socket-server.h
+index 0793baf44..b1f093921 100644
+--- a/src/pulsecore/socket-server.h
++++ b/src/pulsecore/socket-server.h
+@@ -50,4 +50,7 @@ void pa_socket_server_set_callback(pa_socket_server*s, pa_socket_server_on_conne
+ 
+ char *pa_socket_server_get_address(pa_socket_server *s, char *c, size_t l);
+ 
++int pa_unix_socket_is_stale(const char *fn);
++int pa_unix_socket_remove_stale(const char *fn);
++
+ #endif
+diff --git a/src/pulsecore/socket-util.c b/src/pulsecore/socket-util.c
+index f2c8c3c31..4ede0439e 100644
+--- a/src/pulsecore/socket-util.c
++++ b/src/pulsecore/socket-util.c
+@@ -50,9 +50,6 @@
+ #ifdef HAVE_NETDB_H
+ #include <netdb.h>
+ #endif
+-#ifdef HAVE_SYSTEMD_DAEMON
+-#include <systemd/sd-daemon.h>
+-#endif
+ 
+ #include <pulsecore/core-error.h>
+ #include <pulsecore/core-util.h>
+@@ -221,86 +218,6 @@ int pa_socket_set_sndbuf(int fd, size_t l) {
+     return 0;
+ }
+ 
+-#ifdef HAVE_SYS_UN_H
+-
+-int pa_unix_socket_is_stale(const char *fn) {
+-    struct sockaddr_un sa;
+-    int fd = -1, ret = -1;
+-
+-    pa_assert(fn);
+-
+-    if ((fd = pa_socket_cloexec(PF_UNIX, SOCK_STREAM, 0)) < 0) {
+-        pa_log("socket(): %s", pa_cstrerror(errno));
+-        goto finish;
+-    }
+-
+-    sa.sun_family = AF_UNIX;
+-    strncpy(sa.sun_path, fn, sizeof(sa.sun_path)-1);
+-    sa.sun_path[sizeof(sa.sun_path) - 1] = 0;
+-
+-    if (connect(fd, (struct sockaddr*) &sa, sizeof(sa)) < 0) {
+-#if !defined(OS_IS_WIN32)
+-        if (errno == ECONNREFUSED)
+-            ret = 1;
+-#else
+-        if (WSAGetLastError() == WSAECONNREFUSED || WSAGetLastError() == WSAEINVAL)
+-            ret = 1;
+-#endif
+-    } else
+-        ret = 0;
+-
+-finish:
+-    if (fd >= 0)
+-        pa_close(fd);
+-
+-    return ret;
+-}
+-
+-int pa_unix_socket_remove_stale(const char *fn) {
+-    int r;
+-
+-    pa_assert(fn);
+-
+-#ifdef HAVE_SYSTEMD_DAEMON
+-    {
+-        int n = sd_listen_fds(0);
+-        if (n > 0) {
+-            for (int i = 0; i < n; ++i) {
+-                if (sd_is_socket_unix(SD_LISTEN_FDS_START + i, SOCK_STREAM, 1, fn, 0) > 0) {
+-                    /* This is a socket activated socket, therefore do not consider
+-                    * it stale. */
+-                    return 0;
+-                }
+-            }
+-        }
+-    }
+-#endif
+-
+-    if ((r = pa_unix_socket_is_stale(fn)) < 0)
+-        return errno != ENOENT ? -1 : 0;
+-
+-    if (!r)
+-        return 0;
+-
+-    /* Yes, here is a race condition. But who cares? */
+-    if (unlink(fn) < 0)
+-        return -1;
+-
+-    return 0;
+-}
+-
+-#else /* HAVE_SYS_UN_H */
+-
+-int pa_unix_socket_is_stale(const char *fn) {
+-    return -1;
+-}
+-
+-int pa_unix_socket_remove_stale(const char *fn) {
+-    return -1;
+-}
+-
+-#endif /* HAVE_SYS_UN_H */
+-
+ bool pa_socket_address_is_local(const struct sockaddr *sa) {
+     pa_assert(sa);
+ 
+diff --git a/src/pulsecore/socket-util.h b/src/pulsecore/socket-util.h
+index f12076936..83c730bd9 100644
+--- a/src/pulsecore/socket-util.h
++++ b/src/pulsecore/socket-util.h
+@@ -35,9 +35,6 @@ void pa_make_udp_socket_low_delay(int fd);
+ int pa_socket_set_sndbuf(int fd, size_t l);
+ int pa_socket_set_rcvbuf(int fd, size_t l);
+ 
+-int pa_unix_socket_is_stale(const char *fn);
+-int pa_unix_socket_remove_stale(const char *fn);
+-
+ bool pa_socket_address_is_local(const struct sockaddr *sa);
+ bool pa_socket_is_local(int fd);
+ 

diff --git a/media-libs/libpulse/libpulse-15.0.ebuild b/media-libs/libpulse/libpulse-15.0-r1.ebuild
similarity index 88%
rename from media-libs/libpulse/libpulse-15.0.ebuild
rename to media-libs/libpulse/libpulse-15.0-r1.ebuild
index 44b59893433b..2457ca28651b 100644
--- a/media-libs/libpulse/libpulse-15.0.ebuild
+++ b/media-libs/libpulse/libpulse-15.0-r1.ebuild
@@ -71,9 +71,11 @@ BDEPEND="
 
 DOCS=( NEWS README )
 
+# patches merged upstream, to be removed with 16.0 bump
 PATCHES=(
 	"${FILESDIR}"/pulseaudio-15.0-xice-xsm-xtst-daemon-only.patch
-	"${FILESDIR}"/${PV}-no-aec.patch
+	"${FILESDIR}"/pulseaudio-15.0-move-systemd-socket-activation-code.patch
+	"${FILESDIR}"/pulseaudio-15.0-daemon-client-split-build.patch
 )
 
 src_prepare() {
@@ -87,6 +89,7 @@ multilib_src_configure() {
 		--localstatedir="${EPREFIX}"/var
 
 		-Ddaemon=false
+		-Dclient=true
 		$(meson_native_use_bool doc doxygen)
 		-Dgcov=false
 		# tests involve random modules, so just do them for the native # TODO: tests should run always
@@ -171,6 +174,15 @@ multilib_src_install() {
 	# therefore clear the variable when calling the function that will access it.
 	DOCS= meson_src_install
 
+	# Upstream installs 'pactl' if client is built, with all symlinks except for
+	# 'pulseaudio', 'pacmd' and 'pasuspender' which are installed if server is built.
+	# This trips QA warning, workaround:
+	# - install missing aliases in media-libs/libpulse (client build)
+	# - remove corresponding symlinks in media-sound/pulseaudio-daemonclient (server build)
+	bashcomp_alias pactl pulseaudio
+	bashcomp_alias pactl pacmd
+	bashcomp_alias pactl pasuspender
+
 	if multilib_is_native_abi; then
 		if use doc; then
 			einfo "Installing documentation ..."

diff --git a/media-sound/pulseaudio-daemon/Manifest b/media-sound/pulseaudio-daemon/Manifest
index 308d59508744..620fb8498703 100644
--- a/media-sound/pulseaudio-daemon/Manifest
+++ b/media-sound/pulseaudio-daemon/Manifest
@@ -1 +1,2 @@
 DIST pulseaudio-15.0.tar.xz 1521760 BLAKE2B a6f7b74fdcfe7f2a993eafb9f465946915a24b6801d3077971b9377290d6c70b3f8640a800abd09d5901db96a20349f31b1beedd9da2249f69b591fb8392f489 SHA512 352ef20384c76c631c0faa73b08e2318902a433712e0c086a5ac7a0ae58873c8d4be8f35879bdec71a93b19ae8e2ba073cacac4d56215bcf58375a0cd9d88833
+DIST pulseaudio-daemon-15.0-patchset-1.tar.bz2 13739 BLAKE2B 0a9497536481b79ebb9928fc753d44cde30b331890cf7a912f0e038fc270a79e4774fdca209a52b6d50de93e32c30c6636e4d7e57e9daceb90ee80e699599ac8 SHA512 04d98d2a1862cc65cc48837bd3c9d6c8ece4591966bc9d673c8273b445fc63dcc59d8aa891ae8c802ebacacdf56e2790a3f20a95009107c5e5cf6581d1f5f996

diff --git a/media-sound/pulseaudio-daemon/files/15.0-daemon-only.patch b/media-sound/pulseaudio-daemon/files/15.0-daemon-only.patch
deleted file mode 100644
index 4d99c1ebe639..000000000000
--- a/media-sound/pulseaudio-daemon/files/15.0-daemon-only.patch
+++ /dev/null
@@ -1,298 +0,0 @@
-From f4f28cc436a506d1dfbd514968b2976ab31cdf5f Mon Sep 17 00:00:00 2001
-From: Mart Raudsepp <mart@leio.tech>
-Date: Fri, 24 Sep 2021 15:19:05 +0300
-Subject: [PATCH] build-sys: meson: Allow building the daemon only
-
----
- man/meson.build                   |  2 ++
- meson.build                       | 23 ++++++++++++++++++++---
- meson_options.txt                 |  3 +++
- po/meson.build                    |  3 ---
- shell-completion/bash/meson.build |  2 ++
- src/daemon/meson.build            |  4 ++--
- src/meson.build                   | 11 +++++++++++
- src/modules/gsettings/meson.build |  3 +--
- src/tests/meson.build             |  9 +++++++--
- src/utils/meson.build             | 10 ++++++----
- 10 files changed, 54 insertions(+), 16 deletions(-)
-
-diff --git a/man/meson.build b/man/meson.build
-index 31c581a8f..c12ad5e6a 100644
---- a/man/meson.build
-+++ b/man/meson.build
-@@ -14,6 +14,7 @@ if get_option('daemon')
-   ]
- endif
- 
-+if not get_option('daemon-only')
- manpages += [
-   ['pacat', '1', ['paplay', 'parec', 'parecord', 'pamon']],
-   ['pactl', '1'],
-@@ -31,6 +32,7 @@ if x11_dep.found()
-     ['pax11publish', '1'],
-   ]
- endif
-+endif
- 
- # FIXME: Add esdcompat if HAVE_ESOUND
- #manpages += ['esdcompat', '1'],
-diff --git a/meson.build b/meson.build
-index 63ed62342..420cc6fac 100644
---- a/meson.build
-+++ b/meson.build
-@@ -53,6 +53,8 @@ libpulse_mainloop_glib_version = '@0@.@1@.@2@'.format(
-   libpulse_mainloop_glib_version_info[1],
- )
- 
-+i18n = import('i18n')
-+
- # Paths
- 
- prefix = get_option('prefix')
-@@ -68,6 +70,7 @@ localedir = join_paths(prefix, get_option('localedir'))
- localstatedir = join_paths(prefix, get_option('localstatedir'))
- sysconfdir = join_paths(prefix, get_option('sysconfdir'))
- privlibdir = join_paths(libdir, 'pulseaudio')
-+po_dir = join_paths(meson.current_source_dir(), 'po')
- 
- if host_machine.system() == 'windows'
-   # Windows only supports loading libraries from the same dir as the executable
-@@ -796,20 +799,28 @@ check_dep = dependency('check', version : '>= 0.9.10', required : get_option('te
- if get_option('doxygen')
-   subdir('doxygen')
- endif
--subdir('po')
-+if not get_option('daemon-only')
-+  subdir('po')
-+endif
- if get_option('man')
-   subdir('man')
- endif
- subdir('shell-completion/bash')
--subdir('shell-completion/zsh')
-+if not get_option('daemon-only')
-+  subdir('shell-completion/zsh')
-+endif
- subdir('src')
--subdir('vala')
-+if not get_option('daemon-only')
-+ subdir('vala')
-+endif
- 
- # Now generate config.h from everything above
- configure_file(output : 'config.h', configuration : cdata)
- 
- # pkg-config files
- 
-+if not get_option('daemon-only')
-+
- pc_cdata = configuration_data()
- 
- pc_cdata.set('prefix', prefix)
-@@ -842,8 +853,12 @@ foreach file : pc_files
-     install_dir : pkgconfigdir)
- endforeach
- 
-+endif # !daemon-only
-+
- # CMake files
- 
-+if not get_option('daemon-only')
-+
- m4 = find_program('m4', required: true)
- 
- cmakedir = join_paths(libdir, 'cmake', 'PulseAudio')
-@@ -872,6 +887,8 @@ configure_file(
-   install_dir : cmakedir,
- )
- 
-+endif # !daemon-only
-+
- ############################################################
- 
- # Final summary
-diff --git a/meson_options.txt b/meson_options.txt
-index bb41a42a7..62828ac5c 100644
---- a/meson_options.txt
-+++ b/meson_options.txt
-@@ -1,6 +1,9 @@
- option('daemon',
-        type : 'boolean', value : true,
-        description : 'Enable building and installation of pulseaudio daemon and supporting configuration files')
-+option('daemon-only',
-+       type : 'boolean', value : false,
-+       description : 'Build and install only the pulseaudio daemon and supporting configuration files, relying on a system installation of libpulse')
- option('doxygen',
-        type : 'boolean', value : true,
-        description : 'Enable building and installation of documentation generated with doxygen')
-diff --git a/po/meson.build b/po/meson.build
-index 34278db47..33429373c 100644
---- a/po/meson.build
-+++ b/po/meson.build
-@@ -1,4 +1,3 @@
--i18n = import('i18n')
- i18n.gettext(
-   meson.project_name(),
-   preset: 'glib',
-@@ -7,5 +6,3 @@ i18n.gettext(
-   args: ['--msgid-bugs-address=https://gitlab.freedesktop.org/pulseaudio/pulseaudio/issues/new',
-          '--width=90'],
- )
--
--po_dir = meson.current_source_dir()
-diff --git a/shell-completion/bash/meson.build b/shell-completion/bash/meson.build
-index 3ba5cb16f..83d90b94b 100644
---- a/shell-completion/bash/meson.build
-+++ b/shell-completion/bash/meson.build
-@@ -8,6 +8,7 @@ if bashcompletiondir != 'no'
-     ]
-   endif
- 
-+  if not get_option('daemon-only')
-   aliases += [
-     'pacat',
-     'pactl',
-@@ -16,6 +17,7 @@ if bashcompletiondir != 'no'
-     'parec',
-     'parecord',
-   ]
-+  endif
- 
-   install_data('pulseaudio', install_dir : bashcompletiondir)
- 
-diff --git a/src/daemon/meson.build b/src/daemon/meson.build
-index 262e193b2..e8f70a453 100644
---- a/src/daemon/meson.build
-+++ b/src/daemon/meson.build
-@@ -30,8 +30,8 @@ executable('pulseaudio',
-   install_rpath : privlibdir,
-   include_directories : [configinc, topinc],
-   link_args : ['-ffast-math'],
--  link_with : [libpulsecore, libpulsecommon, libpulse],
--  dependencies : [ltdl_dep, cap_dep, dbus_dep, libsystemd_dep, dl_dep, libintl_dep, platform_dep, platform_socket_dep],
-+  link_with : [libpulsecore],
-+  dependencies : [ltdl_dep, cap_dep, dbus_dep, libsystemd_dep, dl_dep, libintl_dep, platform_dep, platform_socket_dep, libpulsecommon_dep, libpulse_dep],
-   c_args : pa_c_args,
- )
- 
-diff --git a/src/meson.build b/src/meson.build
-index e2860811b..a56667271 100644
---- a/src/meson.build
-+++ b/src/meson.build
-@@ -188,6 +188,15 @@ else
- endif
- # FIXME: Do SIMD things
- 
-+if get_option('daemon-only')
-+  libpulsecommon_dep = cc.find_library('pulsecommon-' + pa_version_major_minor, dirs : privlibdir, required : true)
-+  libpulse_dep = dependency('libpulse', required : true)
-+  libpulse_simple_dep = dependency('libpulse-simple', required : true)
-+  if glib_dep.found()
-+    libpulse_mainloop_glib_dep = dependency('libpulse-mainloop-glib', required : true)
-+  endif
-+else
-+
- libpulsecommon = shared_library('pulsecommon-' + pa_version_major_minor,
-   libpulsecommon_sources,
-   libpulsecommon_headers,
-@@ -207,6 +216,8 @@ libpulsecommon = shared_library('pulsecommon-' + pa_version_major_minor,
- libpulsecommon_dep = declare_dependency(link_with: libpulsecommon)
- 
- subdir('pulse')
-+endif
-+
- if get_option('daemon')
-   subdir('pulsecore')
-   subdir('daemon')
-diff --git a/src/modules/gsettings/meson.build b/src/modules/gsettings/meson.build
-index 68a72c3ff..9604699e7 100644
---- a/src/modules/gsettings/meson.build
-+++ b/src/modules/gsettings/meson.build
-@@ -8,8 +8,7 @@ gsettings_helper = executable('gsettings-helper',
-   gsettings_helper_sources,
-   c_args : pa_c_args,
-   include_directories : [configinc, topinc],
--  link_with : [libpulsecommon, libpulse],
--  dependencies : [gio_dep],
-+  dependencies : [gio_dep, libpulsecommon_dep, libpulse_dep],
-   install_dir : pulselibexecdir,
-   install_rpath : privlibdir,
-   install : true,
-diff --git a/src/tests/meson.build b/src/tests/meson.build
-index acd301037..56d71299f 100644
---- a/src/tests/meson.build
-+++ b/src/tests/meson.build
-@@ -20,8 +20,6 @@ default_tests += [
-     [ check_dep, libpulse_dep, libpulsecommon_dep ] ],
-   [ 'json-test', 'json-test.c',
-     [ check_dep, libpulse_dep, libpulsecommon_dep ] ],
--  [ 'mainloop-test', 'mainloop-test.c',
--    [ check_dep, libpulse_dep, libpulsecommon_dep ] ],
-   [ 'proplist-test', 'proplist-test.c',
-     [ check_dep, libpulse_dep, libpulsecommon_dep ] ],
-   [ 'thread-mainloop-test', 'thread-mainloop-test.c',
-@@ -32,6 +30,13 @@ default_tests += [
-     [ check_dep, libm_dep, libpulse_dep, libpulsecommon_dep ] ],
- ]
- 
-+if not get_option('daemon-only')
-+  default_tests += [
-+    [ 'mainloop-test', 'mainloop-test.c',
-+      [ check_dep, libpulse_dep, libpulsecommon_dep ] ],
-+  ]
-+endif
-+
- if get_option('daemon')
-   default_tests += [
-     [ 'asyncmsgq-test', 'asyncmsgq-test.c',
-diff --git a/src/utils/meson.build b/src/utils/meson.build
-index c9635fdb6..7ed6e738f 100644
---- a/src/utils/meson.build
-+++ b/src/utils/meson.build
-@@ -1,3 +1,4 @@
-+if not get_option('daemon-only')
- pacat_sources = [
-   'pacat.c',
- ]
-@@ -41,6 +42,7 @@ executable('pactl',
-   dependencies : [sndfile_dep, libintl_dep],
-   c_args : pa_c_args,
- )
-+endif
- 
- if get_option('daemon')
-   if host_machine.system() != 'windows'
-@@ -53,8 +55,7 @@ if get_option('daemon')
-       install: true,
-       install_rpath : privlibdir,
-       include_directories : [configinc, topinc],
--      link_with : [libpulsecommon, libpulse],
--      dependencies: [libintl_dep],
-+      dependencies: [libintl_dep, libpulsecommon_dep, libpulse_dep],
-       c_args : pa_c_args,
-     )
- 
-@@ -67,13 +68,13 @@ if get_option('daemon')
-       install: true,
-       install_rpath : privlibdir,
-       include_directories : [configinc, topinc],
--      link_with : [libpulsecommon, libpulse],
--      dependencies: [libintl_dep],
-+      dependencies: [libintl_dep, libpulsecommon_dep, libpulse_dep],
-       c_args : pa_c_args,
-     )
-   endif
- endif
- 
-+if not get_option('daemon-only')
- if x11_dep.found()
-   pax11publish_sources = [
-     'pax11publish.c',
-@@ -121,3 +122,4 @@ if dbus_dep.found() and fftw_dep.found()
- endif
- 
- install_data('pa-info', install_dir : bindir)
-+endif
--- 
-2.32.0
-

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
deleted file mode 100644
index f3df62031d34..000000000000
--- a/media-sound/pulseaudio-daemon/files/pulseaudio-15.0-xice-xsm-xtst-daemon-only.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-https://bugs.gentoo.org/806052
-
-commit 42af3ee08381faa5807fde68d4c8ec0d7ad5e9a5
-Author: Igor V. Kovalenko <igor.v.kovalenko@gmail.com>
-Date:   Tue Aug 3 09:43:32 2021 +0300
-
-    build-sys: meson: Require xice, xsm and xtst for daemon only
-    
-    Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/613>
-
---- a/meson.build
-+++ b/meson.build
-@@ -681,9 +681,9 @@ endif
- x11_dep = dependency('x11-xcb', required : get_option('x11'))
- if x11_dep.found()
-   xcb_dep  = dependency('xcb',  required : true, version : '>= 1.6')
--  ice_dep  = dependency('ice',  required : true)
--  sm_dep   = dependency('sm',   required : true)
--  xtst_dep = dependency('xtst', required : true)
-+  ice_dep  = dependency('ice',  required : get_option('daemon'))
-+  sm_dep   = dependency('sm',   required : get_option('daemon'))
-+  xtst_dep = dependency('xtst', required : get_option('daemon'))
-   cdata.set('HAVE_X11', 1)
-   if cc.has_function('XSetIOErrorExitHandler', dependencies: x11_dep)
-     cdata.set('HAVE_XSETIOERROREXITHANDLER', 1)

diff --git a/media-sound/pulseaudio-daemon/pulseaudio-daemon-15.0.ebuild b/media-sound/pulseaudio-daemon/pulseaudio-daemon-15.0-r1.ebuild
similarity index 93%
rename from media-sound/pulseaudio-daemon/pulseaudio-daemon-15.0.ebuild
rename to media-sound/pulseaudio-daemon/pulseaudio-daemon-15.0-r1.ebuild
index 2af849121400..ca5a0570c89f 100644
--- a/media-sound/pulseaudio-daemon/pulseaudio-daemon-15.0.ebuild
+++ b/media-sound/pulseaudio-daemon/pulseaudio-daemon-15.0-r1.ebuild
@@ -5,7 +5,7 @@ EAPI="7"
 
 MY_PV="${PV/_pre*}"
 MY_P="pulseaudio-${MY_PV}"
-
+MY_PATCHSET="${PN}-15.0-patchset-1"
 inherit bash-completion-r1 gnome2-utils meson optfeature systemd tmpfiles udev
 
 DESCRIPTION="A networked sound server with an advanced plugin system"
@@ -17,6 +17,7 @@ if [[ ${PV} = 9999 ]]; then
 	EGIT_REPO_URI="https://gitlab.freedesktop.org/pulseaudio/pulseaudio"
 else
 	SRC_URI="https://freedesktop.org/software/pulseaudio/releases/${MY_P}.tar.xz"
+	SRC_URI+=" https://dev.gentoo.org/~sam/distfiles/${CATEGORY}/${PN}/${MY_PATCHSET}.tar.bz2"
 	KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~riscv ~sparc ~x86 ~amd64-linux ~x86-linux"
 fi
 
@@ -148,9 +149,9 @@ DOCS=( NEWS README )
 
 S="${WORKDIR}/${MY_P}"
 
+# patches merged upstream, to be removed with 16.0 bump
 PATCHES=(
-	"${FILESDIR}"/pulseaudio-15.0-xice-xsm-xtst-daemon-only.patch
-	"${FILESDIR}"/${PV}-daemon-only.patch
+	"${WORKDIR}"/${MY_PATCHSET}/
 )
 
 src_prepare() {
@@ -164,7 +165,7 @@ src_configure() {
 		--localstatedir="${EPREFIX}"/var
 
 		-Ddaemon=true
-		-Ddaemon-only=true
+		-Dclient=false
 		-Ddoxygen=false
 		-Dgcov=false
 		-Dman=true
@@ -222,8 +223,14 @@ src_configure() {
 src_install() {
 	meson_src_install
 
-	# Installed by media-libs/libpulse
+	# Upstream installs 'pactl' if client is built, with all symlinks except for
+	# 'pulseaudio', 'pacmd' and 'pasuspender' which are installed if server is built.
+	# This trips QA warning, workaround:
+	# - install missing aliases in media-libs/libpulse (client build)
+	# - remove corresponding symlinks in media-sound/pulseaudio-daemonclient (server build)
 	rm "${D}/$(get_bashcompdir)"/pulseaudio || die
+	rm "${D}/$(get_bashcompdir)"/pacmd || die
+	rm "${D}/$(get_bashcompdir)"/pasuspender || die
 
 	if use system-wide; then
 		newconfd "${FILESDIR}"/pulseaudio.conf.d pulseaudio


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2022-02-21  0:49 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-02-21  0:49 [gentoo-commits] repo/gentoo:master commit in: media-libs/libpulse/files/, media-libs/libpulse/, Sam James

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox