meson: Use Meson pkgconfig module

Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
This commit is contained in:
Quentin Glidic 2019-03-26 12:25:40 +01:00
parent 08a80b4448
commit 66995fe215
No known key found for this signature in database
GPG Key ID: AC203F96E2C34BB7
1 changed files with 19 additions and 18 deletions

View File

@ -28,14 +28,18 @@ foreach f : flags
endif endif
endforeach endforeach
plugindir = join_paths(get_option('prefix'), get_option('libdir'), meson.project_name()) plugindir = join_paths(get_option('libdir'), meson.project_name())
themedir = join_paths(get_option('prefix'), get_option('datadir'), meson.project_name(), 'themes') themedir = join_paths(get_option('datadir'), meson.project_name(), 'themes')
deps = [ plugins_deps = [
dependency('glib-2.0', version: '>= 2.40'), dependency('glib-2.0', version: '>= 2.40'),
dependency('gio-unix-2.0'),
dependency('gmodule-2.0'), dependency('gmodule-2.0'),
dependency('cairo'), dependency('cairo'),
]
deps = [
plugins_deps,
dependency('gio-unix-2.0'),
dependency('pango'), dependency('pango'),
dependency('pangocairo'), dependency('pangocairo'),
dependency('xkbcommon'), dependency('xkbcommon'),
@ -79,8 +83,8 @@ header_conf.set('TIMINGS', get_option('timings'))
header_conf.set_quoted('MANPAGE_PATH', join_paths(get_option('prefix'), get_option('mandir'))) header_conf.set_quoted('MANPAGE_PATH', join_paths(get_option('prefix'), get_option('mandir')))
header_conf.set_quoted('SYSCONFDIR', join_paths(get_option('prefix'), get_option('sysconfdir'))) header_conf.set_quoted('SYSCONFDIR', join_paths(get_option('prefix'), get_option('sysconfdir')))
header_conf.set_quoted('PLUGIN_PATH', plugindir) header_conf.set_quoted('PLUGIN_PATH', join_paths(get_option('prefix'), plugindir))
header_conf.set_quoted('THEME_DIR', themedir) header_conf.set_quoted('THEME_DIR', join_paths(get_option('prefix'), themedir))
config_h = configure_file(output: 'config.h', configuration: header_conf) config_h = configure_file(output: 'config.h', configuration: header_conf)
@ -248,22 +252,19 @@ install_data(
) )
pkg = import('pkgconfig') pkg = import('pkgconfig')
pkgconfig_conf = configuration_data()
pkgconfig_conf.set('prefix', get_option('prefix'))
pkgconfig_conf.set('exec_prefix', '${prefix}')
pkgconfig_conf.set('VERSION', meson.project_version())
pkgconfig_conf.set('libdir', join_paths('${prefix}',get_option('libdir')))
pkgconfig_conf.set('includedir', join_paths('${prefix}',get_option('includedir')))
configure_file( pkg.generate(
input: 'pkgconfig/rofi.pc.in', filebase: 'rofi',
output: 'rofi.pc', name: 'rofi',
configuration: pkgconfig_conf, version: meson.project_version(),
install_dir: join_paths(get_option('libdir'), 'pkgconfig'), description: 'Header files for rofi plugins',
variables: [
'pluginsdir=@0@'.format(join_paths('${libdir}', meson.project_name())),
],
requires_private: plugins_deps,
) )
test('history test', executable('history.test', [ test('history test', executable('history.test', [
'test/history-test.c', 'test/history-test.c',
], ],