| 1 |
doc_targets = [] |
| 2 |
tests = [] |
| 3 |
|
| 4 |
if host_machine.system() != 'windows' |
| 5 |
tests += [ |
| 6 |
'check-missing-doc.py', |
| 7 |
# 'check-whitespace-in-args' |
| 8 |
] |
| 9 |
meson.add_dist_script(find_program('check-whitespace-in-args.py'), '@SOURCE_ROOT@/doc') |
| 10 |
endif |
| 11 |
|
| 12 |
|
| 13 |
docbook2man = find_program('docbook2man', required: get_option('doc-man')) |
| 14 |
docbook2txt = find_program('docbook2txt', required: get_option('doc-txt')) |
| 15 |
docbook2pdf = find_program('docbook2pdf', required: get_option('doc-pdf')) |
| 16 |
docbook2html = find_program('docbook2html', required: get_option('doc-html')) |
| 17 |
|
| 18 |
# docbook is very spammy |
| 19 |
run_quiet = find_program('run-quiet.py') |
| 20 |
|
| 21 |
# .fncs files |
| 22 |
doc_funcs_fncs = [ |
| 23 |
'fcatomic', |
| 24 |
'fcblanks', |
| 25 |
'fccache', |
| 26 |
'fccharset', |
| 27 |
'fcconfig', |
| 28 |
'fcconstant', |
| 29 |
'fcdircache', |
| 30 |
'fcfile', |
| 31 |
'fcfontset', |
| 32 |
'fcfontations', |
| 33 |
'fcformat', |
| 34 |
'fcfreetype', |
| 35 |
'fcinit', |
| 36 |
'fclangset', |
| 37 |
'fcmatrix', |
| 38 |
'fcobjectset', |
| 39 |
'fcobjecttype', |
| 40 |
'fcpattern', |
| 41 |
'fcrange', |
| 42 |
'fcstring', |
| 43 |
'fcstrset', |
| 44 |
'fcvalue', |
| 45 |
'fcweight', |
| 46 |
] |
| 47 |
|
| 48 |
fncs_files = [] |
| 49 |
foreach f : doc_funcs_fncs |
| 50 |
fncs_files += files('@[email protected]'.format(f)) |
| 51 |
endforeach |
| 52 |
|
| 53 |
man_pages = [] |
| 54 |
|
| 55 |
extract_man_list = find_program('extract-man-list.py') |
| 56 |
man_list = run_command(extract_man_list, fncs_files, check: true).stdout().split() |
| 57 |
|
| 58 |
foreach m : man_list |
| 59 |
man_pages += ['@[email protected]'.format(m)] |
| 60 |
endforeach |
| 61 |
|
| 62 |
# Generate sgml pages for funcs |
| 63 |
edit_sgml = find_program('edit-sgml.py') |
| 64 |
|
| 65 |
# copy into build directory, it includes generated files from build directory |
| 66 |
fontconfig_devel_sgml = fs.copyfile('fontconfig-devel.sgml') |
| 67 |
fontconfig_user_sgml = fs.copyfile('fontconfig-user.sgml') |
| 68 |
|
| 69 |
cacheversion_conf = configuration_data() |
| 70 |
cacheversion_conf.set('CACHE_VERSION', cacheversion) |
| 71 |
configure_file(output: 'cache-version.sgml', |
| 72 |
input: 'cache-version.sgml.in', |
| 73 |
configuration: cacheversion_conf) |
| 74 |
|
| 75 |
version_conf = configuration_data() |
| 76 |
version_conf.set('VERSION', meson.project_version()) |
| 77 |
|
| 78 |
configure_file(output: 'version.sgml', |
| 79 |
input: 'version.sgml.in', |
| 80 |
configuration: version_conf) |
| 81 |
|
| 82 |
confdir_conf = configuration_data() |
| 83 |
confdir_conf.set('BASECONFIGDIR', fc_configdir) |
| 84 |
|
| 85 |
confdir_sgml = configure_file(output: 'confdir.sgml', |
| 86 |
input: 'confdir.sgml.in', |
| 87 |
configuration: confdir_conf) |
| 88 |
|
| 89 |
funcs_sgml = [] |
| 90 |
|
| 91 |
foreach f : doc_funcs_fncs |
| 92 |
funcs_sgml += [custom_target('@[email protected]'.format(f), |
| 93 |
input: [files('func.sgml'), files('@[email protected]'.format(f))], |
| 94 |
output: '@[email protected]'.format(f), |
| 95 |
command: [edit_sgml, '@INPUT0@', '@INPUT1@', '@OUTPUT@'], |
| 96 |
install: false)] |
| 97 |
endforeach |
| 98 |
|
| 99 |
if docbook2man.found() |
| 100 |
doc_targets += ['man'] |
| 101 |
|
| 102 |
custom_target('devel-man', |
| 103 |
input: [fontconfig_devel_sgml, funcs_sgml], |
| 104 |
output: man_pages, |
| 105 |
command: [run_quiet, docbook2man, '@INPUT0@', '--output', '@OUTDIR@'], |
| 106 |
build_by_default: true, |
| 107 |
install_dir: get_option('mandir') / 'man3', |
| 108 |
install: true, |
| 109 |
install_tag: 'docs') |
| 110 |
|
| 111 |
# fonts.conf(5) |
| 112 |
custom_target('fonts-conf-5-man-page', |
| 113 |
input: [fontconfig_user_sgml], |
| 114 |
output: 'fonts-conf.5', |
| 115 |
command: [run_quiet, docbook2man, '@INPUT0@', '--output', '@OUTDIR@'], |
| 116 |
install_dir: get_option('mandir') / 'man5', |
| 117 |
build_by_default: true, |
| 118 |
install: true, |
| 119 |
install_tag: 'docs') |
| 120 |
|
| 121 |
# Generate man pages for tools |
| 122 |
foreach t : tools_man_pages |
| 123 |
# docbook2man doesn't seem to have a --quiet option unfortunately |
| 124 |
custom_target('@0@-man-page'.format(t), |
| 125 |
input: '../@0@/@[email protected]'.format(t), |
| 126 |
output: '@[email protected]'.format(t), |
| 127 |
command: [run_quiet, docbook2man, '@INPUT@', '--output', '@OUTDIR@'], |
| 128 |
install_dir: get_option('mandir') / 'man1', |
| 129 |
install: true, |
| 130 |
install_tag: 'docs') |
| 131 |
endforeach |
| 132 |
endif |
| 133 |
|
| 134 |
if docbook2pdf.found() |
| 135 |
doc_targets += ['PDF'] |
| 136 |
|
| 137 |
custom_target('devel-pdf', |
| 138 |
input: [fontconfig_devel_sgml, funcs_sgml], |
| 139 |
output: 'fontconfig-devel.pdf', |
| 140 |
command: [run_quiet, docbook2pdf, '@INPUT0@', '--output', '@OUTDIR@'], |
| 141 |
build_by_default: true, |
| 142 |
install_dir: get_option('datadir') / 'doc' / 'fontconfig', |
| 143 |
install: true, |
| 144 |
install_tag: 'docs') |
| 145 |
|
| 146 |
custom_target('user-pdf', |
| 147 |
input: [fontconfig_user_sgml, funcs_sgml], |
| 148 |
output: 'fontconfig-user.pdf', |
| 149 |
command: [run_quiet, docbook2pdf, '@INPUT0@', '--output', '@OUTDIR@'], |
| 150 |
build_by_default: true, |
| 151 |
install_dir: get_option('datadir') / 'doc' / 'fontconfig', |
| 152 |
install: true, |
| 153 |
install_tag: 'docs') |
| 154 |
endif |
| 155 |
|
| 156 |
if docbook2txt.found() |
| 157 |
doc_targets += ['Text'] |
| 158 |
|
| 159 |
custom_target('devel-txt', |
| 160 |
input: [fontconfig_devel_sgml, funcs_sgml], |
| 161 |
output: 'fontconfig-devel.txt', |
| 162 |
command: [run_quiet, docbook2txt, '@INPUT0@', '--output', '@OUTDIR@'], |
| 163 |
build_by_default: true, |
| 164 |
install_dir: get_option('datadir') / 'doc' / 'fontconfig', |
| 165 |
install: true, |
| 166 |
install_tag: 'docs') |
| 167 |
|
| 168 |
custom_target('user-txt', |
| 169 |
input: [fontconfig_user_sgml, funcs_sgml], |
| 170 |
output: 'fontconfig-user.txt', |
| 171 |
command: [run_quiet, docbook2txt, '@INPUT0@', '--output', '@OUTDIR@'], |
| 172 |
build_by_default: true, |
| 173 |
install_dir: get_option('datadir') / 'doc' / 'fontconfig', |
| 174 |
install: true, |
| 175 |
install_tag: 'docs') |
| 176 |
endif |
| 177 |
|
| 178 |
if docbook2html.found() |
| 179 |
doc_targets += ['HTML'] |
| 180 |
|
| 181 |
custom_target('devel-html', |
| 182 |
input: [fontconfig_devel_sgml, funcs_sgml], |
| 183 |
output: 'fontconfig-devel.html', |
| 184 |
command: [run_quiet, docbook2html, '--nochunks', '@INPUT0@', '--output', '@OUTDIR@'], |
| 185 |
build_by_default: true, |
| 186 |
install_dir: get_option('datadir') / 'doc' / 'fontconfig', |
| 187 |
install: true, |
| 188 |
install_tag: 'docs') |
| 189 |
|
| 190 |
custom_target('user-html', |
| 191 |
input: [fontconfig_user_sgml, funcs_sgml], |
| 192 |
output: 'fontconfig-user.html', |
| 193 |
command: [run_quiet, docbook2html, '--nochunks', '@INPUT0@', '--output', '@OUTDIR@'], |
| 194 |
build_by_default: true, |
| 195 |
install_dir: get_option('datadir') / 'doc' / 'fontconfig', |
| 196 |
install: true, |
| 197 |
install_tag: 'docs') |
| 198 |
endif |
| 199 |
|
| 200 |
foreach script : tests |
| 201 |
py = find_program(script) |
| 202 |
test(script, py, args: [meson.project_source_root(), meson.project_build_root()]) |
| 203 |
endforeach |