1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190
|
# Meson definition for AppStream Documentation
#
# Manual pages
#
# where we install all our documentation to
as_doc_target_dir = join_paths(get_option('datadir'), 'doc', 'appstream')
if get_option('man')
# make manual pages
manpages_xsl = 'http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl'
xsltproc = find_program('xsltproc')
if run_command([xsltproc, '--nonet', manpages_xsl],
check: false).returncode() != 0
error('Unable to find Docbook XSL stylesheets for man pages')
endif
custom_target('man-appstreamcli',
input: 'xml/man/appstreamcli.1.xml',
output: 'appstreamcli.1',
install: true,
install_dir: join_paths(get_option('mandir'), 'man1'),
command: [
xsltproc,
'--nonet',
'--stringparam', 'man.output.quietly', '1',
'--stringparam', 'funcsynopsis.style', 'ansi',
'--stringparam', 'man.th.extra1.suppress', '1',
'-o', '@OUTPUT@',
manpages_xsl,
'@INPUT@'
]
)
if get_option('compose')
custom_target('man-appstream-compose',
input: 'xml/man/appstreamcli-compose.1.xml',
output: 'appstreamcli-compose.1',
install: true,
install_dir: join_paths(get_option('mandir'), 'man1'),
command: [
xsltproc,
'--nonet',
'--stringparam', 'man.output.quietly', '1',
'--stringparam', 'funcsynopsis.style', 'ansi',
'--stringparam', 'man.th.extra1.suppress', '1',
'-o', '@OUTPUT@',
manpages_xsl,
'@INPUT@'
]
)
endif
endif # end of get_option('man') check
if get_option('docs') or get_option('apidocs')
# we need Python for the helper scripts if any doc generation is enabled at all
python_exe = find_program('python3', 'python')
if get_option('gir')
subdir('api/')
endif
endif
#
# Documentation
#
gen_doc_valsec_src = [
'gen-valtag-sections.c',
'../src/as-validator-issue-tag.h',
'../compose/asc-hint-tags.h',
'../compose/asc-hint-tags.c',
]
gen_doc_valsec_exe = executable('gen-validator-tag-sections',
[gen_doc_valsec_src],
dependencies: [appstream_dep,
gio_dep],
include_directories: [root_inc_dir,
include_directories ('../compose')],
c_args: ['-DASC_COMPILATION', '-Wno-inline'],
install: false,
)
as_doc_src = [
'xml/APIDoc.xml',
'xml/AppStream.xml',
'xml/Author_Group.xml',
'xml/Book_Info.xml',
'xml/CatalogData.xml',
'xml/catalog-iconcache.xml',
'xml/catalog-xmldata.xml',
'xml/catalog-yamldata.xml',
'xml/Legal_Notice.xml',
'xml/man/appstreamcli.1.xml',
'xml/Manpages.xml',
'xml/MetaInfo.xml',
'xml/metainfo-addon.xml',
'xml/metainfo-codec.xml',
'xml/metainfo-component.xml',
'xml/metainfo-consoleapp.xml',
'xml/metainfo-desktopapp.xml',
'xml/metainfo-driver.xml',
'xml/metainfo-firmware.xml',
'xml/metainfo-font.xml',
'xml/metainfo-icontheme.xml',
'xml/metainfo-inputmethod.xml',
'xml/metainfo-localization.xml',
'xml/metainfo-operatingsystem.xml',
'xml/metainfo-repository.xml',
'xml/metainfo-runtime.xml',
'xml/metainfo-service.xml',
'xml/metainfo-webapp.xml',
'xml/releases-data.xml',
'xml/Miscellaneous.xml',
'xml/misc-vercmp.xml',
'xml/misc-urihandler.xml',
'xml/Project_Desc.xml',
'xml/Quickstart.xml',
'xml/quickstart-addons.xml',
'xml/quickstart-desktopapps.xml',
'xml/quickstart-packaging.xml',
'xml/quickstart-translation.xml',
'xml/Validation.xml',
]
hljs_installed_file = '/usr/share/javascript/highlight.js/highlight.min.js'
if get_option('docs')
daps_exe = find_program('daps')
build_docs_cmd = [
python_exe,
join_paths(meson.current_source_dir(), 'doc-build-helper.py'),
'--build',
'--src', meson.current_source_dir(),
'--builddir', meson.current_build_dir(),
'--valsec-gen', gen_doc_valsec_exe.full_path(),
'AppStream'
]
make_docs_target = custom_target('make-docs',
input: ['DC-AppStream',
as_doc_src],
output: ['docs_built.stamp'],
depends: [gen_doc_valsec_exe],
build_by_default: true,
command: build_docs_cmd
)
# helper if you only and always want to rebuild the docs
run_target('documentation',
command: build_docs_cmd,
depends: [gen_doc_valsec_exe])
if get_option('install-docs')
install_subdir('html', install_dir: as_doc_target_dir)
if fs.is_file(hljs_installed_file)
install_symlink(
'highlight.min.js',
pointing_to: hljs_installed_file,
install_dir: join_paths(get_option('prefix'), as_doc_target_dir, 'html', 'static', 'js')
)
endif
endif
# add an extra testcase for documentation validation
test('as-validate_docs',
python_exe,
args: [join_paths(meson.current_source_dir(), 'doc-build-helper.py'),
'--validate',
'--src', meson.current_source_dir(),
'--valsec-gen', gen_doc_valsec_exe.full_path()],
timeout: 60
)
elif get_option('install-docs')
if fs.is_dir(join_paths(meson.current_source_dir(), 'html'))
# install documentation, if it exists
install_subdir('html', install_dir: as_doc_target_dir)
if fs.is_file(hljs_installed_file)
install_symlink(
'highlight.min.js',
pointing_to: hljs_installed_file,
install_dir: join_paths(get_option('prefix'), as_doc_target_dir, 'html', 'static', 'js')
)
endif
endif
endif # end of get_option('docs') check
|