meson: Create bindir and libdir variables

This is to avoid using the construct 'join_paths(prefix, get_option(...))'
everywhere in the meson files. It's better to settle the paths question
once and for all at the beginning.

Signed-off-by: Arnaud Rebillout <arnaud.rebillout@collabora.com>
This commit is contained in:
Arnaud Rebillout 2018-10-09 10:37:42 +07:00 committed by Arun Raghavan
parent 1e86d616f5
commit ea92c28218
3 changed files with 7 additions and 5 deletions

View file

@ -35,13 +35,15 @@ if not prefix.startswith('/')
error('Prefix is not absolute: "@0@"'.format(prefix))
endif
bindir = join_paths(prefix, get_option('bindir'))
libdir = join_paths(prefix, get_option('libdir'))
datadir = join_paths(prefix, get_option('datadir'))
localstatedir = join_paths(prefix, get_option('localstatedir'))
sysconfdir = join_paths(prefix, get_option('sysconfdir'))
pulsedspdir = get_option('pulsedspdir')
if pulsedspdir == ''
join_paths(prefix, get_option('libdir'), 'pulseaudio')
join_paths(libdir, 'pulseaudio')
endif
cc = meson.get_compiler('c')
@ -61,11 +63,11 @@ cdata.set_quoted('PA_SRCDIR', join_paths(meson.current_source_dir(), 'src'))
cdata.set_quoted('PA_BUILDDIR', meson.current_build_dir())
cdata.set_quoted('PA_SOEXT', '.so')
cdata.set_quoted('PA_DEFAULT_CONFIG_DIR', join_paths(sysconfdir, 'pulse'))
cdata.set_quoted('PA_BINARY', join_paths(prefix, get_option('bindir'), 'pulseaudio'))
cdata.set_quoted('PA_BINARY', join_paths(bindir, 'pulseaudio'))
cdata.set_quoted('PA_SYSTEM_RUNTIME_PATH', join_paths(localstatedir, 'run', 'pulse'))
cdata.set_quoted('PA_SYSTEM_CONFIG_PATH', join_paths(localstatedir, 'lib', 'pulse'))
cdata.set_quoted('PA_SYSTEM_STATE_PATH', join_paths(localstatedir, 'lib', 'pulse'))
cdata.set_quoted('PA_DLSEARCHPATH', join_paths(prefix, get_option('libdir'), 'pulse-' + pa_version_major_minor, 'modules'))
cdata.set_quoted('PA_DLSEARCHPATH', join_paths(libdir, 'pulse-' + pa_version_major_minor, 'modules'))
cdata.set_quoted('PA_SYSTEM_USER', get_option('system_user'))
cdata.set_quoted('PA_SYSTEM_GROUP', get_option('system_group'))
cdata.set_quoted('PA_ACCESS_GROUP', get_option('access_group'))

View file

@ -35,7 +35,7 @@ all_modules = [
[ 'module-http-protocol-unix', 'module-protocol-stub.c', [], ['-DUSE_PROTOCOL_HTTP', '-DUSE_UNIX_SOCKETS'], [], libprotocol_http ],
[ 'module-intended-roles', 'module-intended-roles.c' ],
[ 'module-jackdbus-detect', 'jack/module-jackdbus-detect.c', [], [], [dbus_dep] ],
[ 'module-ladspa-sink', 'module-ladspa-sink.c', 'ladspa.h', ['-DLADSPA_PATH="' + join_paths(prefix, get_option('libdir')) + '/ladspa:/usr/local/lib/ladspa:/usr/lib/ladspa:/usr/local/lib64/ladspa:/usr/lib64/ladspa"'], [dbus_dep, libm_dep, ltdl_dep] ],
[ 'module-ladspa-sink', 'module-ladspa-sink.c', 'ladspa.h', ['-DLADSPA_PATH="' + libdir + '/ladspa:/usr/local/lib/ladspa:/usr/lib/ladspa:/usr/local/lib64/ladspa:/usr/lib64/ladspa"'], [dbus_dep, libm_dep, ltdl_dep] ],
[ 'module-loopback', 'module-loopback.c' ],
[ 'module-match', 'module-match.c' ],
[ 'module-native-protocol-fd', 'module-native-protocol-fd.c', [], [], [], libprotocol_native ],

View file

@ -82,6 +82,6 @@ if cc.has_header('sys/soundcard.h')
output : 'padsp',
configuration : cdata,
install : true,
install_dir : join_paths(prefix, get_option('bindir')),
install_dir : bindir,
)
endif