meson: make get_pkgconfig_variable version specific

This commit is contained in:
Dmitri Chudinov 2023-12-05 17:38:57 +05:00
parent c7007dd50b
commit 808423d71b
Signed by: dimmus
GPG Key ID: D4AED7D0CD0B767C
4 changed files with 32 additions and 6 deletions

View File

@ -11,8 +11,14 @@ endif
org_enlightenment_ethumb_service_config.set('systemd_dbus_prefix',
systemd_dbus_prefix)
if meson.version().version_compare('>=0.58')
session_bus_services_dir = dep.get_variable('session_bus_services_dir')
else
session_bus_services_dir = dep.get_pkgconfig_variable('session_bus_services_dir')
endif
configure_file(
input: 'org.enlightenment.Ethumb.service.in',
output: 'org.enlightenment.Ethumb.service',
configuration: org_enlightenment_ethumb_service_config,
install_dir: dep.get_pkgconfig_variable('session_bus_services_dir'))
install_dir: session_bus_services_dir)

View File

@ -306,9 +306,18 @@ if sys_osx and get_option('lua-interpreter') == 'luajit'
# luajit on macro is broken, this means we need to generate our own
# dependency with our arguments, a library later still needs to link to
# luajit for the pagesize argument thingy
if meson.version().version_compare('>=0.58')
lua_inc_dir = lua.get_variable('includedir')
lua_lib_dir = lua.get_variable('libdir')
lua_lib_name = lua.get_variable('libname')
else
lua_inc_dir = lua.get_pkgconfig_variable('includedir')
lua_lib_dir = lua.get_pkgconfig_variable('libdir')
lua_lib_name = lua.get_pkgconfig_variable('libname')
endif
lua = declare_dependency(
include_directories: include_directories(lua.get_pkgconfig_variable('includedir')),
link_args: ['-L' + lua.get_pkgconfig_variable('libdir'), '-l' + lua.get_pkgconfig_variable('libname')]
include_directories: include_directories(lua_inc_dir),
link_args: ['-L' + lua_lib_dir, '-l' + lua_lib_name]
)
endif

View File

@ -20,15 +20,21 @@ wl_stable_protocol_sys = [
join_paths('xdg-shell', 'xdg-shell.xml'),
]
if meson.version().version_compare('>=0.58')
wl_pkg_data_dir = _wayland_protocols.get_variable('pkgdatadir')
else
wl_pkg_data_dir = _wayland_protocols.get_pkgconfig_variable('pkgdatadir')
endif
foreach sys_protocol : wl_unstable_protocol_sys
wl_protocol_local += [
join_paths(_wayland_protocols.get_pkgconfig_variable('pkgdatadir'), 'unstable',
join_paths(wl_pkg_data_dir, 'unstable',
sys_protocol)]
endforeach
foreach sys_protocol : wl_stable_protocol_sys
wl_protocol_local += [
join_paths(_wayland_protocols.get_pkgconfig_variable('pkgdatadir'), 'stable',
join_paths(wl_pkg_data_dir, 'stable',
sys_protocol)]
endforeach

View File

@ -1,7 +1,12 @@
if get_option('systemd') == true
sys_dep = dependency('systemd', required: false)
if sys_dep.found()
sys_dir = sys_dep.get_pkgconfig_variable('systemduserunitdir')
if meson.version().version_compare('>=0.58')
sys_unit_dir = sys_dep.get_variable('systemduserunitdir')
else
sys_unit_dir = sys_dep.get_pkgconfig_variable('systemduserunitdir')
endif
sys_dir = sys_unit_dir
else
sys_dir = join_paths(dir_lib, 'systemd', 'user')
endif