From cd1418222bfa8a29a85b9ab8172980f5c608f23f Mon Sep 17 00:00:00 2001 From: Arnaud Rebillout Date: Mon, 19 Nov 2018 08:48:35 +0000 Subject: [PATCH] meson: Install pkg-config files Signed-off-by: Arnaud Rebillout --- meson.build | 38 ++++++++++++++++++++++++++++++++++++++ meson_options.txt | 3 +++ src/pulse/meson.build | 1 - 3 files changed, 41 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 7e43846bb..a49ab6938 100644 --- a/meson.build +++ b/meson.build @@ -42,6 +42,7 @@ 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')) @@ -51,6 +52,7 @@ 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') @@ -437,6 +439,42 @@ check_dep = dependency('check', version : '>= 0.9.10', required : get_option('te # Now generate config.h from everything above configure_file(output : 'config.h', configuration : cdata) +# 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 + +# Subdirs + if get_option('man') subdir('man') endif diff --git a/meson_options.txt b/meson_options.txt index d2a7155b7..a550df2c4 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -21,6 +21,9 @@ option('database', option('legacy-database-entry-format', type : 'boolean', description : 'Try to load legacy (< 1.0) database files (card, device and volume restore)') + +# Paths + option('pulsedspdir', type : 'string', description : 'Specify location where OSS wrapper will be installed') diff --git a/src/pulse/meson.build b/src/pulse/meson.build index 7100f34e1..f0db2da3e 100644 --- a/src/pulse/meson.build +++ b/src/pulse/meson.build @@ -91,7 +91,6 @@ libpulse_simple = shared_library('pulse-simple', 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', -- 2.34.1