-
Notifications
You must be signed in to change notification settings - Fork 2
/
meson.build
82 lines (66 loc) · 1.8 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
project('haruhishot', 'rust', version: '0.4.0', meson_version: '>= 0.60')
dependency('wayland-client')
cargo = find_program('cargo', version: '>= 1.66')
find_program('rustc', version: '>= 1.66')
command = [cargo, 'build']
if get_option('enable-notify')
command += ['--features', 'notify']
endif
if get_option('enable-gui')
command += ['--features', 'gui']
endif
if get_option('enable-swayipc')
command += ['--features', 'sway']
endif
targetdir = 'debug'
if not get_option('debug')
command += '--release'
targetdir = 'release'
endif
command += [
'&&',
'cp',
meson.global_source_root() / 'target' / targetdir / meson.project_name(),
'@OUTPUT@',
]
prefix = get_option('prefix')
bindir = prefix / get_option('bindir')
datadir = prefix / get_option('datadir')
icondir = datadir / 'pixmaps'
custom_target(
meson.project_name(),
output: meson.project_name(),
build_by_default: true,
install: true,
install_dir: bindir,
console: true,
command: command,
)
if get_option('enable-notify')
install_data('misc/haruhi_failed.png', install_dir: icondir)
install_data('misc/haruhi_succeed.png.png', install_dir: icondir)
endif
if get_option('man-pages')
manpage = get_option('mandir')
scdoc = dependency('scdoc', version: '>= 1.9.7', native: true)
if scdoc.found()
custom_target(
'haruhishot.1',
input: 'scdoc/haruishot.1.scd',
output: 'haruhishot.1',
command: scdoc.get_variable('scdoc'),
feed: true,
capture: true,
install: true,
install_dir: prefix / manpage / 'man1',
)
endif
endif
# Install desktop entry
if get_option('desktop-entry')
install_data('misc/haruhishot.desktop', install_dir: datadir / 'applications')
install_data(
'misc/haruhishot.svg',
install_dir: datadir / 'icons' / 'hicolor' / 'scalable' / 'apps',
)
endif