From 095766ca1262a6c1d1a3cb0b6c319a7b711ef8fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Fri, 3 May 2019 22:37:47 +0200 Subject: [PATCH] meson: generate man pages --- doc/meson.build | 22 ++++++++++++++++++++++ meson.build | 3 +-- 2 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 doc/meson.build diff --git a/doc/meson.build b/doc/meson.build new file mode 100644 index 0000000..9db7c01 --- /dev/null +++ b/doc/meson.build @@ -0,0 +1,22 @@ +sh = find_program('sh', native: true) +scdoc = dependency('scdoc', native: true) +scdoc_prog = find_program(scdoc.get_pkgconfig_variable('scdoc'), native: true) +gzip = find_program('gzip', native: true) + +foreach man_src : ['f00bar.1.scd', 'f00bar.5.scd', 'f00bar-decorations.5.scd', + 'f00bar-modules.5.scd', 'f00bar-particles.5.scd', + 'f00bar-tags.5.scd'] + parts = man_src.split('.') + name = parts[-3] + section = parts[-2] + out = '@0@.@1@.gz'.format(name, section) + + custom_target( + out, + output: out, + input: man_src, + command: [sh, '-c', '@0@ < @INPUT@ | @1@ > doc/@2@'.format( + scdoc_prog.path(), gzip.path(), out)], + install: true, + install_dir: '@0@/man@1@'.format(get_option('mandir'), section)) +endforeach diff --git a/meson.build b/meson.build index efa3d7e..548c978 100644 --- a/meson.build +++ b/meson.build @@ -16,7 +16,6 @@ cairo = dependency('cairo') cairo_ft = dependency('cairo-ft') yaml = dependency('yaml-0.1') -# TODO: X11 xcb_aux = dependency('xcb-aux', required: get_option('backend-x11')) xcb_cursor = dependency('xcb-cursor', required: get_option('backend-x11')) xcb_event = dependency('xcb-event', required: get_option('backend-x11')) @@ -36,7 +35,6 @@ else enable_x11 = false endif -# TODO: conditional on Wayland wayland_client = dependency('wayland-client', required: get_option('backend-wayland')) wayland_cursor = dependency('wayland-cursor', required: get_option('backend-wayland')) wlroots = dependency('wlroots', required: get_option('backend-wayland')) @@ -58,6 +56,7 @@ if enable_x11 xcb_stuff = declare_dependency(link_with: xcb_stuff_lib) endif +subdir('doc') subdir('bar') subdir('decorations') subdir('particles')