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
endforeach
plugindir = join_paths(get_option('prefix'), get_option('libdir'), meson.project_name())
themedir = join_paths(get_option('prefix'), get_option('datadir'), meson.project_name(), 'themes')
plugindir = join_paths(get_option('libdir'), meson.project_name())
themedir = join_paths(get_option('datadir'), meson.project_name(), 'themes')
deps = [
plugins_deps = [
dependency('glib-2.0', version: '>= 2.40'),
dependency('gio-unix-2.0'),
dependency('gmodule-2.0'),
dependency('cairo'),
]
deps = [
plugins_deps,
dependency('gio-unix-2.0'),
dependency('pango'),
dependency('pangocairo'),
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('SYSCONFDIR', join_paths(get_option('prefix'), get_option('sysconfdir')))
header_conf.set_quoted('PLUGIN_PATH', plugindir)
header_conf.set_quoted('THEME_DIR', themedir)
header_conf.set_quoted('PLUGIN_PATH', join_paths(get_option('prefix'), plugindir))
header_conf.set_quoted('THEME_DIR', join_paths(get_option('prefix'), themedir))
config_h = configure_file(output: 'config.h', configuration: header_conf)
@ -248,22 +252,19 @@ install_data(
)
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(
input: 'pkgconfig/rofi.pc.in',
output: 'rofi.pc',
configuration: pkgconfig_conf,
install_dir: join_paths(get_option('libdir'), 'pkgconfig'),
pkg.generate(
filebase: 'rofi',
name: 'rofi',
version: meson.project_version(),
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.c',
],