Skip to content

Commit f9df4ff

Browse files
committed
Fix prefix problem in meson
See #1462 (comment)
1 parent 2892135 commit f9df4ff

File tree

2 files changed

+27
-14
lines changed

2 files changed

+27
-14
lines changed

.editorconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ indent_style = tab
4949
[test/functional-tests/dunstrc.vertical_align]
5050
indent_style =
5151

52+
[meson.build]
53+
indent_size = 4
54+
5255
# Contains external or generated files
5356
[src/wayland/protocols/**]
5457
indent_style =

meson.build

Lines changed: 24 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,24 +13,37 @@ project(
1313

1414
cc = meson.get_compiler('c')
1515

16+
# Required dependencies
1617
cairo = dependency('cairo')
1718
glib = dependency('glib-2.0')
1819
gio = dependency('gio-2.0')
1920
gdk_pixbuf = dependency('gdk-pixbuf-2.0')
2021
pangocairo = dependency('pangocairo')
22+
realtime = cc.find_library('rt')
23+
math = cc.find_library('m')
24+
25+
# Optional dependencies (X11)
2126
x11 = dependency('x11', required: get_option('x11'))
2227
xinerama = dependency('xinerama', required: get_option('x11'))
2328
xext = dependency('xext', required: get_option('x11'))
2429
xrandr = dependency('xrandr', required: get_option('x11'), version: '>=1.5')
2530
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)
3035
wayland_client = dependency('wayland-client', required: get_option('wayland'))
3136
wayland_protos = dependency('wayland-protocols', version: '>=1.12', required: get_option('wayland'))
3237
wayland_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+
3447
dunst_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-
4959
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)')
5561
endif
5662

5763
if x11_support
@@ -62,6 +68,10 @@ endif
6268
if 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
6575
endif
6676

6777
c_version_arg = '-DVERSION="@0@"'.format(meson.project_version())
@@ -78,8 +88,8 @@ install_data('dunstctl', install_dir: get_option('bindir'))
7888
install_data('dunstrc', install_dir: sysconfdir / 'dunst')
7989

8090
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)
8393

8494
configure_file(
8595
input: 'org.knopwob.dunst.service.in',

0 commit comments

Comments
 (0)