2022-12-05 17:28:47 +01:00
|
|
|
project('hyprland-protocols',
|
2024-07-18 20:14:43 +02:00
|
|
|
version: run_command('cat', 'VERSION', check: true).stdout().strip(),
|
|
|
|
meson_version: '>= 0.60.3',
|
2022-12-05 17:28:47 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
hyprland_protocols_version = meson.project_version()
|
|
|
|
|
|
|
|
fs = import('fs')
|
|
|
|
|
|
|
|
protocols = {
|
2023-04-09 01:38:34 +02:00
|
|
|
'hyprland-toplevel-export': ['v1'],
|
2024-05-05 02:38:18 +02:00
|
|
|
'hyprland-global-shortcuts': ['v1'],
|
|
|
|
'hyprland-focus-grab': ['v1'],
|
2022-12-05 17:28:47 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
protocol_files = []
|
|
|
|
|
|
|
|
foreach name : protocols.keys()
|
|
|
|
foreach version : protocols.get(name)
|
|
|
|
protocol_files += [
|
|
|
|
'protocols/@0@-@1@.xml'.format(name, version)
|
|
|
|
]
|
|
|
|
endforeach
|
|
|
|
endforeach
|
|
|
|
|
|
|
|
foreach protocol_file : protocol_files
|
|
|
|
protocol_install_dir = fs.parent(join_paths(
|
|
|
|
get_option('datadir'),
|
2023-04-09 20:19:22 +02:00
|
|
|
'hyprland-protocols',
|
2022-12-05 17:28:47 +01:00
|
|
|
protocol_file,
|
|
|
|
))
|
|
|
|
install_data(
|
|
|
|
protocol_file,
|
|
|
|
install_dir: protocol_install_dir,
|
|
|
|
)
|
|
|
|
endforeach
|
|
|
|
|
|
|
|
hyprland_protocols_srcdir = meson.current_source_dir()
|
|
|
|
|
|
|
|
pkgconfig_configuration = configuration_data()
|
|
|
|
pkgconfig_configuration.set('prefix', get_option('prefix'))
|
|
|
|
pkgconfig_configuration.set('datarootdir', '${prefix}/@0@'.format(get_option('datadir')))
|
|
|
|
pkgconfig_configuration.set('abs_top_srcdir', hyprland_protocols_srcdir)
|
2023-04-09 20:19:22 +02:00
|
|
|
pkgconfig_configuration.set('PACKAGE', 'hyprland-protocols')
|
2022-12-05 17:28:47 +01:00
|
|
|
pkgconfig_configuration.set('HYPRLAND_PROTOCOLS_VERSION', hyprland_protocols_version)
|
|
|
|
|
|
|
|
pkg_install_dir = join_paths(get_option('datadir'), 'pkgconfig')
|
|
|
|
configure_file(
|
|
|
|
input: 'hyprland-protocols.pc.in',
|
|
|
|
output: 'hyprland-protocols.pc',
|
|
|
|
configuration: pkgconfig_configuration,
|
|
|
|
install_dir: pkg_install_dir,
|
|
|
|
)
|
|
|
|
|
|
|
|
hyprland_protocols = declare_dependency(
|
|
|
|
variables: {
|
|
|
|
'pkgdatadir': hyprland_protocols_srcdir,
|
|
|
|
},
|
|
|
|
)
|
|
|
|
|
|
|
|
meson.override_dependency('hyprland-protocols', hyprland_protocols)
|