diff options
Diffstat (limited to 'meson.build')
-rw-r--r-- | meson.build | 30 |
1 files changed, 14 insertions, 16 deletions
diff --git a/meson.build b/meson.build index f59d29b3..a1f406ec 100644 --- a/meson.build +++ b/meson.build | |||
@@ -40,7 +40,6 @@ libpam = cc.find_library('pam') | |||
40 | math = cc.find_library('m') | 40 | math = cc.find_library('m') |
41 | rt = cc.find_library('rt') | 41 | rt = cc.find_library('rt') |
42 | git = find_program('git', required: false) | 42 | git = find_program('git', required: false) |
43 | a2x = find_program('a2x', required: false) | ||
44 | 43 | ||
45 | conf_data = configuration_data() | 44 | conf_data = configuration_data() |
46 | 45 | ||
@@ -48,31 +47,30 @@ if gdk_pixbuf.found() | |||
48 | conf_data.set('HAVE_GDK_PIXBUF', true) | 47 | conf_data.set('HAVE_GDK_PIXBUF', true) |
49 | endif | 48 | endif |
50 | 49 | ||
51 | if a2x.found() | 50 | scdoc = find_program('scdoc', required: false) |
51 | |||
52 | if scdoc.found() | ||
53 | sh = find_program('sh') | ||
52 | mandir = get_option('mandir') | 54 | mandir = get_option('mandir') |
53 | man_files = [ | 55 | man_files = [ |
54 | 'sway/sway.1.txt', | 56 | 'sway/sway.1.scd', |
55 | 'sway/sway.5.txt', | 57 | 'sway/sway.5.scd', |
56 | 'sway/sway-bar.5.txt', | 58 | 'sway/sway-bar.5.scd', |
57 | 'sway/sway-input.5.txt', | 59 | 'sway/sway-input.5.scd', |
58 | 'sway/sway-security.7.txt', | 60 | 'swaylock/swaylock.1.scd', |
59 | 'swaymsg/swaymsg.1.txt', | 61 | 'swaymsg/swaymsg.1.scd', |
60 | ] | 62 | ] |
61 | foreach filename : man_files | 63 | foreach filename : man_files |
62 | topic = filename.split('.')[-3].split('/')[-1] | 64 | topic = filename.split('.')[-3].split('/')[-1] |
63 | section = filename.split('.')[-2] | 65 | section = filename.split('.')[-2] |
66 | output = '@0@.@1@'.format(topic, section) | ||
64 | 67 | ||
65 | custom_target( | 68 | custom_target( |
66 | 'man-@0@-@1@'.format(topic, section), | 69 | output, |
67 | input: filename, | 70 | input: filename, |
68 | output: '@BASENAME@', | 71 | output: output, |
69 | command: [ | 72 | command: [ |
70 | a2x, | 73 | sh, '-c', '@0@ < @INPUT@ > @1@'.format(scdoc.path(), output) |
71 | '--no-xmllint', | ||
72 | '--doctype', 'manpage', | ||
73 | '--format', 'manpage', | ||
74 | '--destination-dir', meson.current_build_dir(), | ||
75 | '@INPUT@' | ||
76 | ], | 74 | ], |
77 | install: true, | 75 | install: true, |
78 | install_dir: '@0@/man@1@'.format(mandir, section) | 76 | install_dir: '@0@/man@1@'.format(mandir, section) |