1- # -*- mode: meson -*-
2-
31# This is lame, I know, but meson has no other include mechanism
42subdir (' rules' )
53
@@ -14,123 +12,122 @@ want_man = want_man != 'false' and xsltproc.found()
1412want_html = want_html != ' false' and xsltproc.found()
1513
1614xsltproc_flags = [
17- ' --nonet' ,
18- ' --xinclude' ,
19- ' --stringparam' , ' man.output.quietly' , ' 1' ,
20- ' --stringparam' , ' funcsynopsis.style' , ' ansi' ,
21- ' --stringparam' , ' man.authors.section.enabled' , ' 0' ,
22- ' --stringparam' , ' man.copyright.section.enabled' , ' 0' ,
23- ' --stringparam' , ' systemd.version' , ' @0@' .format(meson .project_version()),
24- ' --path' ,
25- ' @0@:@1@' .format(meson .current_build_dir(), meson .current_source_dir())]
15+ ' --nonet' ,
16+ ' --xinclude' ,
17+ ' --stringparam' , ' man.output.quietly' , ' 1' ,
18+ ' --stringparam' , ' funcsynopsis.style' , ' ansi' ,
19+ ' --stringparam' , ' man.authors.section.enabled' , ' 0' ,
20+ ' --stringparam' , ' man.copyright.section.enabled' , ' 0' ,
21+ ' --stringparam' , ' systemd.version' , ' @0@' .format(meson .project_version()),
22+ ' --path' ,
23+ ' @0@:@1@' .format(meson .current_build_dir(), meson .current_source_dir())]
2624
2725custom_man_xsl = files (' custom-man.xsl' )
2826custom_html_xsl = files (' custom-html.xsl' )
27+ xslt_cmd = [xsltproc, ' -o' , ' @OUTPUT0@' ] + xsltproc_flags
2928
3029custom_entities_ent = configure_file (
31- input : ' custom-entities.ent.in' ,
32- output : ' custom-entities.ent' ,
33- configuration : conf)
30+ input : ' custom-entities.ent.in' ,
31+ output : ' custom-entities.ent' ,
32+ configuration : conf)
3433
3534man_pages = []
3635html_pages = []
3736source_xml_files = []
3837foreach tuple : manpages
39- stem = tuple[0 ]
40- section = tuple[1 ]
41- aliases = tuple[2 ]
42- condition = tuple[3 ]
43-
44- xml = stem + ' .xml'
45- html = stem + ' .html'
46- man = stem + ' .' + section
47-
48- manaliases = []
49- htmlaliases = []
50- foreach alias : aliases
51- manaliases += [alias + ' .' + section]
52- htmlaliases += [alias + ' .html' ]
53- endforeach
54-
55- mandirn = join_paths (get_option (' mandir' ), ' man' + section)
56-
57- have = condition == '' or conf.get(condition, 0 ) == 1
58-
59- if have
60- p1 = custom_target (
61- man,
62- input : xml,
63- output : [man] + manaliases,
64- command : [xsltproc, ' -o' , ' @OUTPUT0@' ] + xsltproc_flags + [custom_man_xsl, ' @INPUT@' ],
65- depend_files : custom_entities_ent,
66- install : want_man,
67- install_dir : mandirn)
68- man_pages += [p1]
69-
70- p2 = custom_target (
71- html,
72- input : xml,
73- output : [html] + htmlaliases,
74- command : [xsltproc, ' -o' , ' @OUTPUT0@' ] + xsltproc_flags + [custom_html_xsl, ' @INPUT@' ],
75- depend_files : custom_entities_ent,
76- install : want_html,
77- install_dir : join_paths (docdir, ' html' ))
78- html_pages += [p2]
79-
80- source_xml_files += files (tuple[0 ] + ' .xml' )
81- else
82- message (' Skipping @0@.@1@ because @2@ is @3@' .format(stem, section, condition, have))
83- endif
38+ stem = tuple[0 ]
39+ section = tuple[1 ]
40+ aliases = tuple[2 ]
41+ condition = tuple[3 ]
42+
43+ xml = stem + ' .xml'
44+ html = stem + ' .html'
45+ man = stem + ' .' + section
46+
47+ manaliases = []
48+ htmlaliases = []
49+ foreach alias : aliases
50+ manaliases += [alias + ' .' + section]
51+ htmlaliases += [alias + ' .html' ]
52+ endforeach
53+
54+ mandirn = join_paths (get_option (' mandir' ), ' man' + section)
55+
56+ if condition == '' or conf.get(condition, 0 ) == 1
57+ p1 = custom_target (
58+ man,
59+ input : xml,
60+ output : [man] + manaliases,
61+ command : xslt_cmd + [custom_man_xsl, ' @INPUT@' ],
62+ depend_files : custom_entities_ent,
63+ install : want_man,
64+ install_dir : mandirn)
65+ man_pages += [p1]
66+
67+ p2 = custom_target (
68+ html,
69+ input : xml,
70+ output : [html] + htmlaliases,
71+ command : xslt_cmd + [custom_html_xsl, ' @INPUT@' ],
72+ depend_files : custom_entities_ent,
73+ install : want_html,
74+ install_dir : join_paths (docdir, ' html' ))
75+ html_pages += [p2]
76+
77+ source_xml_files += files (tuple[0 ] + ' .xml' )
78+ else
79+ message (' Skipping @0@.@1@ because @2@ is false' .format(stem, section, condition))
80+ endif
8481endforeach
8582
8683############################################################
8784
8885have_lxml = run_command (xml_helper_py).returncode() == 0
8986if not have_lxml
90- message (' python-lxml not available, not making man page indices' )
87+ message (' python-lxml not available, not making man page indices' )
9188endif
9289
9390systemd_directives_xml = custom_target (
94- ' systemd.directives.xml' ,
95- input : source_xml_files,
96- output : ' systemd.directives.xml' ,
97- command : [make_directive_index_py, ' @OUTPUT@' ] + source_xml_files)
91+ ' systemd.directives.xml' ,
92+ input : source_xml_files,
93+ output : ' systemd.directives.xml' ,
94+ command : [make_directive_index_py, ' @OUTPUT@' ] + source_xml_files)
9895
9996nonindex_xml_files = source_xml_files + [systemd_directives_xml]
10097systemd_index_xml = custom_target (
101- ' systemd.index.xml' ,
102- input : nonindex_xml_files,
103- output : ' systemd.index.xml' ,
104- command : [make_man_index_py, ' @OUTPUT@' ] + nonindex_xml_files)
98+ ' systemd.index.xml' ,
99+ input : nonindex_xml_files,
100+ output : ' systemd.index.xml' ,
101+ command : [make_man_index_py, ' @OUTPUT@' ] + nonindex_xml_files)
105102
106103foreach tuple : [[' systemd.directives' , ' 7' , systemd_directives_xml],
107104 [' systemd.index' , ' 7' , systemd_index_xml]]
108- stem = tuple[0 ]
109- section = tuple[1 ]
110- xml = tuple[2 ]
111-
112- html = stem + ' .html'
113- man = stem + ' .' + section
114-
115- mandirn = join_paths (get_option (' mandir' ), ' man' + section)
116-
117- p1 = custom_target (
118- man,
119- input : xml,
120- output : man,
121- command : [xsltproc, ' -o ' , ' @OUTPUT0@ ' ] + xsltproc_flags + [custom_man_xsl, ' @INPUT@' ],
122- install : want_man and have_lxml,
123- install_dir : mandirn)
124- man_pages += [p1]
125-
126- p2 = custom_target (
127- html,
128- input : xml,
129- output : html,
130- command : [xsltproc, ' -o ' , ' @OUTPUT0@ ' ] + xsltproc_flags + [custom_html_xsl, ' @INPUT@' ],
131- install : want_html and have_lxml,
132- install_dir : join_paths (docdir, ' html' ))
133- html_pages += [p2]
105+ stem = tuple[0 ]
106+ section = tuple[1 ]
107+ xml = tuple[2 ]
108+
109+ html = stem + ' .html'
110+ man = stem + ' .' + section
111+
112+ mandirn = join_paths (get_option (' mandir' ), ' man' + section)
113+
114+ p1 = custom_target (
115+ man,
116+ input : xml,
117+ output : man,
118+ command : xslt_cmd + [custom_man_xsl, ' @INPUT@' ],
119+ install : want_man and have_lxml,
120+ install_dir : mandirn)
121+ man_pages += [p1]
122+
123+ p2 = custom_target (
124+ html,
125+ input : xml,
126+ output : html,
127+ command : xslt_cmd + [custom_html_xsl, ' @INPUT@' ],
128+ install : want_html and have_lxml,
129+ install_dir : join_paths (docdir, ' html' ))
130+ html_pages += [p2]
134131endforeach
135132
136133man = custom_target (' man' ,
0 commit comments