mirror of
https://github.com/hyprwm/hyprland-protocols.git
synced 2024-11-22 05:05:58 +01:00
meson: init
This commit is contained in:
parent
6350fb45eb
commit
0dcff94fc1
2 changed files with 65 additions and 0 deletions
7
hyprland-protocols.pc.in
Normal file
7
hyprland-protocols.pc.in
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
prefix=@prefix@
|
||||||
|
datarootdir=@datarootdir@
|
||||||
|
pkgdatadir=${pc_sysrootdir}${datarootdir}/@PACKAGE@
|
||||||
|
|
||||||
|
Name: Hyprland Protocols
|
||||||
|
Description: Hyprland protocol files
|
||||||
|
Version: @HYPRLAND_PROTOCOLS_VERSION@
|
58
meson.build
Normal file
58
meson.build
Normal file
|
@ -0,0 +1,58 @@
|
||||||
|
project('hyprland-protocols',
|
||||||
|
version: '0.1',
|
||||||
|
meson_version: '>= 0.55.0',
|
||||||
|
)
|
||||||
|
|
||||||
|
hyprland_protocols_version = meson.project_version()
|
||||||
|
|
||||||
|
fs = import('fs')
|
||||||
|
|
||||||
|
protocols = {
|
||||||
|
'hyprland-toplevel-export': ['v1']
|
||||||
|
}
|
||||||
|
|
||||||
|
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'),
|
||||||
|
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)
|
||||||
|
pkgconfig_configuration.set('PACKAGE', 'hyprland-protocols')
|
||||||
|
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)
|
Loading…
Reference in a new issue