-
Notifications
You must be signed in to change notification settings - Fork 361
initial meson move #1226
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
initial meson move #1226
Changes from all commits
566a453
87e9ea0
8d2053a
c6d8479
b9ba39c
60e8aed
655845f
88a4414
97b5e77
754dca3
d2bd7b6
bb21c8c
e972d6f
767c892
ddc0659
ac91611
93e0038
9d33d4f
62c70bb
4add2a9
61f3e86
71cb3ac
ee5b45b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,7 @@ core | |
vgcore.* | ||
|
||
/docs/*.1 | ||
/docs/dunst.1.pod | ||
/docs/*.5 | ||
/docs/internal/coverage | ||
/docs/internal/html | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
man1 = get_option('mandir') / 'man1' | ||
man5 = get_option('mandir') / 'man5' | ||
pod2man_version_arg = '--release=@0@'.format(meson.project_version()) | ||
|
||
dunst1 = configure_file( | ||
input: 'dunst.1.pod.in', | ||
output: 'dunst.1.pod', | ||
configuration: conf_data, | ||
) | ||
|
||
custom_target( | ||
'dunst1_pod2man', | ||
input: dunst1, | ||
output: 'dunst.1', | ||
command: [ | ||
pod2man, | ||
'--name=dunst', | ||
'--center=Dunst Reference', | ||
'--section=1', | ||
pod2man_version_arg, | ||
'@INPUT@', | ||
'@OUTPUT@', | ||
], | ||
install: true, | ||
install_dir: man1, | ||
) | ||
|
||
custom_target( | ||
'dunst5_pod2man', | ||
input: 'dunst.5.pod', | ||
output: 'dunst.5', | ||
command: [ | ||
pod2man, | ||
'--name=dunst', | ||
'--center=Dunst Reference', | ||
'--section=5', | ||
pod2man_version_arg, | ||
'@INPUT@', | ||
'@OUTPUT@', | ||
], | ||
install: true, | ||
install_dir: man5, | ||
) | ||
|
||
custom_target( | ||
'dunstctl_pod2man', | ||
input: 'dunstctl.pod', | ||
output: 'dunstctl.1', | ||
command: [ | ||
pod2man, | ||
'--name=dunst', | ||
'--center=dunstctl Reference', | ||
'--section=1', | ||
pod2man_version_arg, | ||
'@INPUT@', | ||
'@OUTPUT@', | ||
], | ||
install: true, | ||
install_dir: man1, | ||
) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,126 @@ | ||
project( | ||
'dunst', | ||
'c', | ||
version: '1.9.2', | ||
license: 'MIT', | ||
meson_version: '>=0.60.0', | ||
default_options: [ | ||
'c_std=gnu11', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. gnu99 seems to be enough. |
||
'warning_level=1', | ||
'b_ndebug=if-release', | ||
], | ||
) | ||
|
||
cc = meson.get_compiler('c') | ||
|
||
cairo = dependency('cairo') | ||
glib = dependency('glib-2.0') | ||
gio = dependency('gio-2.0') | ||
gdk_pixbuf = dependency('gdk-pixbuf-2.0') | ||
pangocairo = dependency('pangocairo') | ||
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')) | ||
systemd = dependency('systemd', required: get_option('systemd')) | ||
zappolowski marked this conversation as resolved.
Show resolved
Hide resolved
|
||
libnotify = dependency('libnotify', required: get_option('dunstify')) | ||
realtime = cc.find_library('rt') | ||
math = cc.find_library('m') | ||
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')) | ||
|
||
dunst_depends = [ | ||
cairo, | ||
glib, | ||
gio, | ||
gdk_pixbuf, | ||
pangocairo, | ||
systemd, | ||
libnotify, | ||
realtime, | ||
math, | ||
] | ||
|
||
x11_support = x11.found() and xinerama.found() and xext.found() and xrandr.found() and xscrnsaver.found() | ||
wayland_support = wayland_client.found() and wayland_cursor.found() and wayland_protos.found() | ||
|
||
if not x11_support and not wayland_support | ||
error('either wayland or x11 support is required') | ||
endif | ||
|
||
if wayland_support and not x11_support | ||
add_project_arguments('-DWAYLAND_ONLY', language: 'c') | ||
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') | ||
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', | ||
) | ||
Comment on lines
+70
to
+73
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We can see for example this was already done here. |
||
|
||
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('bindir')) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ... but forgotten here. |
||
conf_data.set('sysconfdir', 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], | ||
install: true, | ||
) | ||
endif | ||
|
||
subdir('test') | ||
|
||
pod2man = find_program('pod2man', native: true, required: get_option('docs')) | ||
if pod2man.found() | ||
subdir('docs') | ||
endif | ||
|
||
summary( | ||
{ | ||
'X11 support': x11_support, | ||
'Wayland support': wayland_support, | ||
'Man pages': pod2man.found(), | ||
'Dunstify': libnotify.found(), | ||
'Install systemd service units': systemd.found(), | ||
}, | ||
bool_yn: true, | ||
) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
option('docs', type: 'feature', value: 'auto', description: 'Generate and install man pages') | ||
option('wayland', type: 'feature', value: 'auto', description: 'Enable wayland support') | ||
option('x11', type: 'feature', value: 'auto', description: 'Enable X11 support') | ||
option('dunstify', type: 'feature', value: 'auto', description: 'Install libnotify dunstify utility') | ||
option('systemd', type: 'feature', value: 'auto', description: 'Install systemd user service unit') |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
[D-BUS Service] | ||
Name=org.freedesktop.Notifications | ||
Exec=##PREFIX##/bin/dunst | ||
Exec=@bindir@/dunst | ||
SystemdService=dunst.service |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
dunst_src_files = files( | ||
'dbus.c', | ||
'draw.c', | ||
'dunst.c', | ||
'icon-lookup.c', | ||
'icon.c', | ||
'ini.c', | ||
'input.c', | ||
'log.c', | ||
'markup.c', | ||
'menu.c', | ||
'notification.c', | ||
'option_parser.c', | ||
'output.c', | ||
'queues.c', | ||
'rules.c', | ||
'settings.c', | ||
'utils.c', | ||
) | ||
|
||
if x11_support | ||
dunst_src_files += files( | ||
'x11/screen.c', | ||
'x11/x.c', | ||
) | ||
endif | ||
|
||
if wayland_support | ||
subdir('wayland/protocols') | ||
|
||
dunst_src_files += files( | ||
'wayland/foreign_toplevel.c', | ||
'wayland/libgwater-wayland.c', | ||
'wayland/pool-buffer.c', | ||
'wayland/wl.c', | ||
'wayland/wl_output.c', | ||
'wayland/wl_seat.c', | ||
) | ||
endif | ||
|
||
executable( | ||
'dunst', | ||
'../main.c', | ||
dunst_src_files, | ||
dependencies: dunst_depends, | ||
c_args: c_version_arg, | ||
install: true, | ||
) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
wl_protocol_dir = wayland_protos.get_variable(pkgconfig: 'pkgdatadir') | ||
|
||
wayland_scanner = dependency('wayland-scanner', version: '>=1.14.91', native: true) | ||
wayland_scanner_path = wayland_scanner.get_variable(pkgconfig: 'wayland_scanner') | ||
wayland_scanner_prog = find_program(wayland_scanner_path, native: true) | ||
|
||
wayland_scanner_code = generator( | ||
wayland_scanner_prog, | ||
output: '@[email protected]', | ||
arguments: ['private-code', '@INPUT@', '@OUTPUT@'], | ||
) | ||
|
||
wayland_scanner_client = generator( | ||
wayland_scanner_prog, | ||
output: '@[email protected]', | ||
arguments: ['client-header', '@INPUT@', '@OUTPUT@'], | ||
) | ||
|
||
client_protocols = [ | ||
wl_protocol_dir / 'stable/xdg-shell/xdg-shell.xml', | ||
'wlr-layer-shell-unstable-v1.xml', | ||
'idle.xml', | ||
'wlr-foreign-toplevel-management-unstable-v1.xml', | ||
] | ||
|
||
foreach p : client_protocols | ||
wayland_scanner_code.process(p) | ||
wayland_scanner_client.process(p) | ||
endforeach |
Uh oh!
There was an error while loading. Please reload this page.