[pulseaudio-commits] [Git][pulseaudio/pulseaudio][master] 43 commits: meson: Add a dependency object for libpulse_mainloop_glib

Arun Raghavan gitlab at gitlab.freedesktop.org
Sat Jun 8 11:01:55 UTC 2019



Arun Raghavan pushed to branch master at PulseAudio / pulseaudio


Commits:
9a10ecce by Arnaud Rebillout at 2019-06-08T08:32:14Z
meson: Add a dependency object for libpulse_mainloop_glib

Signed-off-by: Arnaud Rebillout <arnaud.rebillout at collabora.com>

- - - - -
a144c251 by Arnaud Rebillout at 2019-06-08T08:32:14Z
meson: Add a check for sys/eventfd.h header

This test is present in the configure.ac, it was forgotten in
meson.build.

Signed-off-by: Arnaud Rebillout <arnaud.rebillout at collabora.com>

- - - - -
a9b55dbb by Arnaud Rebillout at 2019-06-08T08:32:14Z
meson: Add some symbol checks

Signed-off-by: Arnaud Rebillout <arnaud.rebillout at collabora.com>

- - - - -
f6abc684 by Arnaud Rebillout at 2019-06-08T08:32:14Z
meson: Move shm_dep check where it belongs

Signed-off-by: Arnaud Rebillout <arnaud.rebillout at collabora.com>

- - - - -
35ed95df by Arnaud Rebillout at 2019-06-08T09:44:00Z
meson: Add libpulse simple

Signed-off-by: Arnaud Rebillout <arnaud.rebillout at collabora.com>

- - - - -
6dbb0774 by Arnaud Rebillout at 2019-06-08T09:56:56Z
meson: Enable (almost) all tests

Signed-off-by: Arnaud Rebillout <arnaud.rebillout at collabora.com>

- - - - -
6355071a by Arnaud Rebillout at 2019-06-08T09:57:00Z
meson: Boolean options default to true, no need to say it

Signed-off-by: Arnaud Rebillout <arnaud.rebillout at collabora.com>

- - - - -
c3e72622 by Arnaud Rebillout at 2019-06-08T09:57:00Z
meson: Define HAVE_SYS_UN_H, this was forgotten

Signed-off-by: Arnaud Rebillout <arnaud.rebillout at collabora.com>

- - - - -
c71457ac by Arnaud Rebillout at 2019-06-08T09:57:00Z
meson: Enable echo-cancel test

Signed-off-by: Arnaud Rebillout <arnaud.rebillout at collabora.com>

- - - - -
3243e9f5 by Arnaud Rebillout at 2019-06-08T09:57:00Z
.gitlab-ci: Add meson test-daemon

Signed-off-by: Arnaud Rebillout <arnaud.rebillout at collabora.com>

- - - - -
a37046cc by Arnaud Rebillout at 2019-06-08T09:57:00Z
test-daemon: No need to define dl-search-path

There's already a hook that modifies the search path when run from the
build tree.

      if (pa_run_from_build_tree()) {
          pa_log_notice("Detected that we are run from the build tree, fixing search path.");
  #ifdef MESON_BUILD
          c->dl_search_path = pa_xstrdup(PA_BUILDDIR PA_PATH_SEP "src" PA_PATH_SEP "modules");
  #else
          c->dl_search_path = pa_xstrdup(PA_BUILDDIR);
  #endif
      } else

I'm not sure how it works behind the hood, but by setting
--dl-search-path, we get errors in the logs when running `make
check-daemon`:

 E: [pulseaudio][daemon/ltdl-bind-now.c:75 bind_now_open()] Failed to open module /home/arno/proj/pulse/src/pa.up/src/.libs/.libs/module-native-protocol-unix.so:
   /home/arno/proj/pulse/src/pa.up/src/.libs/.libs/module-native-protocol-unix.so: cannot open shared object file: No such file or directory
 I: [pulseaudio][pulsecore/module.c:197 pa_module_load()] Loaded "module-native-protocol-unix" (index: #3; argument: "").

So basically, PA tries two paths, fails the first time (obviously we can
see the path is not correct), then tries again with another path (where
does it gets it?) and succeeds. So there's no obvious error if you don't
look at the log.

This commit removes the useless `--dl-search-path`, which has the effect
to remove the errors in the logs.

Signed-off-by: Arnaud Rebillout <arnaud.rebillout at collabora.com>

- - - - -
8d241d62 by Arnaud Rebillout at 2019-06-08T09:57:00Z
meson: Install completion files

Signed-off-by: Arnaud Rebillout <arnaud.rebillout at collabora.com>

- - - - -
6826c60d by Arnaud Rebillout at 2019-06-08T09:57:00Z
meson: Make man page build and install conditional

Signed-off-by: Arnaud Rebillout <arnaud.rebillout at collabora.com>

- - - - -
b15428d4 by Arnaud Rebillout at 2019-06-08T09:57:00Z
meson: Handle man pages symlinks with a meson install script

This seems to be the common way to handle that, until meson decides to
address #1602: https://github.com/mesonbuild/meson/issues/1602

Signed-off-by: Arnaud Rebillout <arnaud.rebillout at collabora.com>

- - - - -
0db18ba7 by Arnaud Rebillout at 2019-06-08T09:57:00Z
meson: Fix man install dir

Signed-off-by: Arnaud Rebillout <arnaud.rebillout at collabora.com>

- - - - -
3a91cb1c by Arnaud Rebillout at 2019-06-08T09:57:00Z
meson: Install vala apis

Signed-off-by: Arnaud Rebillout <arnaud.rebillout at collabora.com>

- - - - -
cd141822 by Arnaud Rebillout at 2019-06-08T09:57:00Z
meson: Install pkg-config files

Signed-off-by: Arnaud Rebillout <arnaud.rebillout at collabora.com>

- - - - -
a7b24ed0 by Arnaud Rebillout at 2019-06-08T09:57:00Z
meson: Fix pulsedspdir

Signed-off-by: Arnaud Rebillout <arnaud.rebillout at collabora.com>

- - - - -
fdf3384f by Arnaud Rebillout at 2019-06-08T09:57:00Z
meson: Add systemduserunitdir option

Signed-off-by: Arnaud Rebillout <arnaud.rebillout at collabora.com>

- - - - -
8f336ede by Arnaud Rebillout at 2019-06-08T09:57:00Z
meson: Add udevrulesdir option

Signed-off-by: Arnaud Rebillout <arnaud.rebillout at collabora.com>

- - - - -
8146f878 by Arnaud Rebillout at 2019-06-08T09:57:00Z
meson: Fix various install scripts

Signed-off-by: Arnaud Rebillout <arnaud.rebillout at collabora.com>

- - - - -
5084dbd9 by Arnaud Rebillout at 2019-06-08T09:57:00Z
meson: Install ALSA udevrules

Signed-off-by: Arnaud Rebillout <arnaud.rebillout at collabora.com>

- - - - -
68f9984a by Arnaud Rebillout at 2019-06-08T09:57:00Z
meson: Add basic po support

Signed-off-by: Arnaud Rebillout <arnaud.rebillout at collabora.com>

- - - - -
f5bc45a9 by Arnaud Rebillout at 2019-06-08T09:57:00Z
meson: Translate and install desktop file

Signed-off-by: Arnaud Rebillout <arnaud.rebillout at collabora.com>

- - - - -
52bf9e9b by Arnaud Rebillout at 2019-06-08T09:57:00Z
meson: Build daemon custom targets by default

Signed-off-by: Arnaud Rebillout <arnaud.rebillout at collabora.com>

- - - - -
e0f23a41 by Arnaud Rebillout at 2019-06-08T09:57:00Z
meson: Fix install paths

Signed-off-by: Arnaud Rebillout <arnaud.rebillout at collabora.com>

- - - - -
aa7da467 by Arnaud Rebillout at 2019-06-08T09:57:00Z
meson: Install dbus policy file

Signed-off-by: Arnaud Rebillout <arnaud.rebillout at collabora.com>

- - - - -
091906cb by Arnaud Rebillout at 2019-06-08T09:57:00Z
meson: Fix udevrulesdir

Signed-off-by: Arnaud Rebillout <arnaud.rebillout at collabora.com>

- - - - -
8a15af4f by Arnaud Rebillout at 2019-06-08T09:57:00Z
meson: Move oss-util in a library

Like it was with the aututools

Signed-off-by: Arnaud Rebillout <arnaud.rebillout at collabora.com>

- - - - -
f5c9ef59 by Arnaud Rebillout at 2019-06-08T09:57:00Z
meson: Install utils symlinks, install qpaeq

Signed-off-by: Arnaud Rebillout <arnaud.rebillout at collabora.com>

- - - - -
d7170892 by Arnaud Rebillout at 2019-06-08T09:57:00Z
meson: Build libwebrtc-util as a shared library

As it'sdone in the autotools

Signed-off-by: Arnaud Rebillout <arnaud.rebillout at collabora.com>

- - - - -
a054e088 by Arnaud Rebillout at 2019-06-08T09:57:00Z
meson: Install systemd user service

Signed-off-by: Arnaud Rebillout <arnaud.rebillout at collabora.com>

- - - - -
53822963 by Arnaud Rebillout at 2019-06-08T10:03:03Z
meson: Install cmake files

Signed-off-by: Arnaud Rebillout <arnaud.rebillout at collabora.com>

- - - - -
71c24862 by Arnaud Rebillout at 2019-06-08T10:03:03Z
meson: Install headers

Signed-off-by: Arnaud Rebillout <arnaud.rebillout at collabora.com>

- - - - -
06e37b30 by Arnaud Rebillout at 2019-06-08T10:03:03Z
meson: Disable esound modules

For now esound is not supported with the meson build, although it
wouldn't be that hard to support it.

Signed-off-by: Arnaud Rebillout <arnaud.rebillout at collabora.com>

- - - - -
aa550292 by Arnaud Rebillout at 2019-06-08T10:03:03Z
meson: Add ORC support

Signed-off-by: Arnaud Rebillout <arnaud.rebillout at collabora.com>

- - - - -
1a3ed2f4 by Arnaud Rebillout at 2019-06-08T10:03:03Z
meson: Add support for gcov

Unlike autotools, we use the option --coverage, which is a synonym for
-profile-arcs and -ftest-coverage (when compiling) and -lgcov (when
linking).

For reference, see:
https://gcc.gnu.org/onlinedocs/gcc/Instrumentation-Options.html#Instrumentation-Options

Signed-off-by: Arnaud Rebillout <arnaud.rebillout at collabora.com>

- - - - -
0e1cfdc5 by Arnaud Rebillout at 2019-06-08T10:03:03Z
meson: Increase timeout for tests

This solves numerous timeout failures

Signed-off-by: Arnaud Rebillout <arnaud.rebillout at collabora.com>

- - - - -
b0a4a85d by Arnaud Rebillout at 2019-06-08T10:03:03Z
meson: Add running-from-build-tree option

Signed-off-by: Arnaud Rebillout <arnaud.rebillout at collabora.com>

- - - - -
b56a381b by Arnaud Rebillout at 2019-06-08T10:03:03Z
meson: Disable alsa-mixer-path-test

This test relies on parsing the generated Makefile. A meson equivalent
requires to re-write all the parser.

Signed-off-by: Arnaud Rebillout <arnaud.rebillout at collabora.com>

- - - - -
2ee919e9 by Arun Raghavan at 2019-06-08T10:43:12Z
daemon: Drop empty fields in desktop file

The fields weren't used, and were incorrectly munged during generation.
This makes validation succeed.

- - - - -
6a60f910 by Arun Raghavan at 2019-06-08T10:47:53Z
meson: Skip norun tests

These weren't meant to be run, so we skip then while generating meson
tests.

- - - - -
aeb0ef1f by Arun Raghavan at 2019-06-08T10:55:50Z
meson: Duplicate split of long daemon tests from autotools build

This avoids the running the longer daemon tests by default to make CI
faster.

- - - - -


26 changed files:

- .gitlab-ci.yml
- man/meson.build
- meson.build
- meson_options.txt
- + po/meson.build
- + shell-completion/bash/meson.build
- + shell-completion/zsh/meson.build
- src/daemon/meson.build
- src/daemon/pulseaudio.desktop.in
- src/meson.build
- src/modules/alsa/meson.build
- src/modules/bluetooth/meson.build
- src/modules/echo-cancel/meson.build
- src/modules/gsettings/post-install.sh
- src/modules/meson.build
- + src/modules/oss/meson.build
- src/modules/raop/meson.build
- src/modules/rtp/meson.build
- src/pulse/meson.build
- src/pulsecore/meson.build
- src/tests/alsa-mixer-path-test.c
- + src/tests/meson.build
- + src/tests/test-daemon.meson.sh
- src/tests/test-daemon.sh
- src/utils/meson.build
- + vala/meson.build


Changes:

=====================================
.gitlab-ci.yml
=====================================
@@ -24,6 +24,7 @@ build-meson:
     - cd build
     - ninja
     - ninja test
+    - ninja test-daemon
   artifacts:
     paths:
       - build/


=====================================
man/meson.build
=====================================
@@ -1,5 +1,3 @@
-# TODO How are symlinks installed by meson?
-#      We might need meson.add_install_script()
 
 # man page name, section, [aliases]
 manpages = [
@@ -20,17 +18,14 @@ manpages = [
 # FIXME: Add esdcompat if HAVE_ESOUND
 #manpages += ['esdcompat', '1'],
 
-# FIXME: This should be conditional
-want_man = true
-
 man_data = configuration_data()
 man_data.set('PACKAGE_URL', 'http://pulseaudio.org/')
 man_data.set('PACKAGE_BUGREPORT', 'pulseaudio-discuss (at) lists (dot) freedesktop (dot) org')
 man_data.set('PA_DEFAULT_CONFIG_DIR', cdata.get_unquoted('PA_DEFAULT_CONFIG_DIR'))
 
-perl = find_program('perl', required: want_man == true)
+perl = find_program('perl', required: true)
 xmltoman_cmd = [perl, join_paths(meson.current_source_dir(), 'xmltoman')]
-xmllint = find_program('xmllint', required: want_man == true)
+xmllint = find_program('xmllint', required: false)
 
 foreach tuple : manpages
   stem = tuple[0]
@@ -47,7 +42,7 @@ foreach tuple : manpages
     configuration : man_data,
   )
 
-  mandirn = join_paths(get_option('mandir'), 'man' + section)
+  mandirn = join_paths(mandir, 'man' + section)
 
   custom_target(
     man + '-target',
@@ -55,18 +50,15 @@ foreach tuple : manpages
     output : man,
     capture : true,
     command : xmltoman_cmd + ['@INPUT@'],
-    install : want_man,
+    install : true,
     install_dir : mandirn,
   )
 
-  foreach alias : aliases
-    link = custom_target(
-      alias,
-      output : alias,
-      command : ['ln', '-fs', man, '@OUTPUT@'],
-      install : want_man,
-      install_dir : mandirn,
-    )
+  foreach alias_stem : aliases
+    alias = alias_stem + '.' + section
+    dst = join_paths(mandirn, alias)
+    cmd = 'ln -fs @0@ $DESTDIR at 1@'.format(man, dst)
+    meson.add_install_script('sh', '-c', cmd)
   endforeach
 
   if xmllint.found()


=====================================
meson.build
=====================================
@@ -28,6 +28,10 @@ soversion = 0
 # current = minor * 100 + micro
 libversion = '@0 at .@1 at .0'.format(soversion, pa_version_minor.to_int() * 100 + pa_version_micro.to_int())
 
+# A simplified, synchronous, ABI-stable interface for client applications.
+# For the version x:y:z always will hold y=z.
+libpulse_simple_version = '1.1.1'
+
 # The ABI-stable GLib adapter for client applications.
 # For the version x:y:z always will hold y=z.
 libpulse_mainloop_glib_version = '0.5.0'
@@ -38,14 +42,17 @@ prefix = get_option('prefix')
 assert(prefix.startswith('/'), 'Prefix is not absolute: "@0@"'.format(prefix))
 
 bindir = join_paths(prefix, get_option('bindir'))
+includedir = join_paths(prefix, get_option('includedir'))
 libdir = join_paths(prefix, get_option('libdir'))
 libexecdir = join_paths(prefix, get_option('libexecdir'))
+mandir = join_paths(prefix, get_option('mandir'))
 datadir = join_paths(prefix, get_option('datadir'))
 localstatedir = join_paths(prefix, get_option('localstatedir'))
 sysconfdir = join_paths(prefix, get_option('sysconfdir'))
 privlibdir = join_paths(get_option('libdir'), 'pulseaudio')
 alsadatadir = join_paths(datadir, 'pulseaudio', 'alsa-mixer')
 
+pkgconfigdir = join_paths(libdir, 'pkgconfig')
 pulselibexecdir = join_paths(libexecdir, 'pulse')
 pulsesysconfdir = join_paths(sysconfdir, 'pulse')
 
@@ -56,7 +63,33 @@ endif
 
 pulsedspdir = get_option('pulsedspdir')
 if pulsedspdir == ''
-  join_paths(libdir, 'pulseaudio')
+  pulsedspdir = join_paths(libdir, 'pulseaudio')
+endif
+
+systemduserunitdir = get_option('systemduserunitdir')
+# the default value is set below
+
+udevrulesdir = get_option('udevrulesdir')
+if udevrulesdir == ''
+  # absolute path, otherwise meson prepends the prefix
+  udevrulesdir = '/lib/udev/rules.d'
+endif
+
+vapidir = join_paths(datadir, 'vala', 'vapi')
+
+bashcompletiondir = get_option('bashcompletiondir')
+if bashcompletiondir == ''
+  bash_completion_dep = dependency('bash-completion', required : false)
+  if bash_completion_dep.found()
+    bashcompletiondir = bash_completion_dep.get_pkgconfig_variable('completionsdir')
+  else
+    bashcompletiondir = join_paths(datadir, 'bash-completion', 'completions')
+  endif
+endif
+
+zshcompletiondir = get_option('zshcompletiondir')
+if zshcompletiondir == ''
+  zshcompletiondir = join_paths(datadir, 'zsh', 'site-functions')
 endif
 
 # Configuration data
@@ -130,12 +163,14 @@ check_headers = [
   'regex.h',
   'sched.h',
   'sys/capability.h',
+  'sys/eventfd.h',
   'sys/ioctl.h',
   'sys/mman.h',
   'sys/prctl.h',
   'sys/resource.h',
   'sys/select.h',
   'sys/socket.h',
+  'sys/un.h',
   'sys/wait.h',
   'valgrind/memcheck.h',
   'xlocale.h',
@@ -153,11 +188,6 @@ if cc.has_header('pthread.h')
   cdata.set('HAVE_PTHREAD', 1)
 endif
 
-# FIXME: move this to the above set
-if cc.has_header('sys/un.h')
-  cdata.set('HAVE_AF_UNIX', 1)
-endif
-
 # Functions
 
 check_functions = [
@@ -204,15 +234,23 @@ foreach f : check_functions
   endif
 endforeach
 
-shm_dep = cc.find_library('rt', required : false)
-if shm_dep.found()
-  cdata.set('HAVE_SHM_OPEN', 1)
-endif
-
 if cc.has_function('SYS_memfd_create', prefix : '#include <sys/syscall.h>')
   cdata.set('HAVE_MEMFD', 1)
 endif
 
+# Symbols
+
+if cc.has_header_symbol('signal.h', 'SIGXCPU')
+  cdata.set('HAVE_SIGXCPU', 1)
+endif
+
+if not cc.has_header_symbol('netinet/in.h', 'INADDR_NONE')
+  if not cc.has_header_symbol('winsock2.h', 'INADDR_NONE')
+    # Define INADDR_NONE if not found (Solaris)
+    cdata.set('INADDR_NONE', '0xffffffff')
+  endif
+endif
+
 # Types
 
 # FIXME: do we ever care about gid_t not being defined / smaller than an int?
@@ -229,12 +267,24 @@ pa_c_args = ['-DHAVE_CONFIG_H', '-D_GNU_SOURCE']
 server_c_args = ['-D__INCLUDED_FROM_PULSE_AUDIO']
 cdata.set('MESON_BUILD', 1)
 
+# Code coverage
+
+if get_option('gcov')
+  add_project_arguments('--coverage', language: ['c', 'cpp'])
+  add_project_link_arguments('--coverage', language: ['c', 'cpp'])
+endif
+
 # Core Dependencies
 
 libm_dep = cc.find_library('m', required : true)
 thread_dep = dependency('threads')
 cap_dep = cc.find_library('cap', required : false)
 
+shm_dep = cc.find_library('rt', required : false)
+if shm_dep.found()
+  cdata.set('HAVE_SHM_OPEN', 1)
+endif
+
 atomictest = '''void func() {
   volatile int atomic = 2;
   __sync_bool_compare_and_swap (&atomic, 2, 3);
@@ -268,6 +318,10 @@ if get_option('legacy-database-entry-format')
   cdata.set('ENABLE_LEGACY_DATABASE_ENTRY_FORMAT', 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)
@@ -299,6 +353,19 @@ 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)
@@ -311,11 +378,15 @@ if soxr_dep.found()
   cdata.set('HAVE_SOXR', 1)
 endif
 
-systemd_dep = dependency('libsystemd', required : get_option('systemd'))
-if systemd_dep.found()
+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)
+  systemd_dep = dependency('systemd', required : get_option('systemd'))
+  if systemd_dep.found() and systemduserunitdir == ''
+    systemduserunitdir = systemd_dep.get_pkgconfig_variable('systemduserunitdir')
+  endif
 endif
 
 x11_dep = dependency('x11-xcb', required : get_option('x11'))
@@ -327,9 +398,6 @@ if x11_dep.found()
   cdata.set('HAVE_X11', 1)
 endif
 
-# FIXME: support ORC
-cdata.set('DISABLE_ORC', 1)
-
 # Module dependencies
 
 if cc.has_header('sys/soundcard.h')
@@ -398,11 +466,94 @@ if webrtc_dep.found()
   cdata.set('HAVE_WEBRTC', 1)
 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
+
+check_dep = dependency('check', version : '>= 0.9.10', required : get_option('tests'))
+
 # Now generate config.h from everything above
 configure_file(output : 'config.h', configuration : cdata)
 
-subdir('man')
+# 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
+
+foreach file : pc_files
+  configure_file(
+    input : file + '.in',
+    output : file,
+    configuration : pc_cdata,
+    install_dir : pkgconfigdir)
+endforeach
+
+# CMake files
+
+m4 = find_program('m4', required: true)
+
+cmakedir = join_paths(libdir, 'cmake', 'PulseAudio')
+
+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,
+)
+
+configure_file(
+  input : 'PulseAudioConfigVersion.cmake.in',
+  output : 'PulseAudioConfigVersion.cmake',
+  configuration: cdata,
+  install : true,
+  install_dir : cmakedir,
+)
+
+# Subdirs
+
+subdir('po')
+if get_option('man')
+  subdir('man')
+endif
+subdir('shell-completion/bash')
+subdir('shell-completion/zsh')
 subdir('src')
+subdir('vala')
 
 ############################################################
 
@@ -416,6 +567,7 @@ summary = [
   'bindir:                        @0@'.format(bindir),
   'libdir:                        @0@'.format(libdir),
   'libexecdir:                    @0@'.format(libexecdir),
+  'mandir:                        @0@'.format(mandir),
   'datadir:                       @0@'.format(datadir),
   'sysconfdir:                    @0@'.format(sysconfdir),
   'localstatedir:                 @0@'.format(localstatedir),
@@ -423,8 +575,8 @@ summary = [
   'System Runtime Path:           @0@'.format(cdata.get_unquoted('PA_SYSTEM_RUNTIME_PATH')),
   'System State Path:             @0@'.format(cdata.get_unquoted('PA_SYSTEM_STATE_PATH')),
   'System Config Path:            @0@'.format(cdata.get_unquoted('PA_SYSTEM_CONFIG_PATH')),
-#  'Zsh completions directory:     @0@'.format(${zshcompletiondir}),
-#  'Bash completions directory:    @0@'.format(${bashcompletiondir}),
+  'Bash completions directory:    @0@'.format(bashcompletiondir),
+  'Zsh completions directory:     @0@'.format(zshcompletiondir),
   'Compiler:                      @0@ @1@'.format(cc.get_id(), cc.version()),
 #  'CFLAGS:                        @0@'.format(${CFLAGS}),
 #  'CPPFLAGS:                      @0@'.format(${CPPFLAGS}),
@@ -453,22 +605,24 @@ summary = [
   '    Enable  ofono headsets:    @0@'.format(get_option('bluez5-ofono-headset')),
   'Enable udev:                   @0@'.format(udev_dep.found()),
   '  Enable HAL->udev compat:     @0@'.format(get_option('hal-compat')),
-  'Enable systemd:                @0@'.format(systemd_dep.found()),
+  'Enable systemd:                @0@'.format(libsystemd_dep.found()),
 #  'Enable TCP Wrappers:           @0@'.format(${ENABLE_TCPWRAP}),
   '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(${ENABLE_ORC}),
+  '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()),
   'Enable SoXR (resampler):       @0@'.format(soxr_dep.found()),
   'Enable WebRTC echo canceller:  @0@'.format(webrtc_dep.found()),
-#  'Enable gcov coverage:          @0@'.format(${ENABLE_GCOV}),
-#  'Enable unit tests:             @0@'.format(${ENABLE_TESTS}),
+  'Enable Gcov coverage:          @0@'.format(get_option('gcov')),
+  'Enable man pages:              @0@'.format(get_option('man')),
+  'Enable unit tests:             @0@'.format(get_option('tests')),
   '',
   'Database:                      @0@'.format(get_option('database')),
   'Legacy Database Entry Support: @0@'.format(get_option('legacy-database-entry-format')),
+  'Running from build tree:       @0@'.format(get_option('running-from-build-tree')),
   'System User:                   @0@'.format(cdata.get_unquoted('PA_SYSTEM_USER')),
   'System Group:                  @0@'.format(cdata.get_unquoted('PA_SYSTEM_GROUP')),
   'Access Group:                  @0@'.format(cdata.get_unquoted('PA_ACCESS_GROUP')),


=====================================
meson_options.txt
=====================================
@@ -1,3 +1,13 @@
+option('gcov',
+       type : 'boolean',
+       description : 'Enable optional gcov coverage analysis')
+option('man',
+       type : 'boolean',
+       description : 'Enable building and installation of man pages')
+option('tests',
+       type : 'boolean',
+       description : 'Enable unit tests')
+
 option('system_user',
         type : 'string', value : 'pulse',
         description : 'User for running the PulseAudio daemon as a system-wide instance (pulse)')
@@ -12,14 +22,32 @@ option('database',
         choices : [ 'gdbm', 'tdb', 'simple' ],
         description : 'Database backend')
 option('legacy-database-entry-format',
-       type : 'boolean', value : 'true',
+       type : 'boolean',
        description : 'Try to load legacy (< 1.0) database files (card, device and volume restore)')
+option('running-from-build-tree',
+       type : 'boolean',
+       description : 'Enable running from build tree')
+
+# Paths
+
 option('pulsedspdir',
        type : 'string',
        description : 'Specify location where OSS wrapper will be installed')
 option('modlibexecdir',
        type : 'string',
        description : 'Specify location where modules will be installed')
+option('systemduserunitdir',
+       type : 'string',
+       description : 'Directory for systemd user service files')
+option('udevrulesdir',
+       type : 'string',
+       description : 'Directory for udev rules (defaults to /lib/udev/rules.d)')
+option('bashcompletiondir',
+       type : 'string',
+       description : 'Directory for bash completion files')
+option('zshcompletiondir',
+       type : 'string',
+       description : 'Zsh completions directory')
 
 # Optional features
 
@@ -71,6 +99,9 @@ option('lirc',
 option('openssl',
        type : 'feature', value : 'auto',
        description : 'Optional OpenSSL support (used for Airtunes/RAOP)')
+option('orc',
+       type : 'feature', value : 'auto',
+       description : 'Optimized Inner Loop Runtime Compiler')
 option('samplerate',
        type : 'feature', value : 'disabled',
        description : 'Optional libsamplerate support (DEPRECATED)')


=====================================
po/meson.build
=====================================
@@ -0,0 +1,4 @@
+i18n = import('i18n')
+i18n.gettext(meson.project_name(), preset: 'glib')
+
+po_dir = meson.current_source_dir()


=====================================
shell-completion/bash/meson.build
=====================================
@@ -0,0 +1,18 @@
+aliases = [
+  'pacat',
+  'pacmd',
+  'pactl',
+  'padsp',
+  'paplay',
+  'parec',
+  'parecord',
+  'pasuspender',
+]
+
+install_data('pulseaudio', install_dir : bashcompletiondir)
+
+foreach alias : aliases
+  dst = join_paths(bashcompletiondir, alias)
+  cmd = 'ln -fs @0@ $DESTDIR at 1@'.format('pulseaudio', dst)
+  meson.add_install_script('sh', '-c', cmd)
+endforeach


=====================================
shell-completion/zsh/meson.build
=====================================
@@ -0,0 +1 @@
+install_data('_pulseaudio', install_dir : zshcompletiondir)


=====================================
src/daemon/meson.build
=====================================
@@ -29,7 +29,7 @@ executable('pulseaudio',
   install: true,
   include_directories : [configinc, topinc],
   link_with : [libpulsecore, libpulsecommon, libpulse],
-  dependencies : [ltdl_dep, cap_dep, dbus_dep, systemd_dep],
+  dependencies : [ltdl_dep, cap_dep, dbus_dep, libsystemd_dep],
   c_args : pa_c_args,
 )
 
@@ -44,6 +44,22 @@ if x11_dep.found()
     install : true,
     install_dir : bindir,
   )
+
+  desktop_file = i18n.merge_file(
+    input : 'pulseaudio.desktop.in',
+    output : 'pulseaudio.desktop',
+    po_dir : po_dir,
+    type : 'desktop',
+    install : true,
+    install_dir : join_paths(sysconfdir, 'xdg', 'autostart'),
+  )
+
+  desktop_utils = find_program('desktop-file-validate', required: false)
+  if desktop_utils.found()
+    test('Validate desktop file', desktop_utils,
+      args: [ desktop_file ],
+    )
+  endif
 endif
 
 # Configuration files
@@ -65,6 +81,7 @@ custom_target('daemon.conf',
   output : 'daemon.conf',
   capture : true,
   command : [m4, '@INPUT@'],
+  build_by_default : true,
   install : true,
   install_dir : pulsesysconfdir,
 )
@@ -73,6 +90,7 @@ default_conf = configuration_data()
 default_conf.merge_from(cdata)
 default_conf.set('PA_BINARY', cdata.get_unquoted('PA_BINARY'))
 default_conf.set('PA_SOEXT', cdata.get_unquoted('PA_SOEXT'))
+default_conf.set10('HAVE_AF_UNIX', cc.has_header('sys/un.h'))
 
 default_template_file = configure_file(
   input : 'default.pa.in',
@@ -85,6 +103,7 @@ custom_target('default.pa',
   output : 'default.pa',
   capture : true,
   command : [m4, '@INPUT@'],
+  build_by_default : true,
   install : true,
   install_dir : pulsesysconfdir,
 )
@@ -105,6 +124,30 @@ custom_target('system.pa',
   output : 'system.pa',
   capture : true,
   command : [m4, '@INPUT@'],
+  build_by_default : true,
   install : true,
   install_dir : pulsesysconfdir,
 )
+
+if dbus_dep.found()
+  install_data('pulseaudio-system.conf',
+    install_dir : join_paths(sysconfdir, 'dbus-1', 'system.d')
+  )
+endif
+
+if systemd_dep.found()
+  sd_user_service_conf = configuration_data()
+  sd_user_service_conf.set('PA_BINARY', cdata.get_unquoted('PA_BINARY'))
+
+  sd_user_service_file = configure_file(
+    input : 'systemd/user/pulseaudio.service.in',
+    output : 'pulseaudio.service',
+    configuration : sd_user_service_conf,
+    install : true,
+    install_dir : systemduserunitdir,
+  )
+
+  install_data('systemd/user/pulseaudio.socket',
+    install_dir: systemduserunitdir,
+  )
+endif


=====================================
src/daemon/pulseaudio.desktop.in
=====================================
@@ -5,7 +5,5 @@ Comment=Start the PulseAudio Sound System
 Exec=start-pulseaudio-x11
 Terminal=false
 Type=Application
-Categories=
-GenericName=
 X-GNOME-Autostart-Phase=Initialization
 X-KDE-autostart-phase=1


=====================================
src/meson.build
=====================================
@@ -183,7 +183,7 @@ libpulsecommon = shared_library('pulsecommon-' + pa_version_major_minor,
   c_args : [pa_c_args],
   install : true,
   install_dir : privlibdir,
-  dependencies : [libm_dep, thread_dep, shm_dep, sndfile_dep, dbus_dep, x11_dep, systemd_dep, glib_dep, gtk_dep, asyncns_dep],
+  dependencies : [libm_dep, thread_dep, shm_dep, sndfile_dep, dbus_dep, x11_dep, libsystemd_dep, glib_dep, gtk_dep, asyncns_dep],
   implicit_include_directories : false)
 
 libpulsecommon_dep = declare_dependency(link_with: libpulsecommon)
@@ -192,4 +192,7 @@ subdir('pulse')
 subdir('pulsecore')
 subdir('daemon')
 subdir('modules')
+if get_option('tests')
+  subdir('tests')
+endif
 subdir('utils')


=====================================
src/modules/alsa/meson.build
=====================================
@@ -26,7 +26,7 @@ if udev_dep.found()
   libalsa_util_headers += [ '../udev-util.h' ]
 endif
 
-libalsa_util = shared_library('libalsa_util',
+libalsa_util = shared_library('alsa-util',
   libalsa_util_sources,
   libalsa_util_headers,
   c_args : [pa_c_args, server_c_args],
@@ -36,4 +36,14 @@ libalsa_util = shared_library('libalsa_util',
   install_dir : modlibexecdir,
 )
 
+alsa_udevrules = [
+  '90-pulseaudio.rules',
+]
+
+if udev_dep.found()
+  install_data(alsa_udevrules,
+    install_dir : udevrulesdir,
+  )
+endif
+
 subdir('mixer')


=====================================
src/modules/bluetooth/meson.build
=====================================
@@ -20,7 +20,7 @@ if get_option('bluez5-ofono-headset')
   libbluez5_util_sources += [ 'backend-ofono.c' ]
 endif
 
-libbluez5_util = shared_library('libbluez5_util',
+libbluez5_util = shared_library('bluez5-util',
   libbluez5_util_sources,
   libbluez5_util_headers,
   c_args : [pa_c_args, server_c_args],


=====================================
src/modules/echo-cancel/meson.build
=====================================
@@ -2,18 +2,20 @@
 # link module-echo-cancel with C++ (which it does if there are any C++ deps,
 # even conditional ones).
 
-# Defining this library as shared fails, as it actually requires a symbol
-# from module-echo-cancel.c. Setting it to static solves that.
+# This library requires a symbol from module-echo-cancel, hence we need
+# '-Wl,--unresolved-symbols=ignore-in-object-files' otherwise it fails
+# at link time.
 
 libwebrtc_util_sources = [
   'webrtc.cc'
 ]
 
-libwebrtc_util = static_library('libwebrtc_util',
+libwebrtc_util = shared_library('webrtc-util',
   libwebrtc_util_sources,
   cpp_args : [pa_c_args, server_c_args],
   include_directories : [configinc, topinc],
   dependencies : [libpulse_dep, libpulsecommon_dep, libpulsecore_dep, webrtc_dep],
+  link_args : [ '-Wl,--unresolved-symbols=ignore-in-object-files' ],
   install : true,
   install_dir : modlibexecdir,
 )


=====================================
src/modules/gsettings/post-install.sh
=====================================
@@ -5,5 +5,8 @@ set -u
 
 DATADIR="$1"
 
+# Package managers set this so we don't need to run
+if [ "${DESTDIR:-}" ]; then exit 0; fi
+
 echo "Compiling GSettings schemas..."
 glib-compile-schemas "$DATADIR/glib-2.0/schemas"


=====================================
src/modules/meson.build
=====================================
@@ -19,11 +19,11 @@ all_modules = [
   [ 'module-detect', 'module-detect.c' ],
   [ 'module-device-manager', 'module-device-manager.c', [], [], [], libprotocol_native ],
   [ 'module-device-restore', 'module-device-restore.c', [], [], [dbus_dep], libprotocol_native ],
-  [ 'module-esound-compat-spawnfd', 'module-esound-compat-spawnfd.c' ],
-  [ 'module-esound-compat-spawnpid', 'module-esound-compat-spawnpid.c' ],
+#  [ 'module-esound-compat-spawnfd', 'module-esound-compat-spawnfd.c' ],
+#  [ 'module-esound-compat-spawnpid', 'module-esound-compat-spawnpid.c' ],
 #  [ 'module-esound-protocol-tcp', 'module-protocol-stub.c' ],
 #  [ 'module-esound-protocol-unix', 'module-protocol-stub.c' ],
-  [ 'module-esound-sink', 'module-esound-sink.c' ],
+#  [ 'module-esound-sink', 'module-esound-sink.c' ],
   [ 'module-filter-apply', 'module-filter-apply.c' ],
   [ 'module-filter-heuristics', 'module-filter-heuristics.c' ],
 #  [ 'module-gconf', 'gconf/module-gconf.c' ],
@@ -77,8 +77,9 @@ if cc.has_header('linux/input.h')
 endif
 
 if cc.has_header('sys/soundcard.h')
+  subdir('oss')
   all_modules += [
-    [ 'module-oss', [ 'oss/module-oss.c', 'oss/oss-util.c', 'oss/oss-util.h' ] ],
+    [ 'module-oss', 'oss/module-oss.c', [], [], [], liboss_util ],
   ]
 endif
 
@@ -176,9 +177,9 @@ if openssl_dep.found()
   endif
 endif
 
-if systemd_dep.found()
+if libsystemd_dep.found()
   all_modules += [
-    [ 'module-systemd-login', 'module-systemd-login.c', [], [], [systemd_dep] ],
+    [ 'module-systemd-login', 'module-systemd-login.c', [], [], [libsystemd_dep] ],
   ]
 endif
 
@@ -205,6 +206,7 @@ module_echo_cancel_sources = [
   'echo-cancel/module-echo-cancel.c',
   'echo-cancel/null.c',
 ]
+module_echo_cancel_orc_sources = []
 module_echo_cancel_flags = []
 module_echo_cancel_deps = []
 module_echo_cancel_libs = []
@@ -215,15 +217,25 @@ if get_option('adrian-aec')
     'echo-cancel/adrian-aec.c', 'echo-cancel/adrian-aec.h',
   ]
   module_echo_cancel_flags += ['-DHAVE_ADRIAN_EC=1']
-  module_echo_cancel_deps = [libm_dep]
-endif
+  module_echo_cancel_deps += [libm_dep]
+
+  if have_orcc
+    orcsrc = 'adrian-aec'
+    orc_h = custom_target(orcsrc + '-orc-gen.h',
+      input : join_paths('echo-cancel', orcsrc + '.orc'),
+      output : orcsrc + '-orc-gen.h',
+      command : orcc_args + ['--header', '-o', '@OUTPUT@', '@INPUT@']
+    )
+    orc_c = custom_target(orcsrc + '-orc-gen.c',
+      input : join_paths('echo-cancel', orcsrc + '.orc'),
+      output : orcsrc + '-orc-gen.c',
+      command : orcc_args + ['--implementation', '-o', '@OUTPUT@', '@INPUT@']
+    )
+    module_echo_cancel_orc_sources += [orc_c, orc_h]
+    module_echo_cancel_deps += [orc_dep]
+  endif
 
-# FIXME: support ORC (depends on Adrian)
-#ORC_SOURCE += modules/echo-cancel/adrian-aec
-#module_echo_cancel_sources += [
-#  'echo-cancel/adrian-aec-orc-gen.c', 'echo-cancel/adrian-aec-orc-gen.h'
-#]
-#module_echo_cancel_deps += [orc_dep]
+endif
 
 if speex_dep.found()
   module_echo_cancel_sources += ['echo-cancel/speex.c']
@@ -237,7 +249,7 @@ endif
 
 all_modules += [
   [ 'module-echo-cancel',
-    module_echo_cancel_sources,
+    module_echo_cancel_sources + module_echo_cancel_orc_sources,
     [],
     module_echo_cancel_flags,
     module_echo_cancel_deps,


=====================================
src/modules/oss/meson.build
=====================================
@@ -0,0 +1,17 @@
+liboss_util_sources = [
+  'oss-util.c'
+]
+
+liboss_util_headers = [
+  'oss-util.h'
+]
+
+liboss_util = shared_library('oss-util',
+  liboss_util_sources,
+  liboss_util_headers,
+  c_args : [pa_c_args, server_c_args],
+  include_directories : [configinc, topinc],
+  dependencies : [libpulse_dep, libpulsecommon_dep, libpulsecore_dep],
+  install : true,
+  install_dir : modlibexecdir,
+)


=====================================
src/modules/raop/meson.build
=====================================
@@ -14,7 +14,7 @@ libraop_headers = [
   'raop-util.h',
 ]
 
-libraop = shared_library('libraop',
+libraop = shared_library('raop',
   libraop_sources,
   libraop_headers,
   c_args : [pa_c_args, server_c_args],


=====================================
src/modules/rtp/meson.build
=====================================
@@ -14,7 +14,7 @@ librtp_headers = [
   'headerlist.h',
 ]
 
-librtp = shared_library('librtp',
+librtp = shared_library('rtp',
   librtp_sources,
   librtp_headers,
   c_args : [pa_c_args, server_c_args],


=====================================
src/pulse/meson.build
=====================================
@@ -78,8 +78,23 @@ libpulse = shared_library('pulse',
 
 libpulse_dep = declare_dependency(link_with: libpulse)
 
+install_data(libpulse_headers,
+  install_dir : join_paths(includedir, 'pulse')
+)
+
+libpulse_simple = shared_library('pulse-simple',
+  'simple.c',
+  'simple.h',
+  version : libpulse_simple_version,
+  c_args : [pa_c_args],
+  include_directories : [configinc, topinc],
+  dependencies : [libpulse_dep, libpulsecommon_dep],
+  install : true,
+)
+
+libpulse_simple_dep = declare_dependency(link_with: libpulse_simple)
+
 if glib_dep.found()
-  # TODO we must install libpulse-mainloop-glib.pc
   libpulse_mainloop_glib = shared_library('pulse-mainloop-glib',
     'glib-mainloop.c',
     'glib-mainloop.h',
@@ -89,6 +104,8 @@ if glib_dep.found()
     dependencies : [libpulse_dep, libpulsecommon_dep, glib_dep],
     install : true,
   )
+
+  libpulse_mainloop_glib_dep = declare_dependency(link_with: libpulse_mainloop_glib)
 endif
 
 # Configuration files


=====================================
src/pulsecore/meson.build
=====================================
@@ -145,6 +145,24 @@ if x11_dep.found()
   libpulsecore_headers += ['x11wrap.h']
 endif
 
+orc_sources = []
+orc_headers = []
+if have_orcc
+  orcsrc = 'svolume'
+  orc_h = custom_target(orcsrc + '-ocr-gen.h',
+    input : orcsrc + '.orc',
+    output : orcsrc + '-orc-gen.h',
+    command : orcc_args + ['--header', '-o', '@OUTPUT@', '@INPUT@']
+  )
+  orc_c = custom_target(orcsrc + '-orc-gen.c',
+    input : orcsrc + '.orc',
+    output : orcsrc + '-orc-gen.c',
+    command : orcc_args + ['--implementation', '-o', '@OUTPUT@', '@INPUT@']
+  )
+  orc_sources = [orc_c, 'svolume_orc.c']
+  orc_headers = [orc_h]
+endif
+
 # FIXME: walk through dependencies and add files
 
 # FIXME: SIMD support (ORC)
@@ -167,14 +185,14 @@ cdata.merge_from(libpulsecore_simd[1])
 #'thread-win32.c',
 
 libpulsecore = shared_library('pulsecore-' + pa_version_major_minor,
-  libpulsecore_sources,
-  libpulsecore_headers,
+  libpulsecore_sources, libpulsecore_headers,
+  orc_sources, orc_headers,
   include_directories : [configinc, topinc],
   c_args : [pa_c_args, server_c_args],
   install : true,
   install_dir : privlibdir,
   link_with : libpulsecore_simd_lib,
-  dependencies : [libm_dep, libpulsecommon_dep, libpulse_dep, ltdl_dep, shm_dep, sndfile_dep, database_dep, dbus_dep, samplerate_dep, soxr_dep, speex_dep, x11_dep],
+  dependencies : [libm_dep, libpulsecommon_dep, libpulse_dep, ltdl_dep, shm_dep, sndfile_dep, database_dep, dbus_dep, orc_dep, samplerate_dep, soxr_dep, speex_dep, x11_dep],
   implicit_include_directories : false)
 
 libpulsecore_dep = declare_dependency(link_with: libpulsecore)
@@ -182,7 +200,7 @@ libpulsecore_dep = declare_dependency(link_with: libpulsecore)
 # Internal libraries for modules
 # TODO: understand 'c_args' and 'dependencies' better, maybe we can remove some
 
-libavahi_wrap = shared_library('avahi_wrap',
+libavahi_wrap = shared_library('avahi-wrap',
   'avahi-wrap.c',
   'avahi-wrap.h',
   c_args : [pa_c_args, server_c_args, database_c_args],
@@ -205,7 +223,7 @@ libcli = shared_library('cli',
 
 libcli_dep = declare_dependency(link_with: libcli)
 
-libprotocol_cli = shared_library('protocol_cli',
+libprotocol_cli = shared_library('protocol-cli',
   'protocol-cli.c',
   'protocol-cli.h',
   c_args : [pa_c_args, server_c_args, database_c_args],
@@ -215,7 +233,7 @@ libprotocol_cli = shared_library('protocol_cli',
   install_dir : modlibexecdir,
 )
 
-libprotocol_http = shared_library('protocol_http',
+libprotocol_http = shared_library('protocol-http',
   ['protocol-http.c', 'mime-type.c'],
   ['protocol-http.h', 'mime-type.h'],
   c_args : [pa_c_args, server_c_args, database_c_args],
@@ -225,7 +243,7 @@ libprotocol_http = shared_library('protocol_http',
   install_dir : modlibexecdir,
 )
 
-libprotocol_native = shared_library('protocol_native',
+libprotocol_native = shared_library('protocol-native',
   'protocol-native.c',
   ['protocol-native.h', 'native-common.h'],
   c_args : [pa_c_args, server_c_args, database_c_args],
@@ -235,7 +253,7 @@ libprotocol_native = shared_library('protocol_native',
   install_dir : modlibexecdir,
 )
 
-libprotocol_simple = shared_library('protocol_simple',
+libprotocol_simple = shared_library('protocol-simple',
   'protocol-simple.c',
   'protocol-simple.h',
   c_args : [pa_c_args, server_c_args, database_c_args],


=====================================
src/tests/alsa-mixer-path-test.c
=====================================
@@ -54,6 +54,10 @@ static pa_strlist *load_makefile() {
 }
 
 START_TEST (mixer_path_test) {
+#ifdef MESON_BUILD
+    pa_log_info("Test disabled for meson build");
+    return;
+#else
     DIR *dir;
     struct dirent *ent;
     pa_strlist *ship = load_makefile();
@@ -83,6 +87,7 @@ START_TEST (mixer_path_test) {
     }
     closedir(dir);
     pa_strlist_free(ship);
+#endif
 }
 END_TEST
 


=====================================
src/tests/meson.build
=====================================
@@ -0,0 +1,244 @@
+# Note that a few tests have dependencies on src/modules.
+#
+# The syntax for tests declaration is:
+#
+#   test name, sources, deps, [extra libs, extra flags]
+#
+
+# Default tests
+
+default_tests = [
+  [ 'asyncmsgq-test', 'asyncmsgq-test.c',
+    [ check_dep, libpulse_dep, libpulsecommon_dep, libpulsecore_dep ] ],
+  [ 'asyncq-test', 'asyncq-test.c',
+    [ check_dep, libpulse_dep, libpulsecommon_dep, libpulsecore_dep ] ],
+  [ 'channelmap-test', 'channelmap-test.c',
+    [ check_dep, libpulse_dep ] ],
+  [ 'close-test', 'close-test.c',
+    [            libpulse_dep, libpulsecommon_dep, libpulsecore_dep ] ],
+  [ 'core-util-test', 'core-util-test.c',
+    [ check_dep, libpulse_dep, libpulsecommon_dep ] ],
+  [ 'cpu-mix-test', [ 'cpu-mix-test.c', 'runtime-test-util.h' ],
+    [ check_dep, libm_dep, libpulse_dep, libpulsecommon_dep, libpulsecore_dep ] ],
+  [ 'cpu-remap-test', [ 'cpu-remap-test.c', 'runtime-test-util.h' ],
+    [ check_dep, libm_dep, libpulse_dep, libpulsecommon_dep, libpulsecore_dep ] ],
+  [ 'cpu-sconv-test', [ 'cpu-sconv-test.c', 'runtime-test-util.h' ],
+    [ check_dep, libm_dep, libpulse_dep, libpulsecommon_dep, libpulsecore_dep ] ],
+  [ 'cpu-volume-test', [ 'cpu-volume-test.c', 'runtime-test-util.h' ],
+    [ check_dep, libm_dep, libpulse_dep, libpulsecommon_dep, libpulsecore_dep ] ],
+  [ 'format-test', 'format-test.c',
+    [ check_dep, libpulse_dep, libpulsecommon_dep, libpulsecore_dep ] ],
+  [ 'get-binary-name-test', 'get-binary-name-test.c',
+    [ check_dep, libpulse_dep, libpulsecommon_dep ] ],
+  [ 'hook-list-test', 'hook-list-test.c',
+    [ check_dep, libpulse_dep, libpulsecommon_dep, libpulsecore_dep ] ],
+  [ 'json-test', 'json-test.c',
+    [ check_dep, libpulse_dep, libpulsecommon_dep ] ],
+  [ 'lfe-filter-test', 'lfe-filter-test.c',
+    [ check_dep, libpulse_dep, libpulsecommon_dep, libpulsecore_dep ] ],
+  [ 'lock-autospawn-test', 'lock-autospawn-test.c',
+    [ check_dep, libpulse_dep, libpulsecommon_dep, libpulsecore_dep ] ],
+  [ 'mainloop-test', 'mainloop-test.c',
+    [ check_dep, libpulse_dep, libpulsecommon_dep ] ],
+  [ 'memblock-test', 'memblock-test.c',
+    [ check_dep, libpulse_dep, libpulsecommon_dep, libpulsecore_dep ] ],
+  [ 'memblockq-test', 'memblockq-test.c',
+    [ check_dep, libpulse_dep, libpulsecommon_dep, libpulsecore_dep ] ],
+  [ 'mix-test', 'mix-test.c',
+    [ check_dep, libpulse_dep, libpulsecommon_dep, libpulsecore_dep ] ],
+  [ 'mult-s16-test', [ 'mult-s16-test.c', 'runtime-test-util.h' ],
+    [ check_dep, libm_dep, libpulse_dep, libpulsecommon_dep, libpulsecore_dep ] ],
+  [ 'proplist-test', 'proplist-test.c',
+    [ check_dep, libpulse_dep, libpulsecommon_dep, libpulsecore_dep ] ],
+  [ 'queue-test', 'queue-test.c',
+    [ check_dep, libpulse_dep, libpulsecommon_dep, libpulsecore_dep ] ],
+  [ 'resampler-test', 'resampler-test.c',
+    [            libpulse_dep, libpulsecommon_dep, libpulsecore_dep ] ],
+  [ 'rtpoll-test', 'rtpoll-test.c',
+    [ check_dep, libpulse_dep, libpulsecommon_dep, libpulsecore_dep ] ],
+  [ 'smoother-test', 'smoother-test.c',
+    [ check_dep, libpulse_dep, libpulsecommon_dep, libpulsecore_dep ] ],
+  [ 'strlist-test', 'strlist-test.c',
+    [ check_dep, libpulse_dep, libpulsecommon_dep, libpulsecore_dep ] ],
+  [ 'thread-mainloop-test', 'thread-mainloop-test.c',
+    [ check_dep, libpulse_dep, libpulsecommon_dep, libpulsecore_dep ] ],
+  [ 'thread-test', 'thread-test.c',
+    [ check_dep, libpulse_dep, libpulsecommon_dep, libpulsecore_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 host_machine.system() != 'windows'
+  default_tests += [
+    [ 'sigbus-test', 'sigbus-test.c',
+      [ check_dep, libpulse_dep, libpulsecommon_dep, libpulsecore_dep ] ],
+    [ 'usergroup-test', 'usergroup-test.c',
+      [ check_dep, libpulse_dep, libpulsecommon_dep, libpulsecore_dep ] ],
+  ]
+endif
+
+if host_machine.system() != 'darwin'
+  default_tests += [
+    [ 'once-test', 'once-test.c',
+      [ check_dep, thread_dep, libpulse_dep, libpulsecommon_dep, libpulsecore_dep ] ],
+  ]
+endif
+
+if cc.has_header('sys/eventfd.h')
+  default_tests += [
+    [ 'srbchannel-test', 'srbchannel-test.c',
+      [ check_dep, libpulse_dep, libpulsecommon_dep ] ]
+  ]
+endif
+
+if alsa_dep.found()
+  default_tests += [
+    [ 'alsa-mixer-path-test', 'alsa-mixer-path-test.c',
+      [ alsa_dep, check_dep, libpulse_dep, libpulsecommon_dep, libpulsecore_dep ],
+      libalsa_util ]
+  ]
+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 = [
+  [ 'flist-test', 'flist-test.c',
+    [ libpulse_dep, libpulsecommon_dep, libpulsecore_dep ] ],
+  [ 'ipacl-test', 'ipacl-test.c',
+    [ check_dep, libpulse_dep, libpulsecommon_dep, libpulsecore_dep ] ],
+  [ 'lo-latency-test', [ 'lo-latency-test.c', 'lo-test-util.c', 'lo-test-util.h' ],
+    [ check_dep, libm_dep, libpulse_dep, libpulsecommon_dep, libpulsecore_dep ] ],
+  [ 'mcalign-test', 'mcalign-test.c',
+    [ libpulse_dep, libpulsecommon_dep, libpulsecore_dep ] ],
+  [ 'pacat-simple', 'pacat-simple.c',
+    [ libpulse_dep, libpulse_simple_dep ] ],
+  [ 'parec-simple', 'parec-simple.c',
+    [ libpulse_dep, libpulse_simple_dep ] ],
+  [ 'remix-test', 'remix-test.c',
+    [ libpulse_dep, libpulsecommon_dep, libpulsecore_dep ] ],
+  [ 'rtstutter', 'rtstutter.c',
+    [ libpulse_dep, libpulsecommon_dep, libpulsecore_dep ] ],
+  [ 'sig2str-test', 'sig2str-test.c',
+    [ check_dep, libpulse_dep, libpulsecommon_dep, libpulsecore_dep ] ],
+  [ 'stripnul', 'stripnul.c',
+    [ libpulse_dep, libpulsecommon_dep, libpulsecore_dep ] ],
+]
+
+# echo-cancel test is a bit tedious to handle
+echo_cancel_test_sources = []
+foreach s : module_echo_cancel_sources
+  echo_cancel_test_sources += '../modules/' + s
+endforeach
+echo_cancel_test_sources += module_echo_cancel_orc_sources
+
+norun_tests += [
+  [ 'echo-cancel-test', echo_cancel_test_sources,
+    module_echo_cancel_deps + [ libpulse_dep, libpulsecommon_dep, libpulsecore_dep ],
+    module_echo_cancel_libs,
+    module_echo_cancel_flags + server_c_args + [ '-DPA_MODULE_NAME=module_echo_cancel', '-DECHO_CANCEL_TEST=1' ] ]
+]
+
+if cc.has_header_symbol('signal.h', 'SIGXCPU')
+  norun_tests += [
+    [ 'cpulimit-test', [ 'cpulimit-test.c', '../daemon/cpulimit.c', '../daemon/cpulimit.h' ],
+      [ check_dep, libpulse_dep, libpulsecommon_dep, libpulsecore_dep ] ],
+    [ 'cpulimit-test2', [ 'cpulimit-test.c', '../daemon/cpulimit.c', '../daemon/cpulimit.h' ],
+      [ check_dep, libpulse_dep, libpulsecommon_dep, libpulsecore_dep ],
+      [], ['-DTEST2'] ],
+  ]
+endif
+
+if alsa_dep.found()
+  norun_tests += [
+    [ 'alsa-time-test', 'alsa-time-test.c', [ alsa_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 ] ]
+  ]
+endif
+
+# Generate tests
+
+test_env = environment()
+test_env.set('MAKE_CHECK', '1')
+
+foreach t : default_tests + norun_tests
+  name = t[0]
+  sources = t[1]
+  deps = t[2]
+  extra_libs = t.get(3, [])
+  extra_flags = t.get(4, [])
+
+  exe = executable(name, sources,
+    c_args : pa_c_args + extra_flags,
+    include_directories : [ configinc, topinc ],
+    dependencies : deps,
+    link_with : extra_libs,
+  )
+
+  if default_tests.contains(t)
+    test(name, exe,
+      env : test_env,
+      timeout : 120,
+    )
+  endif
+endforeach
+
+# These tests need a running pulseaudio daemon
+
+daemon_tests = [
+  [ 'extended-test', 'extended-test.c',
+    [ check_dep, libm_dep, libpulse_dep ] ],
+  [ 'sync-playback', 'sync-playback.c',
+    [ check_dep, libm_dep, libpulse_dep ] ],
+]
+
+daemon_tests_long = [
+  [ 'connect-stress', 'connect-stress.c',
+    [ check_dep, libpulse_dep ] ],
+  [ 'interpol-test', 'interpol-test.c',
+    [ check_dep, libpulse_dep, libpulsecommon_dep, libpulsecore_dep ] ],
+]
+
+daemon_test_names = []
+daemon_test_long_names = []
+
+foreach t : daemon_tests + daemon_tests_long
+  name = t[0]
+  sources = t[1]
+  deps = t[2]
+
+  if daemon_tests.contains(t)
+    daemon_test_names += name
+  else
+    daemon_test_long_names += name
+  endif
+
+  executable(name, sources,
+    c_args : pa_c_args,
+    include_directories : [ configinc, topinc ],
+    dependencies : deps,
+  )
+endforeach
+
+test_daemon_meson_sh = find_program('test-daemon.meson.sh')
+run_target('test-daemon',
+  command : [ test_daemon_meson_sh ] + daemon_test_names
+)
+run_target('test-daemon-long',
+  command : [ test_daemon_meson_sh ] + daemon_test_long_names
+)


=====================================
src/tests/test-daemon.meson.sh
=====================================
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+set -e
+set -u
+
+PATH=${MESON_BUILD_ROOT}/src/daemon:${MESON_BUILD_ROOT}/src/tests:${MESON_BUILD_ROOT}/src/utils:${PATH}
+export PATH
+
+${MESON_SOURCE_ROOT}/src/tests/test-daemon.sh $@


=====================================
src/tests/test-daemon.sh
=====================================
@@ -44,7 +44,6 @@ pulseaudio -n \
         --load="module-suspend-on-idle" \
         --load="module-native-protocol-unix" \
         --load="module-cli-protocol-unix" \
-        --dl-search-path="$(dirname $SCRIPTNAME)/.libs/" \
         &
 
 # wait a few seconds to let the daemon start!


=====================================
src/utils/meson.build
=====================================
@@ -2,6 +2,13 @@ pacat_sources = [
   'pacat.c',
 ]
 
+pacat_aliases = [
+  'pamon',
+  'paplay',
+  'parec',
+  'parecord',
+]
+
 executable('pacat',
   pacat_sources,
   install: true,
@@ -11,6 +18,13 @@ executable('pacat',
   c_args : pa_c_args,
 )
 
+foreach alias : pacat_aliases
+  # FIXME How to handle extension (.exe on windows)?
+  dst = join_paths(bindir, alias)
+  cmd = 'ln -fs @0@ $DESTDIR at 1@'.format('pacat', dst)
+  meson.add_install_script('sh', '-c', cmd)
+endforeach
+
 pactl_sources = [
   'pactl.c',
 ]
@@ -87,3 +101,7 @@ if cc.has_header('sys/soundcard.h')
     install_dir : bindir,
   )
 endif
+
+if dbus_dep.found() and fftw_dep.found()
+  install_data('qpaeq', install_dir : bindir)
+endif


=====================================
vala/meson.build
=====================================
@@ -0,0 +1,10 @@
+vala_apis = [
+  'libpulse',
+  'libpulse-mainloop-glib',
+  'libpulse-simple',
+]
+
+foreach api : vala_apis
+  install_data(api + '.deps', api + '.vapi',
+    install_dir : vapidir)
+endforeach



View it on GitLab: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/compare/8a4e0c167b0a295ec26068c021c283a5c7aab735...aeb0ef1fea96e04acb7f24f7d3b3539e6880d5f5

-- 
View it on GitLab: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/compare/8a4e0c167b0a295ec26068c021c283a5c7aab735...aeb0ef1fea96e04acb7f24f7d3b3539e6880d5f5
You're receiving this email because of your account on gitlab.freedesktop.org.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/pulseaudio-commits/attachments/20190608/9f17435f/attachment-0001.html>


More information about the pulseaudio-commits mailing list