aboutsummaryrefslogtreecommitdiffstats
path: root/meson.build
diff options
context:
space:
mode:
authorLibravatar Drew DeVault <sir@cmpwn.com>2018-05-11 08:39:46 -0400
committerLibravatar Drew DeVault <sir@cmpwn.com>2018-05-11 20:58:38 -0400
commitc2a7d367af8630fbc31b79146af76081c258c8ba (patch)
tree17c93e600a9f344d5256352c22010559d3085929 /meson.build
parentMerge pull request #1943 from RyanDwyer/criteria-improvements (diff)
downloadsway-c2a7d367af8630fbc31b79146af76081c258c8ba.tar.gz
sway-c2a7d367af8630fbc31b79146af76081c258c8ba.tar.zst
sway-c2a7d367af8630fbc31b79146af76081c258c8ba.zip
Wire up scdoc and rewrite sway(1)
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build25
1 files changed, 9 insertions, 16 deletions
diff --git a/meson.build b/meson.build
index f59d29b3..d1693ace 100644
--- a/meson.build
+++ b/meson.build
@@ -40,7 +40,6 @@ libpam = cc.find_library('pam')
40math = cc.find_library('m') 40math = cc.find_library('m')
41rt = cc.find_library('rt') 41rt = cc.find_library('rt')
42git = find_program('git', required: false) 42git = find_program('git', required: false)
43a2x = find_program('a2x', required: false)
44 43
45conf_data = configuration_data() 44conf_data = configuration_data()
46 45
@@ -48,31 +47,25 @@ if gdk_pixbuf.found()
48 conf_data.set('HAVE_GDK_PIXBUF', true) 47 conf_data.set('HAVE_GDK_PIXBUF', true)
49endif 48endif
50 49
51if a2x.found() 50scdoc = find_program('scdoc', required: false)
51
52if 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',
56 'sway/sway-bar.5.txt',
57 'sway/sway-input.5.txt',
58 'sway/sway-security.7.txt',
59 'swaymsg/swaymsg.1.txt',
60 ] 57 ]
61 foreach filename : man_files 58 foreach filename : man_files
62 topic = filename.split('.')[-3].split('/')[-1] 59 topic = filename.split('.')[-3].split('/')[-1]
63 section = filename.split('.')[-2] 60 section = filename.split('.')[-2]
61 output = '@0@.@1@'.format(topic, section)
64 62
65 custom_target( 63 custom_target(
66 'man-@0@-@1@'.format(topic, section), 64 output,
67 input: filename, 65 input: filename,
68 output: '@BASENAME@', 66 output: output,
69 command: [ 67 command: [
70 a2x, 68 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 ], 69 ],
77 install: true, 70 install: true,
78 install_dir: '@0@/man@1@'.format(mandir, section) 71 install_dir: '@0@/man@1@'.format(mandir, section)