@@ -13,24 +13,37 @@ project(
13
13
14
14
cc = meson .get_compiler(' c' )
15
15
16
+ # Required dependencies
16
17
cairo = dependency (' cairo' )
17
18
glib = dependency (' glib-2.0' )
18
19
gio = dependency (' gio-2.0' )
19
20
gdk_pixbuf = dependency (' gdk-pixbuf-2.0' )
20
21
pangocairo = dependency (' pangocairo' )
22
+ realtime = cc.find_library (' rt' )
23
+ math = cc.find_library (' m' )
24
+
25
+ # Optional dependencies (X11)
21
26
x11 = dependency (' x11' , required : get_option (' x11' ))
22
27
xinerama = dependency (' xinerama' , required : get_option (' x11' ))
23
28
xext = dependency (' xext' , required : get_option (' x11' ))
24
29
xrandr = dependency (' xrandr' , required : get_option (' x11' ), version : ' >=1.5' )
25
30
xscrnsaver = dependency (' xscrnsaver' , required : get_option (' x11' ))
26
- systemd = dependency ( ' systemd ' , required : get_option ( ' systemd ' ))
27
- libnotify = dependency ( ' libnotify ' , required : get_option ( ' dunstify ' ) )
28
- realtime = cc. find_library ( ' rt ' )
29
- math = cc. find_library ( ' m ' )
31
+
32
+ x11_support = x11.found() and xinerama.found() and xext.found() and xrandr.found() and xscrnsaver.found( )
33
+
34
+ # Optional dependencies (Wayland )
30
35
wayland_client = dependency (' wayland-client' , required : get_option (' wayland' ))
31
36
wayland_protos = dependency (' wayland-protocols' , version : ' >=1.12' , required : get_option (' wayland' ))
32
37
wayland_cursor = dependency (' wayland-cursor' , required : get_option (' wayland' ))
33
38
39
+ wayland_support = wayland_client.found() and wayland_cursor.found() and wayland_protos.found()
40
+
41
+ # Soft dependency (systemd)
42
+ systemd = dependency (' systemd' , required : get_option (' systemd' ))
43
+
44
+ # Optional dependency (dunstify)
45
+ libnotify = dependency (' libnotify' , required : get_option (' dunstify' ))
46
+
34
47
dunst_depends = [
35
48
cairo,
36
49
glib,
@@ -43,15 +56,8 @@ dunst_depends = [
43
56
math,
44
57
]
45
58
46
- x11_support = x11.found() and xinerama.found() and xext.found() and xrandr.found() and xscrnsaver.found()
47
- wayland_support = wayland_client.found() and wayland_cursor.found() and wayland_protos.found()
48
-
49
59
if not x11_support and not wayland_support
50
- error (' either wayland or x11 support is required' )
51
- endif
52
-
53
- if wayland_support and not x11_support
54
- add_project_arguments (' -DWAYLAND_ONLY' , language : ' c' )
60
+ error (' You have to compile at least one output (X11, Wayland)' )
55
61
endif
56
62
57
63
if x11_support
62
68
if wayland_support
63
69
dunst_depends += [wayland_client, wayland_cursor]
64
70
add_project_arguments (' -DENABLE_WAYLAND' , language : ' c' )
71
+
72
+ if not x11_support
73
+ add_project_arguments (' -DWAYLAND_ONLY' , language : ' c' )
74
+ endif
65
75
endif
66
76
67
77
c_version_arg = ' -DVERSION="@0@"' .format(meson .project_version())
@@ -78,8 +88,8 @@ install_data('dunstctl', install_dir: get_option('bindir'))
78
88
install_data (' dunstrc' , install_dir : sysconfdir / ' dunst' )
79
89
80
90
conf_data = configuration_data ()
81
- conf_data.set(' bindir' , get_option (' bindir' ))
82
- conf_data.set(' sysconfdir' , sysconfdir)
91
+ conf_data.set(' bindir' , get_option (' prefix ' ) / get_option ( ' bindir' ))
92
+ conf_data.set(' sysconfdir' , get_option ( ' prefix ' ) / sysconfdir)
83
93
84
94
configure_file (
85
95
input : ' org.knopwob.dunst.service.in' ,
0 commit comments