-
Notifications
You must be signed in to change notification settings - Fork 380
Expand file tree
/
Copy pathmeson.build
More file actions
143 lines (118 loc) · 3.84 KB
/
Copy pathmeson.build
File metadata and controls
143 lines (118 loc) · 3.84 KB
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
132
133
134
135
136
137
138
139
140
141
142
143
project(
'dunst',
'c',
version: run_command('./get-version.sh', check: true).stdout(),
license: 'BSD',
meson_version: '>=0.60.0',
default_options: [
'c_std=gnu11',
'warning_level=1',
'b_ndebug=if-release',
],
)
cc = meson.get_compiler('c')
# Required dependencies
cairo = dependency('cairo')
glib = dependency('glib-2.0')
gio = dependency('gio-2.0')
gdk_pixbuf = dependency('gdk-pixbuf-2.0')
pangocairo = dependency('pangocairo')
realtime = cc.find_library('rt')
math = cc.find_library('m')
# Optional dependencies (X11)
x11 = dependency('x11', required: get_option('x11'))
xinerama = dependency('xinerama', required: get_option('x11'))
xext = dependency('xext', required: get_option('x11'))
xrandr = dependency('xrandr', required: get_option('x11'), version: '>=1.5')
xscrnsaver = dependency('xscrnsaver', required: get_option('x11'))
x11_support = x11.found() and xinerama.found() and xext.found() and xrandr.found() and xscrnsaver.found()
# Optional dependencies (Wayland)
wayland_client = dependency('wayland-client', required: get_option('wayland'))
wayland_protos = dependency('wayland-protocols', version: '>=1.12', required: get_option('wayland'))
wayland_cursor = dependency('wayland-cursor', required: get_option('wayland'))
wayland_support = wayland_client.found() and wayland_cursor.found() and wayland_protos.found()
# Soft dependency (systemd)
systemd = dependency('systemd', required: get_option('systemd'))
# Optional dependency (dunstify)
libnotify = dependency('libnotify', required: get_option('dunstify'))
dunst_depends = [
cairo,
glib,
gio,
gdk_pixbuf,
pangocairo,
systemd,
libnotify,
realtime,
math,
]
if not x11_support and not wayland_support
error('You have to compile at least one output (X11, Wayland)')
endif
if x11_support
dunst_depends += [x11, xinerama, xext, xrandr, xscrnsaver]
add_project_arguments('-DENABLE_X11', language: 'c')
endif
if wayland_support
dunst_depends += [wayland_client, wayland_cursor]
add_project_arguments('-DENABLE_WAYLAND', language: 'c')
if not x11_support
add_project_arguments('-DWAYLAND_ONLY', language: 'c')
endif
endif
c_version_arg = '-DVERSION="@0@"'.format(meson.project_version())
sysconfdir = get_option('sysconfdir') / 'xdg'
add_project_arguments(
'-DSYSCONFDIR="@0@"'.format(get_option('prefix') / sysconfdir),
language: 'c',
)
subdir('src')
install_data('dunstctl', install_dir: get_option('bindir'))
install_data('dunstrc', install_dir: sysconfdir / 'dunst')
conf_data = configuration_data()
conf_data.set('bindir', get_option('prefix') / get_option('bindir'))
conf_data.set('sysconfdir', get_option('prefix') / sysconfdir)
configure_file(
input: 'org.knopwob.dunst.service.in',
output: 'dunst.service',
configuration: conf_data,
install_dir: get_option('datadir') / 'dbus-1/services',
)
if systemd.found()
user_units_dir = systemd.get_variable(pkgconfig: 'systemduserunitdir')
configure_file(
configuration: conf_data,
input: 'dunst.systemd.service.in',
output: '@BASENAME@',
install_dir: user_units_dir,
)
endif
if libnotify.found()
executable(
'dunstify',
'dunstify.c',
dependencies: [glib, libnotify, gdk_pixbuf],
c_args: c_version_arg,
install: true,
)
endif
subdir('test')
pod2man = find_program('pod2man', native: true, required: get_option('docs'))
if pod2man.found()
subdir('docs')
endif
completions = get_option('completions')
if completions
subdir('completions')
endif
summary(
{
'X11 support': x11_support,
'Wayland support': wayland_support,
'Man pages': pod2man.found(),
'Dunstify': libnotify.found(),
'Install systemd service units': systemd.found(),
'Install shell completions': completions,
},
bool_yn: true,
)