forked from ErikReider/SwayNotificationCenter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmeson.build
131 lines (110 loc) · 3.41 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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
project('sway-notificaton-center', ['c', 'vala'],
version: '0.7.3',
meson_version: '>= 0.59.0',
default_options: [ 'warning_level=2' ],
)
add_project_arguments(['--enable-gobject-tracing'], language: 'vala')
add_project_arguments(['--enable-checking'], language: 'vala')
i18n = import('i18n')
subdir('data')
subdir('src')
datadir = get_option('datadir')
libdir = get_option('libdir')
conf_data = configuration_data()
conf_data.set('bindir', join_paths(get_option('prefix'), get_option('bindir')))
# Dbus service
configure_file(
configuration: conf_data,
input: 'services/dbus/org.erikreider.swaync.service.in',
output: '@BASENAME@',
install_dir: datadir + '/dbus-1/services'
)
# Systemd service unit
systemd = dependency('systemd', required: false)
if get_option('systemd-service')
if systemd.found()
systemd_service_install_dir = systemd.get_variable(pkgconfig :'systemduserunitdir')
else
systemd_service_install_dir = join_paths(libdir, 'systemd', 'user')
endif
configure_file(
configuration: conf_data,
input: 'services/systemd/swaync.service.in',
output: '@BASENAME@',
install_dir: systemd_service_install_dir
)
endif
# Zsh completion
if get_option('zsh-completions')
zsh_files = files(
'completions/zsh/_swaync',
'completions/zsh/_swaync-client',
)
zsh_install_dir = join_paths(datadir, 'zsh', 'site-functions')
install_data(zsh_files, install_dir: zsh_install_dir)
endif
# Bash completion
bash_comp = dependency('bash-completion', required: false)
if get_option('bash-completions')
bash_files = files(
'completions/bash/swaync',
'completions/bash/swaync-client',
)
if bash_comp.found()
bash_install_dir = bash_comp.get_variable(
pkgconfig: 'completionsdir',
pkgconfig_define: ['datadir', datadir]
)
else
bash_install_dir = join_paths(datadir, 'bash-completion', 'completions')
endif
install_data(bash_files, install_dir: bash_install_dir)
endif
# Fish completion
fish_comp = dependency('fish', required: false)
if get_option('fish-completions')
fish_files = files(
'completions/fish/swaync.fish',
'completions/fish/swaync-client.fish',
)
if fish_comp.found()
fish_install_dir = fish_comp.get_variable(
pkgconfig: 'completionsdir',
pkgconfig_define: ['datadir', datadir]
)
else
fish_install_dir = join_paths(datadir, 'fish', 'vendor_completions.d')
endif
install_data(fish_files, install_dir: fish_install_dir)
endif
# Man pages
if get_option('man-pages')
scdoc = dependency('scdoc', version: '>=1.9.2', native: true, required: true)
if scdoc.found()
scdoc_prog = find_program(scdoc.get_variable(pkgconfig :'scdoc'), native: true)
mandir = get_option('mandir')
man_files = [
'swaync.1.scd',
'swaync.5.scd',
'swaync-client.1.scd',
]
foreach filename : man_files
topic = filename.split('.')[-3].split('/')[-1]
section = filename.split('.')[-2]
output = '@0@.@1@'.format(topic, section)
message(mandir, section, '@0@/man@1@'.format(mandir, section))
custom_target(
output,
input: join_paths('man', filename),
output: output,
command: scdoc_prog,
install: true,
feed: true,
capture: true,
install_dir: '@0@/man@1@'.format(mandir, section)
)
endforeach
endif
endif
# Run the postinstall script when installing
meson.add_install_script('build-aux/meson/postinstall.py')