@@ -13,24 +13,37 @@ project(
1313
1414cc = meson .get_compiler(' c' )
1515
16+ # Required dependencies
1617cairo = dependency (' cairo' )
1718glib = dependency (' glib-2.0' )
1819gio = dependency (' gio-2.0' )
1920gdk_pixbuf = dependency (' gdk-pixbuf-2.0' )
2021pangocairo = dependency (' pangocairo' )
22+ realtime = cc.find_library (' rt' )
23+ math = cc.find_library (' m' )
24+
25+ # Optional dependencies (X11)
2126x11 = dependency (' x11' , required : get_option (' x11' ))
2227xinerama = dependency (' xinerama' , required : get_option (' x11' ))
2328xext = dependency (' xext' , required : get_option (' x11' ))
2429xrandr = dependency (' xrandr' , required : get_option (' x11' ), version : ' >=1.5' )
2530xscrnsaver = 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 )
3035wayland_client = dependency (' wayland-client' , required : get_option (' wayland' ))
3136wayland_protos = dependency (' wayland-protocols' , version : ' >=1.12' , required : get_option (' wayland' ))
3237wayland_cursor = dependency (' wayland-cursor' , required : get_option (' wayland' ))
3338
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+
3447dunst_depends = [
3548 cairo,
3649 glib,
@@ -43,15 +56,8 @@ dunst_depends = [
4356 math,
4457]
4558
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-
4959if 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)' )
5561endif
5662
5763if x11_support
6268if wayland_support
6369 dunst_depends += [wayland_client, wayland_cursor]
6470 add_project_arguments (' -DENABLE_WAYLAND' , language : ' c' )
71+
72+ if not x11_support
73+ add_project_arguments (' -DWAYLAND_ONLY' , language : ' c' )
74+ endif
6575endif
6676
6777c_version_arg = ' -DVERSION="@0@"' .format(meson .project_version())
@@ -78,8 +88,8 @@ install_data('dunstctl', install_dir: get_option('bindir'))
7888install_data (' dunstrc' , install_dir : sysconfdir / ' dunst' )
7989
8090conf_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)
8393
8494configure_file (
8595 input : ' org.knopwob.dunst.service.in' ,
0 commit comments