meson: init

This commit is contained in:
Mihai Fufezan 2022-12-05 18:28:47 +02:00
parent 6350fb45eb
commit 0dcff94fc1
No known key found for this signature in database
GPG key ID: 5899325F2F120900
2 changed files with 65 additions and 0 deletions

7
hyprland-protocols.pc.in Normal file
View 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
View 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)