On Thu, Jul 16, 2020 at 11:59:31 +0200, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina(a)redhat.com>
---
[...]
+foreach name : keyname_list
+ rst_file = custom_target(
+ 'virkeyname-@0@.rst'.format(name),
+ input: keymap_src_file,
+ output: 'virkeyname-@0@.rst'.format(name),
+ command: [
+ meson_python_prog, python3_prog, keymap_gen_prog, 'name-docs',
+ '--lang', 'rst',
+ '--title', 'virkeyname-@0(a)'.format(name),
+ '--subtitle', 'Key name values for @0(a)'.format(name),
+ '@INPUT@', name,
+ ],
+ capture: true,
+ build_by_default: true,
+ )
+
+ docs_man_files += {
+ 'name': 'virkeyname-@0(a)'.format(name), 'section':
'7', 'install': true, 'file': rst_file,
+ }
+endforeach
+
+docs_man_conf = configuration_data()
+docs_man_conf.set('SYSCONFDIR', sysconfdir)
+docs_man_conf.set('RUNSTATEDIR', runstatedir)
+
+foreach data : docs_man_files
+ rst_in_file = '@0@.rst.in'.format(data['name'])
+ html_in_file = '@0@.html.in'.format(data['name'])
+ html_file = '@0@.html'.format(data['name'])
+
+ if data.has_key('file')
+ rst_file = data['file']
+ else
+ rst_file = configure_file(
+ input: rst_in_file,
+ output: '@0@.rst'.format(data['name']),
+ configuration: docs_man_conf,
+ )
+ endif
I must say it feels weird process these through configure_file. Also
it's super weird that they've overloaded 3 modes into configure_file.
What's the difference to generator() by the way, since we use it for
rst->html conversion? I'd expect that we could use configure_file there
or generator here then.
Also is there a possibility where the input and output file will have
the same name? I'm not very fond of the .rst.in files.