2019-01-08 11:18:45 +00:00
|
|
|
project('pipewire', ['c' ],
|
2023-08-01 15:57:38 +00:00
|
|
|
version : '0.3.77',
|
2021-05-14 10:09:33 +00:00
|
|
|
license : [ 'MIT', 'LGPL-2.1-or-later', 'GPL-2.0-only' ],
|
2023-03-10 00:13:09 +00:00
|
|
|
meson_version : '>= 0.61.1',
|
2020-04-01 10:51:42 +00:00
|
|
|
default_options : [ 'warning_level=3',
|
2022-07-30 17:10:19 +00:00
|
|
|
'c_std=gnu11',
|
2021-12-24 16:56:37 +00:00
|
|
|
'cpp_std=c++17',
|
2021-01-14 15:29:32 +00:00
|
|
|
'b_pie=true',
|
2021-09-30 00:01:43 +00:00
|
|
|
#'b_sanitize=address,undefined',
|
2016-09-26 10:15:52 +00:00
|
|
|
'buildtype=debugoptimized' ])
|
|
|
|
|
2017-05-23 17:15:33 +00:00
|
|
|
pipewire_version = meson.project_version()
|
|
|
|
version_arr = pipewire_version.split('.')
|
|
|
|
pipewire_version_major = version_arr[0]
|
|
|
|
pipewire_version_minor = version_arr[1]
|
|
|
|
pipewire_version_micro = version_arr[2]
|
2016-09-26 10:15:52 +00:00
|
|
|
if version_arr.length() == 4
|
2017-05-23 17:15:33 +00:00
|
|
|
pipewire_version_nano = version_arr[3]
|
2016-09-26 10:15:52 +00:00
|
|
|
else
|
2017-05-23 17:15:33 +00:00
|
|
|
pipewire_version_nano = 0
|
2016-09-26 10:15:52 +00:00
|
|
|
endif
|
|
|
|
|
2020-01-29 14:51:41 +00:00
|
|
|
spaversion = '0.2'
|
2018-12-14 12:12:40 +00:00
|
|
|
apiversion = '0.3'
|
|
|
|
soversion = 0
|
2017-05-23 17:15:33 +00:00
|
|
|
libversion = '@0@.@1@.0'.format(soversion, pipewire_version_minor.to_int() * 100 + pipewire_version_micro.to_int())
|
2016-09-26 10:15:52 +00:00
|
|
|
|
2023-07-30 12:18:01 +00:00
|
|
|
# LADI/jack
|
|
|
|
# 3, for PipeWire being the third JACK implementation, after JACK1 and jackdmp/JACK2)
|
|
|
|
jack_version_major = 3
|
|
|
|
jack_version_minor = pipewire_version_minor.to_int() * 100 + pipewire_version_micro.to_int()
|
|
|
|
# libjack[server] version has 0 for major (for compatibility with other implementations),
|
|
|
|
# 3 for minor, and "100*pipewire_version_minor + pipewire_version_micro"
|
|
|
|
# as micro version (the minor libpipewire soversion number)
|
|
|
|
libjackversion = '@0@.@1@.@2@'.format(soversion, jack_version_major, jack_version_minor)
|
|
|
|
|
2020-02-05 15:28:22 +00:00
|
|
|
pipewire_name = 'pipewire-@0@'.format(apiversion)
|
|
|
|
spa_name = 'spa-@0@'.format(spaversion)
|
|
|
|
|
2016-09-26 10:15:52 +00:00
|
|
|
prefix = get_option('prefix')
|
2021-04-15 04:41:04 +00:00
|
|
|
pipewire_bindir = prefix / get_option('bindir')
|
|
|
|
pipewire_datadir = prefix / get_option('datadir')
|
|
|
|
pipewire_libdir = prefix / get_option('libdir')
|
|
|
|
pipewire_libexecdir = prefix / get_option('libexecdir')
|
|
|
|
pipewire_localedir = prefix / get_option('localedir')
|
|
|
|
pipewire_sysconfdir = prefix / get_option('sysconfdir')
|
2016-09-26 10:15:52 +00:00
|
|
|
|
2021-04-15 04:41:04 +00:00
|
|
|
pipewire_configdir = pipewire_sysconfdir / 'pipewire'
|
2021-05-17 14:22:31 +00:00
|
|
|
pipewire_confdatadir = pipewire_datadir / 'pipewire'
|
2021-04-15 04:41:04 +00:00
|
|
|
modules_install_dir = pipewire_libdir / pipewire_name
|
2020-06-03 10:03:35 +00:00
|
|
|
|
|
|
|
if host_machine.system() == 'linux'
|
|
|
|
# glibc ld.so interprets ${LIB} in a library loading path with an
|
|
|
|
# appropriate value for the current architecture, typically something
|
|
|
|
# like lib, lib64 or lib/x86_64-linux-gnu.
|
2020-12-17 14:44:49 +00:00
|
|
|
# This allows the same pw-jack script to work for both 32- and 64-bit
|
2020-06-03 10:03:35 +00:00
|
|
|
# applications on biarch/multiarch distributions, by setting something
|
2020-12-17 14:44:49 +00:00
|
|
|
# like LD_LIBRARY_PATH='/usr/${LIB}/pipewire-0.3/jack'.
|
2020-06-03 10:03:35 +00:00
|
|
|
# Note that ${LIB} is a special token expanded by the runtime linker,
|
|
|
|
# not an environment variable, and must be passed through literally.
|
2021-04-15 04:41:04 +00:00
|
|
|
modules_install_dir_dlopen = prefix / '${LIB}' / pipewire_name
|
2020-06-03 10:03:35 +00:00
|
|
|
else
|
|
|
|
modules_install_dir_dlopen = modules_install_dir
|
|
|
|
endif
|
|
|
|
|
2021-04-15 04:41:04 +00:00
|
|
|
spa_plugindir = pipewire_libdir / spa_name
|
2021-09-18 09:32:29 +00:00
|
|
|
spa_datadir = pipewire_datadir / spa_name
|
2020-07-28 10:30:32 +00:00
|
|
|
|
2021-04-15 04:41:04 +00:00
|
|
|
alsadatadir = pipewire_datadir / 'alsa-card-profile' / 'mixer'
|
2020-02-05 15:28:22 +00:00
|
|
|
|
2021-04-15 04:41:04 +00:00
|
|
|
pipewire_headers_dir = pipewire_name / 'pipewire'
|
2016-11-22 15:50:09 +00:00
|
|
|
|
2018-09-02 01:22:14 +00:00
|
|
|
pkgconfig = import('pkgconfig')
|
2016-09-26 10:15:52 +00:00
|
|
|
|
|
|
|
cc = meson.get_compiler('c')
|
|
|
|
|
2020-11-27 23:28:47 +00:00
|
|
|
common_flags = [
|
|
|
|
'-fvisibility=hidden',
|
2022-09-27 20:46:29 +00:00
|
|
|
'-fno-strict-aliasing',
|
2020-11-27 23:28:47 +00:00
|
|
|
'-Werror=suggest-attribute=format',
|
|
|
|
'-Wsign-compare',
|
|
|
|
'-Wpointer-arith',
|
|
|
|
'-Wpointer-sign',
|
|
|
|
'-Wformat',
|
|
|
|
'-Wformat-security',
|
|
|
|
'-Wimplicit-fallthrough',
|
|
|
|
'-Wmissing-braces',
|
|
|
|
'-Wtype-limits',
|
|
|
|
'-Wvariadic-macros',
|
2022-01-27 10:07:17 +00:00
|
|
|
'-Wmaybe-uninitialized',
|
2020-11-27 23:28:47 +00:00
|
|
|
'-Wno-missing-field-initializers',
|
|
|
|
'-Wno-unused-parameter',
|
|
|
|
'-Wno-pedantic',
|
2022-01-27 10:07:17 +00:00
|
|
|
'-Wdeprecated-declarations',
|
2020-11-27 23:28:47 +00:00
|
|
|
'-Wunused-result',
|
2023-07-03 02:52:44 +00:00
|
|
|
'-Werror=return-type',
|
2020-11-27 23:28:47 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
cc_flags = common_flags + [
|
2021-06-24 01:26:05 +00:00
|
|
|
'-D_GNU_SOURCE',
|
2020-11-27 23:28:47 +00:00
|
|
|
'-DFASTPATH',
|
|
|
|
# '-DSPA_DEBUG_MEMCPY',
|
2023-02-16 19:27:26 +00:00
|
|
|
'-Werror=implicit-function-declaration',
|
|
|
|
'-Werror=int-conversion',
|
2023-07-03 02:16:37 +00:00
|
|
|
'-Werror=old-style-declaration',
|
|
|
|
'-Werror=old-style-definition',
|
2023-07-03 02:51:47 +00:00
|
|
|
'-Werror=missing-parameter-type',
|
|
|
|
'-Werror=strict-prototypes',
|
2020-11-27 23:28:47 +00:00
|
|
|
]
|
|
|
|
add_project_arguments(cc.get_supported_arguments(cc_flags), language: 'c')
|
|
|
|
|
2021-06-24 01:26:48 +00:00
|
|
|
have_cpp = add_languages('cpp', native: false, required : false)
|
2020-11-27 23:28:47 +00:00
|
|
|
|
|
|
|
if have_cpp
|
|
|
|
cxx = meson.get_compiler('cpp')
|
2022-09-27 20:41:22 +00:00
|
|
|
cxx_flags = common_flags + [ '-Wno-c99-designator' ]
|
2020-11-27 23:28:47 +00:00
|
|
|
add_project_arguments(cxx.get_supported_arguments(cxx_flags), language: 'cpp')
|
2019-01-07 17:02:36 +00:00
|
|
|
endif
|
2016-09-26 10:15:52 +00:00
|
|
|
|
2019-03-27 16:58:48 +00:00
|
|
|
sse_args = '-msse'
|
|
|
|
sse2_args = '-msse2'
|
|
|
|
ssse3_args = '-mssse3'
|
|
|
|
sse41_args = '-msse4.1'
|
2019-03-28 15:45:57 +00:00
|
|
|
fma_args = '-mfma'
|
|
|
|
avx_args = '-mavx'
|
|
|
|
avx2_args = '-mavx2'
|
2019-03-27 16:58:48 +00:00
|
|
|
|
|
|
|
have_sse = cc.has_argument(sse_args)
|
|
|
|
have_sse2 = cc.has_argument(sse2_args)
|
|
|
|
have_ssse3 = cc.has_argument(ssse3_args)
|
|
|
|
have_sse41 = cc.has_argument(sse41_args)
|
2019-03-28 15:45:57 +00:00
|
|
|
have_fma = cc.has_argument(fma_args)
|
|
|
|
have_avx = cc.has_argument(avx_args)
|
|
|
|
have_avx2 = cc.has_argument(avx2_args)
|
2019-03-27 16:58:48 +00:00
|
|
|
|
2020-03-27 12:27:11 +00:00
|
|
|
have_neon = false
|
2020-04-03 11:30:08 +00:00
|
|
|
if host_machine.cpu_family() == 'aarch64'
|
2020-05-08 20:12:24 +00:00
|
|
|
if cc.compiles('''
|
|
|
|
#include <arm_neon.h>
|
|
|
|
int main () {
|
|
|
|
float *s;
|
|
|
|
asm volatile(
|
2021-09-30 00:01:43 +00:00
|
|
|
" ld1 { v0.4s }, [%[s]], #16\n"
|
2020-05-08 20:12:24 +00:00
|
|
|
" fcvtzs v0.4s, v0.4s, #31\n"
|
2021-09-30 00:01:43 +00:00
|
|
|
: [s] "+r" (s) : :);
|
2020-05-08 20:12:24 +00:00
|
|
|
}
|
|
|
|
''',
|
|
|
|
name : 'aarch64 Neon Support')
|
|
|
|
neon_args = []
|
|
|
|
have_neon = true
|
|
|
|
|
|
|
|
endif
|
2020-04-03 11:30:08 +00:00
|
|
|
elif cc.has_argument('-mfpu=neon')
|
2020-05-08 20:12:24 +00:00
|
|
|
if cc.compiles('''
|
|
|
|
#include <arm_neon.h>
|
|
|
|
int main () {
|
|
|
|
float *s;
|
|
|
|
asm volatile(
|
|
|
|
" vld1.32 { q0 }, [%[s]]!\n"
|
|
|
|
" vcvt.s32.f32 q0, q0, #31\n"
|
2021-09-30 00:01:43 +00:00
|
|
|
: [s] "+r" (s) : :);
|
2020-05-08 20:12:24 +00:00
|
|
|
}
|
|
|
|
''',
|
|
|
|
args: '-mfpu=neon',
|
|
|
|
name : 'arm Neon Support')
|
|
|
|
neon_args = ['-mfpu=neon']
|
|
|
|
have_neon = true
|
|
|
|
endif
|
2020-03-27 12:27:11 +00:00
|
|
|
endif
|
|
|
|
|
2020-09-06 19:00:58 +00:00
|
|
|
libatomic = cc.find_library('atomic', required : false)
|
|
|
|
|
|
|
|
test_8_byte_atomic = '''
|
|
|
|
#include <stdint.h>
|
|
|
|
|
|
|
|
int main(void)
|
|
|
|
{
|
|
|
|
int64_t eight;
|
2021-05-21 05:47:46 +00:00
|
|
|
__atomic_fetch_add(&eight, 123, __ATOMIC_SEQ_CST);
|
2020-09-06 19:00:58 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
'''
|
|
|
|
|
|
|
|
# We currently assume that libatomic is unnecessary for 4-byte atomic
|
|
|
|
# operations on any reasonable architecture.
|
|
|
|
if cc.links(
|
|
|
|
test_8_byte_atomic,
|
2021-05-21 05:47:46 +00:00
|
|
|
name : '8-byte __atomic_fetch_add without libatomic')
|
2020-09-06 19:00:58 +00:00
|
|
|
atomic_dep = dependency('', required: false)
|
|
|
|
elif cc.links(
|
|
|
|
test_8_byte_atomic,
|
|
|
|
dependencies : libatomic,
|
2021-05-21 05:47:46 +00:00
|
|
|
name : '8-byte __atomic_fetch_add with libatomic')
|
2020-09-06 19:00:58 +00:00
|
|
|
atomic_dep = libatomic
|
2021-05-21 05:47:46 +00:00
|
|
|
else
|
|
|
|
error('8-byte atomic operations are required')
|
2020-09-06 19:00:58 +00:00
|
|
|
endif
|
2020-03-27 12:27:11 +00:00
|
|
|
|
2021-06-10 04:22:10 +00:00
|
|
|
versiondata = configuration_data()
|
|
|
|
versiondata.set('PIPEWIRE_VERSION_MAJOR', pipewire_version_major)
|
|
|
|
versiondata.set('PIPEWIRE_VERSION_MINOR', pipewire_version_minor)
|
|
|
|
versiondata.set('PIPEWIRE_VERSION_MICRO', pipewire_version_micro)
|
|
|
|
versiondata.set('PIPEWIRE_VERSION_NANO', pipewire_version_nano)
|
|
|
|
versiondata.set_quoted('PIPEWIRE_API_VERSION', apiversion)
|
|
|
|
|
2016-09-26 10:15:52 +00:00
|
|
|
cdata = configuration_data()
|
2023-05-08 08:45:53 +00:00
|
|
|
cdata.set_quoted('PREFIX', prefix)
|
2021-05-17 14:22:31 +00:00
|
|
|
cdata.set_quoted('PIPEWIRE_CONFDATADIR', pipewire_confdatadir)
|
|
|
|
cdata.set_quoted('LOCALEDIR', pipewire_localedir)
|
|
|
|
cdata.set_quoted('LIBDIR', pipewire_libdir)
|
|
|
|
cdata.set_quoted('GETTEXT_PACKAGE', meson.project_name())
|
2021-10-13 04:08:12 +00:00
|
|
|
cdata.set_quoted('PACKAGE', 'pipewire')
|
|
|
|
cdata.set_quoted('PACKAGE_NAME', 'PipeWire')
|
|
|
|
cdata.set_quoted('PACKAGE_STRING', 'PipeWire @0@'.format(pipewire_version))
|
|
|
|
cdata.set_quoted('PACKAGE_TARNAME', 'pipewire')
|
|
|
|
cdata.set_quoted('PACKAGE_URL', 'https://pipewire.org')
|
2021-05-17 14:22:31 +00:00
|
|
|
cdata.set_quoted('PACKAGE_VERSION', pipewire_version)
|
|
|
|
cdata.set_quoted('MODULEDIR', modules_install_dir)
|
|
|
|
cdata.set_quoted('PIPEWIRE_CONFIG_DIR', pipewire_configdir)
|
|
|
|
cdata.set_quoted('PLUGINDIR', spa_plugindir)
|
2021-09-18 09:32:29 +00:00
|
|
|
cdata.set_quoted('SPADATADIR', spa_datadir)
|
2021-04-15 04:41:04 +00:00
|
|
|
cdata.set_quoted('PA_ALSA_PATHS_DIR', alsadatadir / 'paths')
|
|
|
|
cdata.set_quoted('PA_ALSA_PROFILE_SETS_DIR', alsadatadir / 'profile-sets')
|
2016-09-26 10:15:52 +00:00
|
|
|
|
2021-06-10 03:24:14 +00:00
|
|
|
if host_machine.endian() == 'big'
|
|
|
|
cdata.set('WORDS_BIGENDIAN', 1)
|
|
|
|
endif
|
2016-09-26 10:15:52 +00:00
|
|
|
|
2022-02-03 16:56:57 +00:00
|
|
|
check_headers = [
|
2021-02-24 16:02:47 +00:00
|
|
|
['sys/mount.h', 'HAVE_SYS_MOUNT_H'],
|
2016-09-26 10:15:52 +00:00
|
|
|
['sys/param.h', 'HAVE_SYS_PARAM_H'],
|
2021-03-04 09:57:48 +00:00
|
|
|
['sys/random.h', 'HAVE_SYS_RANDOM_H'],
|
2021-02-24 16:02:47 +00:00
|
|
|
['sys/vfs.h', 'HAVE_SYS_VFS_H'],
|
2020-07-31 10:46:58 +00:00
|
|
|
['pwd.h', 'HAVE_PWD_H'],
|
2016-09-26 10:15:52 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
foreach h : check_headers
|
2022-02-03 17:52:54 +00:00
|
|
|
cdata.set(h.get(1), cc.has_header(h.get(0)))
|
2016-09-26 10:15:52 +00:00
|
|
|
endforeach
|
|
|
|
|
2022-02-03 17:52:54 +00:00
|
|
|
cdata.set('HAVE_PIDFD_OPEN',
|
|
|
|
cc.get_define('SYS_pidfd_open', prefix: '#include <sys/syscall.h>') != '')
|
2021-06-10 05:12:12 +00:00
|
|
|
|
2021-03-10 18:36:27 +00:00
|
|
|
systemd = dependency('systemd', required: get_option('systemd'))
|
|
|
|
systemd_dep = dependency('libsystemd',required: get_option('systemd'))
|
2021-06-25 03:45:51 +00:00
|
|
|
summary({'systemd conf data': systemd.found()}, bool_yn: true)
|
|
|
|
summary({'libsystemd': systemd_dep.found()}, bool_yn: true)
|
2022-02-03 17:52:54 +00:00
|
|
|
cdata.set('HAVE_SYSTEMD', systemd.found() and systemd_dep.found())
|
2020-07-22 12:50:38 +00:00
|
|
|
|
2016-09-26 10:15:52 +00:00
|
|
|
configinc = include_directories('.')
|
2021-06-07 05:54:09 +00:00
|
|
|
includes_inc = include_directories('include')
|
2017-07-11 13:57:20 +00:00
|
|
|
pipewire_inc = include_directories('src')
|
2016-09-26 10:15:52 +00:00
|
|
|
|
2017-06-26 11:04:47 +00:00
|
|
|
makedata = configuration_data()
|
2021-12-28 15:35:20 +00:00
|
|
|
makedata.set('BUILD_ROOT', meson.project_build_root())
|
|
|
|
makedata.set('SOURCE_ROOT', meson.project_source_root())
|
|
|
|
makedata.set('VERSION', pipewire_version)
|
2017-06-26 11:04:47 +00:00
|
|
|
if version_arr.length() == 4
|
|
|
|
makedata.set('TAG', 'HEAD')
|
|
|
|
else
|
|
|
|
makedata.set('TAG', pipewire_version)
|
|
|
|
endif
|
|
|
|
|
|
|
|
configure_file(input : 'Makefile.in',
|
|
|
|
output : 'Makefile',
|
|
|
|
configuration : makedata)
|
|
|
|
|
2016-09-26 10:15:52 +00:00
|
|
|
# Find dependencies
|
2018-01-24 11:56:08 +00:00
|
|
|
mathlib = cc.find_library('m', required : false)
|
|
|
|
rt_lib = cc.find_library('rt', required : false) # clock_gettime
|
|
|
|
dl_lib = cc.find_library('dl', required : false)
|
|
|
|
pthread_lib = dependency('threads')
|
2021-10-09 13:00:04 +00:00
|
|
|
dbus_dep = dependency('dbus-1', required : get_option('dbus'))
|
2022-01-15 19:54:15 +00:00
|
|
|
summary({'dbus (Bluetooth, rt, portal, pw-reserve)': dbus_dep.found()}, bool_yn: true, section: 'Misc dependencies')
|
2022-02-03 17:52:54 +00:00
|
|
|
cdata.set('HAVE_DBUS', dbus_dep.found())
|
2021-02-15 10:59:10 +00:00
|
|
|
sdl_dep = dependency('sdl2', required : get_option('sdl2'))
|
2022-01-21 15:29:29 +00:00
|
|
|
summary({'SDL2 (video examples)': sdl_dep.found()}, bool_yn: true, section: 'Misc dependencies')
|
2021-10-23 15:25:13 +00:00
|
|
|
drm_dep = dependency('libdrm', required : false)
|
2022-11-07 14:35:01 +00:00
|
|
|
readline_dep = dependency('readline', required : get_option('readline'))
|
2021-09-30 20:11:50 +00:00
|
|
|
|
|
|
|
if not readline_dep.found()
|
2022-11-07 14:35:01 +00:00
|
|
|
readline_dep = cc.find_library('readline', required : get_option('readline'))
|
2021-09-30 20:11:50 +00:00
|
|
|
endif
|
|
|
|
|
2022-11-23 15:22:30 +00:00
|
|
|
# Both the FFmpeg SPA plugin and the pw-cat FFmpeg integration use libavcodec.
|
2023-02-12 15:09:03 +00:00
|
|
|
# But only the latter also needs libavformat and libavutil.
|
2022-11-23 15:22:30 +00:00
|
|
|
# Search for these libraries here, globally, so both of these subprojects can reuse the results.
|
|
|
|
pw_cat_ffmpeg = get_option('pw-cat-ffmpeg')
|
|
|
|
ffmpeg = get_option('ffmpeg')
|
|
|
|
if pw_cat_ffmpeg.allowed() or ffmpeg.allowed()
|
|
|
|
avcodec_dep = dependency('libavcodec', required: pw_cat_ffmpeg.enabled() or ffmpeg.enabled())
|
|
|
|
avformat_dep = dependency('libavformat', required: pw_cat_ffmpeg.enabled())
|
2023-02-12 15:09:03 +00:00
|
|
|
avutil_dep = dependency('libavutil', required: pw_cat_ffmpeg.enabled())
|
2022-11-23 15:22:30 +00:00
|
|
|
else
|
|
|
|
avcodec_dep = dependency('', required: false)
|
|
|
|
endif
|
2022-11-28 16:34:46 +00:00
|
|
|
cdata.set('HAVE_PW_CAT_FFMPEG_INTEGRATION', pw_cat_ffmpeg.allowed())
|
2022-09-20 09:43:16 +00:00
|
|
|
|
2023-03-10 16:39:51 +00:00
|
|
|
opus_dep = dependency('opus', required : get_option('opus'))
|
|
|
|
summary({'opus (Bluetooth, RTP)': opus_dep.found()}, bool_yn: true, section: 'Misc dependencies')
|
2023-03-12 18:04:14 +00:00
|
|
|
cdata.set('HAVE_OPUS', opus_dep.found())
|
2023-03-10 16:39:51 +00:00
|
|
|
|
2021-09-28 07:58:00 +00:00
|
|
|
summary({'readline (for pw-cli)': readline_dep.found()}, bool_yn: true, section: 'Misc dependencies')
|
2022-06-15 14:00:22 +00:00
|
|
|
cdata.set('HAVE_READLINE', readline_dep.found())
|
2021-03-25 08:39:29 +00:00
|
|
|
ncurses_dep = dependency('ncursesw', required : false)
|
2021-02-15 10:59:10 +00:00
|
|
|
sndfile_dep = dependency('sndfile', version : '>= 1.0.20', required : get_option('sndfile'))
|
2021-08-12 07:59:56 +00:00
|
|
|
summary({'sndfile': sndfile_dep.found()}, bool_yn: true, section: 'pw-cat/pw-play/pw-dump/filter-chain')
|
2022-02-03 17:52:54 +00:00
|
|
|
cdata.set('HAVE_SNDFILE', sndfile_dep.found())
|
2023-01-15 05:01:37 +00:00
|
|
|
libmysofa_dep = dependency('libmysofa', required : get_option('libmysofa'))
|
|
|
|
summary({'libmysofa': libmysofa_dep.found()}, bool_yn: true, section: 'filter-chain')
|
2021-05-12 13:55:15 +00:00
|
|
|
pulseaudio_dep = dependency('libpulse', required : get_option('libpulse'))
|
2021-06-25 03:45:51 +00:00
|
|
|
summary({'libpulse': pulseaudio_dep.found()}, bool_yn: true, section: 'Streaming between daemons')
|
2021-05-13 16:05:26 +00:00
|
|
|
avahi_dep = dependency('avahi-client', required : get_option('avahi'))
|
2021-06-25 03:45:51 +00:00
|
|
|
summary({'Avahi DNS-SD (Zeroconf)': avahi_dep.found()}, bool_yn: true,
|
|
|
|
section: 'Streaming between daemons')
|
2017-11-13 19:08:29 +00:00
|
|
|
|
2022-01-21 15:27:44 +00:00
|
|
|
x11_dep = dependency('x11-xcb', required : get_option('x11'))
|
|
|
|
summary({'X11 (x11-bell)': x11_dep.found()}, bool_yn: true,
|
|
|
|
section: 'Misc dependencies')
|
|
|
|
|
2022-02-17 19:16:22 +00:00
|
|
|
xfixes_dep = dependency('xfixes', required : get_option('x11-xfixes'), version: '>= 6')
|
|
|
|
cdata.set('HAVE_XFIXES_6', xfixes_dep.found())
|
|
|
|
|
2022-01-21 15:27:44 +00:00
|
|
|
canberra_dep = dependency('libcanberra', required : get_option('libcanberra'))
|
|
|
|
summary({'libcanberra (x11-bell)': canberra_dep.found()}, bool_yn: true,
|
|
|
|
section: 'Misc dependencies')
|
|
|
|
|
2021-06-13 18:52:41 +00:00
|
|
|
libusb_dep = dependency('libusb-1.0', required : get_option('libusb'))
|
2021-06-25 03:45:51 +00:00
|
|
|
summary({'libusb (Bluetooth quirks)': libusb_dep.found()}, bool_yn: true, section: 'Backend')
|
2022-02-03 17:52:54 +00:00
|
|
|
cdata.set('HAVE_LIBUSB', libusb_dep.found())
|
2021-06-13 18:52:41 +00:00
|
|
|
|
2021-06-10 06:11:43 +00:00
|
|
|
cap_lib = dependency('libcap', required : false)
|
2022-02-03 17:52:54 +00:00
|
|
|
cdata.set('HAVE_LIBCAP', cap_lib.found())
|
2021-06-10 06:11:43 +00:00
|
|
|
|
2022-07-30 18:29:42 +00:00
|
|
|
glib2_dep = dependency('glib-2.0', required : get_option('flatpak'))
|
|
|
|
summary({'GLib-2.0 (Flatpak support)': glib2_dep.found()}, bool_yn: true, section: 'Misc dependencies')
|
|
|
|
flatpak_support = glib2_dep.found()
|
|
|
|
cdata.set('HAVE_GLIB2', flatpak_support)
|
|
|
|
|
2022-12-07 08:10:29 +00:00
|
|
|
gio_dep = dependency('gio-2.0', version : '>= 2.26.0', required : get_option('gsettings'))
|
|
|
|
summary({'GIO (GSettings)': gio_dep.found()}, bool_yn: true, section: 'Misc dependencies')
|
|
|
|
|
2021-03-10 18:36:27 +00:00
|
|
|
gst_option = get_option('gstreamer')
|
|
|
|
gst_deps_def = {
|
|
|
|
'glib-2.0': {'version': '>=2.32.0'},
|
|
|
|
'gobject-2.0': {},
|
|
|
|
'gmodule-2.0': {},
|
|
|
|
'gio-2.0': {},
|
|
|
|
'gio-unix-2.0': {},
|
|
|
|
'gstreamer-1.0': {'version': '>= 1.10.0'},
|
|
|
|
'gstreamer-plugins-base-1.0': {},
|
|
|
|
'gstreamer-video-1.0': {},
|
|
|
|
'gstreamer-audio-1.0': {},
|
|
|
|
'gstreamer-allocators-1.0': {},
|
|
|
|
}
|
2018-06-01 09:38:18 +00:00
|
|
|
|
2021-03-10 18:36:27 +00:00
|
|
|
gst_dep = []
|
|
|
|
foreach depname, kwargs: gst_deps_def
|
|
|
|
dep = dependency(depname, required: gst_option, kwargs: kwargs)
|
2021-06-25 03:45:51 +00:00
|
|
|
summary({depname: dep.found()}, bool_yn: true, section: 'GStreamer modules')
|
2021-03-10 18:36:27 +00:00
|
|
|
if not dep.found()
|
2021-06-25 03:45:51 +00:00
|
|
|
# Beware, there's logic below depending on the array clear here!
|
2021-03-10 18:36:27 +00:00
|
|
|
gst_dep = []
|
|
|
|
if get_option('gstreamer-device-provider').enabled()
|
|
|
|
error('`gstreamer-device-provider` is enabled but `@0@` was not found.'.format(depname))
|
|
|
|
endif
|
|
|
|
break
|
|
|
|
endif
|
|
|
|
gst_dep += [dep]
|
|
|
|
endforeach
|
|
|
|
|
2021-06-25 03:45:51 +00:00
|
|
|
# This code relies on the array being empty if any dependency was not found
|
|
|
|
gst_dp_found = gst_dep.length() > 0
|
|
|
|
summary({'gstreamer-device-provider': gst_dp_found}, bool_yn: true, section: 'Backend')
|
|
|
|
|
2022-02-03 18:14:34 +00:00
|
|
|
cdata.set('HAVE_GSTREAMER_DEVICE_PROVIDER', get_option('gstreamer-device-provider').allowed())
|
2017-11-20 10:04:02 +00:00
|
|
|
|
2021-05-28 15:28:03 +00:00
|
|
|
webrtc_dep = dependency('webrtc-audio-processing',
|
|
|
|
version : ['>= 0.2', '< 1.0'],
|
|
|
|
required : get_option('echo-cancel-webrtc'))
|
2021-06-25 03:45:51 +00:00
|
|
|
summary({'WebRTC Echo Canceling': webrtc_dep.found()}, bool_yn: true, section: 'Misc dependencies')
|
2022-02-03 17:52:54 +00:00
|
|
|
cdata.set('HAVE_WEBRTC', webrtc_dep.found())
|
2021-05-28 15:28:03 +00:00
|
|
|
|
2022-06-19 18:03:56 +00:00
|
|
|
# On FreeBSD and MidnightBSD, epoll-shim library is required for eventfd() and timerfd()
|
2022-08-16 16:03:03 +00:00
|
|
|
epoll_shim_dep = (host_machine.system() == 'freebsd' or host_machine.system() == 'midnightbsd'
|
2019-11-09 19:03:38 +00:00
|
|
|
? dependency('epoll-shim', required: true)
|
|
|
|
: dependency('', required: false))
|
2018-10-09 08:27:59 +00:00
|
|
|
|
2022-08-16 16:03:03 +00:00
|
|
|
libinotify_dep = (host_machine.system() == 'freebsd' or host_machine.system() == 'midnightbsd'
|
2021-02-24 14:18:18 +00:00
|
|
|
? dependency('libinotify', required: true)
|
|
|
|
: dependency('', required: false))
|
|
|
|
|
2022-06-19 18:03:56 +00:00
|
|
|
# On FreeBSD and MidnightBSD, libintl library is required for gettext
|
2022-01-29 07:28:15 +00:00
|
|
|
libintl_dep = cc.find_library('intl', required: false)
|
2021-09-30 20:11:50 +00:00
|
|
|
if not libintl_dep.found()
|
2022-01-29 07:28:15 +00:00
|
|
|
libintl_dep = dependency('intl', required: false)
|
2021-09-30 20:11:50 +00:00
|
|
|
endif
|
|
|
|
summary({'intl support': libintl_dep.found()}, bool_yn: true)
|
2021-04-23 19:57:51 +00:00
|
|
|
|
2021-10-26 02:46:05 +00:00
|
|
|
need_alsa = get_option('pipewire-alsa').enabled() or 'media-session' in get_option('session-managers')
|
2021-09-20 22:57:56 +00:00
|
|
|
alsa_dep = dependency('alsa', version : '>=1.1.7', required: need_alsa)
|
2021-06-25 03:45:51 +00:00
|
|
|
summary({'pipewire-alsa': alsa_dep.found()}, bool_yn: true)
|
2020-03-09 19:08:05 +00:00
|
|
|
|
2022-08-16 16:03:03 +00:00
|
|
|
if host_machine.system() == 'freebsd' or host_machine.system() == 'midnightbsd'
|
2022-06-19 18:03:56 +00:00
|
|
|
# On FreeBSD and MidnightBSD the OpenSSL library may come from base or a package.
|
2021-12-24 18:25:11 +00:00
|
|
|
# Check for a package first and fallback to the base library if we can't find it via pkgconfig
|
|
|
|
openssl_lib = dependency('openssl', required: false)
|
|
|
|
if not openssl_lib.found()
|
|
|
|
openssl_lib = declare_dependency(link_args : [ '-lssl', '-lcrypto'])
|
|
|
|
endif
|
|
|
|
else
|
|
|
|
openssl_lib = dependency('openssl', required: get_option('raop'))
|
|
|
|
endif
|
2021-11-12 19:16:52 +00:00
|
|
|
summary({'OpenSSL (for raop-sink)': openssl_lib.found()}, bool_yn: true)
|
2021-11-11 10:42:16 +00:00
|
|
|
|
2021-12-10 16:44:28 +00:00
|
|
|
lilv_lib = dependency('lilv-0', required: get_option('lv2'))
|
|
|
|
summary({'lilv (for lv2 plugins)': lilv_lib.found()}, bool_yn: true)
|
|
|
|
|
2023-05-28 13:49:09 +00:00
|
|
|
libffado_dep = dependency('libffado', required: get_option('libffado'))
|
|
|
|
summary({'ffado': libffado_dep.found()}, bool_yn: true)
|
|
|
|
|
pipewire: module-x11-bell: handle X11 errors
Unfortunately, libX11 has global error and I/O error handlers,
which make it inconvenient to use them from library code.
Since libX11 1.7.0, there is a per-display "exit_handler" which
is called from `_XIOError()`, however, the global I/O error
handler is still called before that, and that - by default -
calls `exit(1)` in `_XDefaultIOError()` after printing the error
to stderr.
To avoid exiting, custom handlers will be registered when
libpipewire-module-x11-bell.so is loaded given that at
that moment the default handlers are installed.
When the shared object is unloaded, the handlers will
be reset to the default ones given that the currently
registered handlers are the ones that were registered
when the module was loaded.
The logic only works correctly if there are no concurrent
calls to `XSet{IO}ErrorHandler()` while `{set,restore}_x11_handlers()`
is running. Since module-x11-bell is probably mostly going to
be loaded in `pipewire-pulse`, this seems like a reasonable
assumption to make.
2022-02-17 18:39:30 +00:00
|
|
|
check_functions = [
|
|
|
|
['gettid', '#include <unistd.h>', ['-D_GNU_SOURCE'], []],
|
|
|
|
['memfd_create', '#include <sys/mman.h>', ['-D_GNU_SOURCE'], []],
|
|
|
|
['getrandom', '#include <stddef.h>\n#include <sys/random.h>', ['-D_GNU_SOURCE'], []],
|
2023-02-22 15:46:31 +00:00
|
|
|
['random_r', '#include <stdlib.h>', ['-D_GNU_SOURCE'], []],
|
2022-05-27 13:00:17 +00:00
|
|
|
['reallocarray', '#include <stdlib.h>', ['-D_GNU_SOURCE'], []],
|
pipewire: module-x11-bell: handle X11 errors
Unfortunately, libX11 has global error and I/O error handlers,
which make it inconvenient to use them from library code.
Since libX11 1.7.0, there is a per-display "exit_handler" which
is called from `_XIOError()`, however, the global I/O error
handler is still called before that, and that - by default -
calls `exit(1)` in `_XDefaultIOError()` after printing the error
to stderr.
To avoid exiting, custom handlers will be registered when
libpipewire-module-x11-bell.so is loaded given that at
that moment the default handlers are installed.
When the shared object is unloaded, the handlers will
be reset to the default ones given that the currently
registered handlers are the ones that were registered
when the module was loaded.
The logic only works correctly if there are no concurrent
calls to `XSet{IO}ErrorHandler()` while `{set,restore}_x11_handlers()`
is running. Since module-x11-bell is probably mostly going to
be loaded in `pipewire-pulse`, this seems like a reasonable
assumption to make.
2022-02-17 18:39:30 +00:00
|
|
|
['sigabbrev_np', '#include <string.h>', ['-D_GNU_SOURCE'], []],
|
|
|
|
['XSetIOErrorExitHandler', '#include <X11/Xlib.h>', [], [x11_dep]],
|
|
|
|
]
|
|
|
|
|
|
|
|
foreach f : check_functions
|
|
|
|
cdata.set('HAVE_' + f.get(0).to_upper(),
|
|
|
|
cc.has_function(f.get(0),
|
|
|
|
prefix: f.get(1),
|
|
|
|
args: f.get(2),
|
|
|
|
dependencies: f.get(3)))
|
|
|
|
endforeach
|
|
|
|
|
2021-04-15 04:41:04 +00:00
|
|
|
installed_tests_metadir = pipewire_datadir / 'installed-tests' / pipewire_name
|
|
|
|
installed_tests_execdir = pipewire_libexecdir / 'installed-tests' / pipewire_name
|
2022-02-03 18:14:34 +00:00
|
|
|
installed_tests_enabled = get_option('installed_tests').allowed()
|
2020-06-05 13:06:36 +00:00
|
|
|
installed_tests_template = files('template.test.in')
|
|
|
|
|
2022-02-03 18:14:34 +00:00
|
|
|
if get_option('tests').allowed()
|
2021-05-27 00:05:19 +00:00
|
|
|
gstack = find_program('gstack', required : false)
|
2022-02-03 17:52:54 +00:00
|
|
|
cdata.set('HAVE_GSTACK', gstack.found())
|
2021-05-27 00:05:19 +00:00
|
|
|
endif
|
|
|
|
|
2021-01-08 09:26:46 +00:00
|
|
|
subdir('po')
|
2019-11-09 19:03:38 +00:00
|
|
|
subdir('spa')
|
2017-07-11 13:57:20 +00:00
|
|
|
subdir('src')
|
2018-10-09 08:27:59 +00:00
|
|
|
|
2022-02-03 18:14:34 +00:00
|
|
|
if get_option('tests').allowed()
|
2021-05-27 00:05:19 +00:00
|
|
|
subdir('test')
|
|
|
|
endif
|
|
|
|
|
2021-06-10 03:36:31 +00:00
|
|
|
configure_file(output : 'config.h',
|
|
|
|
configuration : cdata)
|
2021-03-10 18:36:27 +00:00
|
|
|
|
2022-02-03 18:14:34 +00:00
|
|
|
if get_option('pipewire-jack').allowed()
|
2021-03-03 14:48:37 +00:00
|
|
|
subdir('pipewire-jack')
|
2018-10-09 08:27:59 +00:00
|
|
|
endif
|
2022-02-03 18:14:34 +00:00
|
|
|
if get_option('pipewire-v4l2').allowed()
|
2021-10-06 18:24:08 +00:00
|
|
|
subdir('pipewire-v4l2')
|
|
|
|
endif
|
2018-10-19 11:21:52 +00:00
|
|
|
|
2021-04-13 23:53:10 +00:00
|
|
|
if alsa_dep.found()
|
2018-10-09 08:27:59 +00:00
|
|
|
subdir('pipewire-alsa/alsa-plugins')
|
2020-05-02 08:42:44 +00:00
|
|
|
subdir('pipewire-alsa/conf')
|
2021-12-15 14:59:46 +00:00
|
|
|
subdir('pipewire-alsa/tests')
|
2018-10-09 08:27:59 +00:00
|
|
|
endif
|
2016-09-26 10:15:52 +00:00
|
|
|
|
2022-01-20 19:06:54 +00:00
|
|
|
generate_manpages = false
|
2022-02-03 18:14:34 +00:00
|
|
|
if get_option('man').allowed()
|
2021-09-03 07:16:48 +00:00
|
|
|
rst2man = find_program('rst2man', required: false)
|
|
|
|
if not rst2man.found()
|
|
|
|
rst2man = find_program('rst2man.py', required: get_option('man'))
|
|
|
|
endif
|
|
|
|
if rst2man.found()
|
2022-01-20 19:06:54 +00:00
|
|
|
generate_manpages = true
|
2021-09-03 07:16:48 +00:00
|
|
|
endif
|
2017-06-16 15:31:40 +00:00
|
|
|
endif
|
2018-09-23 00:55:16 +00:00
|
|
|
|
2022-01-20 19:06:54 +00:00
|
|
|
summary({'Manpage generation': generate_manpages}, bool_yn: true)
|
|
|
|
subdir('man')
|
|
|
|
|
|
|
|
doxygen = find_program('doxygen', required : get_option('docs'))
|
|
|
|
if doxygen.found()
|
|
|
|
subdir('doc')
|
|
|
|
endif
|
|
|
|
|
2018-09-23 00:55:16 +00:00
|
|
|
setenv = find_program('pw-uninstalled.sh')
|
2021-10-13 04:37:55 +00:00
|
|
|
run_target('pw-uninstalled',
|
|
|
|
command : [setenv,
|
2021-12-28 15:35:20 +00:00
|
|
|
'-b@0@'.format(meson.project_build_root()),
|
2021-10-13 04:37:55 +00:00
|
|
|
'-v@0@'.format(pipewire_version)]
|
|
|
|
)
|
2021-06-04 15:51:12 +00:00
|
|
|
|
2022-01-17 07:02:57 +00:00
|
|
|
devenv = environment()
|
2021-06-04 15:51:12 +00:00
|
|
|
|
2022-01-17 07:02:57 +00:00
|
|
|
builddir = meson.project_build_root()
|
|
|
|
srcdir = meson.project_source_root()
|
2021-06-04 15:51:12 +00:00
|
|
|
|
2022-01-17 07:23:55 +00:00
|
|
|
devenv.set('PIPEWIRE_CONFIG_DIR', pipewire_dep.get_variable('confdatadir'))
|
|
|
|
devenv.set('PIPEWIRE_MODULE_DIR', pipewire_dep.get_variable('moduledir'))
|
2021-06-04 15:51:12 +00:00
|
|
|
|
2022-01-17 07:23:55 +00:00
|
|
|
devenv.set('SPA_PLUGIN_DIR', spa_dep.get_variable('plugindir'))
|
|
|
|
devenv.set('SPA_DATA_DIR', spa_dep.get_variable('datadir'))
|
2021-06-04 15:51:12 +00:00
|
|
|
|
2022-01-17 07:02:57 +00:00
|
|
|
devenv.set('GST_PLUGIN_PATH', builddir / 'src'/ 'gst')
|
2021-06-04 15:51:12 +00:00
|
|
|
|
2022-01-17 07:02:57 +00:00
|
|
|
devenv.set('ALSA_PLUGIN_DIR', builddir / 'pipewire-alsa' / 'alsa-plugins')
|
|
|
|
devenv.set('ACP_PATHS_DIR', srcdir / 'spa' / 'plugins' / 'alsa' / 'mixer' / 'paths')
|
|
|
|
devenv.set('ACP_PROFILES_DIR', srcdir / 'spa' / 'plugins' / 'alsa' / 'mixer' / 'profile-sets')
|
2021-06-04 15:51:12 +00:00
|
|
|
|
2022-01-17 07:02:57 +00:00
|
|
|
devenv.set('LD_LIBRARY_PATH', builddir / 'pipewire-jack' / 'src')
|
2021-06-04 15:51:12 +00:00
|
|
|
|
2022-01-17 07:02:57 +00:00
|
|
|
devenv.set('PW_UNINSTALLED', '1')
|
2021-06-04 15:51:12 +00:00
|
|
|
|
2022-01-17 07:02:57 +00:00
|
|
|
meson.add_devenv(devenv)
|