-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathmeson.build
60 lines (51 loc) · 1.53 KB
/
meson.build
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
project(
'ignis',
license: 'GPL-3.0-only',
version: run_command(['tools/get_version.py'], check: true).stdout().strip(),
default_options: ['warning_level=2', 'werror=false']
)
# Find Python installation
python = import('python').find_installation(pure: false)
# Set folders
bindir = get_option('bindir')
pylibdir = python.get_install_dir()
pkginstalldir = join_paths(pylibdir, meson.project_name())
# Dependencies
if get_option('dependency_check')
dependency('glib-2.0')
dependency('gobject-introspection-1.0')
dependency('gio-2.0')
dependency('gtk4')
dependency('gtk4-layer-shell-0')
endif
# gvc
if get_option('build_gvc')
subproject('gvc',
default_options: [
'package_name=' + meson.project_name(),
'static=false',
'introspection=true',
'alsa=false'
]
)
endif
# Do installation
install_subdir(
'ignis',
install_dir: pylibdir,
)
config = configuration_data()
config.set('COMMIT', run_command('git', 'rev-parse', 'HEAD', check: false).stdout().strip())
config.set('BRANCH', run_command('git', 'branch', '--show-current', check: false).stdout().strip())
config.set('COMMIT_MSG', run_command('git', 'log', '-1', '--pretty=%B', check: false).stdout().strip().replace('\\', '\\\\').replace('"', '\\"'))
install_data(
files('bin/ignis'),
install_dir: bindir,
install_mode: 'rwxr-xr-x',
)
configure_file(
input: 'ignis/__commit__.py.in',
output: '__commit__.py',
configuration: config,
install_dir: pkginstalldir
)