Skip to content

Commit 669c586

Browse files
authored
Merge pull request #1475 from bynect/fix-version-meson
Fix meson configuration files
2 parents 92eb20d + 36d2d82 commit 669c586

File tree

5 files changed

+55
-18
lines changed

5 files changed

+55
-18
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 =

Makefile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,9 @@ docs/dunst.1: docs/dunst.1.pod
142142
docs/dunst.5: docs/dunst.5.pod
143143
${POD2MAN} --name=dunst -c "Dunst Reference" --section=5 --release=${VERSION} $< > $@
144144
docs/dunstctl.1: docs/dunstctl.pod
145-
${POD2MAN} --name=dunstctl -c "dunstctl reference" --section=1 --release=${VERSION} $< > $@
145+
${POD2MAN} --name=dunstctl -c "Dunstctl Reference" --section=1 --release=${VERSION} $< > $@
146146
docs/dunstify.1: docs/dunstify.pod
147-
${POD2MAN} --name=dunstify -c "dunstify reference" --section=1 --release=${VERSION} $< > $@
147+
${POD2MAN} --name=dunstify -c "Dunstify Reference" --section=1 --release=${VERSION} $< > $@
148148

149149
doc-doxygen:
150150
${DOXYGEN} docs/internal/Doxyfile
@@ -200,6 +200,7 @@ clean-dunstify:
200200

201201
clean-doc:
202202
rm -f docs/dunst.1
203+
rm -f docs/dunst.1.pod
203204
rm -f docs/dunst.5
204205
rm -f docs/dunstctl.1
205206
rm -f docs/dunstify.1

docs/meson.build

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,25 @@ custom_target(
4848
output: 'dunstctl.1',
4949
command: [
5050
pod2man,
51-
'--name=dunst',
52-
'--center=dunstctl Reference',
51+
'--name=dunstctl',
52+
'--center=Dunstctl Reference',
53+
'--section=1',
54+
pod2man_version_arg,
55+
'@INPUT@',
56+
'@OUTPUT@',
57+
],
58+
install: true,
59+
install_dir: man1,
60+
)
61+
62+
custom_target(
63+
'dunstify_pod2man',
64+
input: 'dunstify.pod',
65+
output: 'dunstify.1',
66+
command: [
67+
pod2man,
68+
'--name=dunstify',
69+
'--center=Dunstify Reference',
5370
'--section=1',
5471
pod2man_version_arg,
5572
'@INPUT@',

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',

src/dunst.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,14 +348,20 @@ void usage(int exit_status)
348348
void print_version(void)
349349
{
350350
printf("Dunst - A customizable and lightweight notification-daemon %s\n", VERSION);
351+
#ifdef _CCDATE
351352
printf("Compiled on %s with the following options:\n", STR_TO(_CCDATE));
353+
#endif
352354

353355
printf("X11 support: %s\n", X11_SUPPORT ? "enabled" : "disabled");
354356
printf("Wayland support: %s\n", WAYLAND_SUPPORT ? "enabled" : "disabled");
355357
printf("SYSCONFDIR set to: %s\n", SYSCONFDIR);
356358

359+
#ifdef _CFLAGS
357360
printf("Compiler flags: %s\n", STR_TO(_CFLAGS));
361+
#endif
362+
#ifdef _LDFLAGS
358363
printf("Linker flags: %s\n", STR_TO(_LDFLAGS));
364+
#endif
359365
exit(EXIT_SUCCESS);
360366
}
361367

0 commit comments

Comments
 (0)