From 81ff0a09a93303233057f217aaa3f679db3bbe5c Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Sat, 10 Apr 2021 09:15:47 +0200 Subject: build: set pkgconfig/dependency variables for features This allows libseat users to e.g. advise people to chmod a+s the executable if libseat is built with the builtin backend. While bumping the Meson version, adjust the scdoc logic to avoid the following warnings: WARNING: Project targeting '>=0.56.0' but tried to use feature deprecated since '0.56.0': Dependency.get_pkgconfig_variable. use Dependency.get_variable(pkgconfig : ...) instead WARNING: Project targeting '>=0.56.0' but tried to use feature deprecated since '0.55.0': ExternalProgram.path. use ExternalProgram.full_path() instead --- meson.build | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/meson.build b/meson.build index a7e4734..7a70cb6 100644 --- a/meson.build +++ b/meson.build @@ -3,7 +3,7 @@ project( 'c', version: '0.5.0', license: 'MIT', - meson_version: '>=0.53.0', + meson_version: '>=0.56.0', default_options: [ 'c_std=c11', 'warning_level=3', @@ -167,18 +167,26 @@ lib = library( install_headers('include/libseat.h') +libseat_vars = { + 'have_seatd': with_seatd.to_string(), + 'have_logind': logind.found().to_string(), + 'have_builtin': with_builtin.to_string(), +} + pkgconfig = import('pkgconfig') pkgconfig.generate(lib, version: meson.project_version(), filebase: 'libseat', name: 'libseat', description: 'Seat management library', + variables: libseat_vars, ) libseat = declare_dependency( link_with: lib, dependencies: private_deps, include_directories: include_directories('include', is_system: true), + variables: libseat_vars, ) if with_server @@ -220,7 +228,7 @@ else endif if scdoc.found() - scdoc_prog = find_program(scdoc.get_pkgconfig_variable('scdoc'), native: true) + scdoc_prog = find_program(scdoc.get_variable(pkgconfig: 'scdoc'), native: true) mandir = get_option('mandir') foreach src : ['seatd.1.scd'] @@ -233,7 +241,7 @@ if scdoc.found() input: 'man/' + src, output: output, command: [ - 'sh', '-c', '@0@ < @INPUT@ > @1@'.format(scdoc_prog.path(), output) + 'sh', '-c', '@0@ < @INPUT@ > @1@'.format(scdoc_prog.full_path(), output) ], install: true, install_dir: '@0@/man@1@'.format(mandir, section) -- cgit v1.2.3