2020-06-18 03:20:37 +03:00
docs_html_dir = docdir / 'html'
2020-06-18 03:28:33 +03:00
# xsltproc requires that the -o path ends with '/'
docs_builddir = meson . current_build_dir ( ) / ''
2020-06-18 03:20:37 +03:00
docs_assets = [
'android-chrome-192x192.png' ,
'android-chrome-256x256.png' ,
'apple-touch-icon.png' ,
'architecture.gif' ,
'browserconfig.xml' ,
'favicon.ico' ,
'favicon-16x16.png' ,
'favicon-32x32.png' ,
'generic.css' ,
'libvirt.css' ,
'libvirt-daemon-arch.png' ,
'libvirt-driver-arch.png' ,
'libvirt-object-model.png' ,
'libvirt-virConnect-example.png' ,
'main.css' ,
'manifest.json' ,
'migration-managed-direct.png' ,
'migration-managed-p2p.png' ,
'migration-native.png' ,
'migration-tunnel.png' ,
'migration-unmanaged-direct.png' ,
'mobile.css' ,
'mstile-150x150.png' ,
'node.gif' ,
]
2020-06-18 03:24:51 +03:00
docs_html_in_files = [
'404' ,
'architecture' ,
'auth' ,
'bugs' ,
'cgroups' ,
'compiling' ,
'contact' ,
'contribute' ,
'csharp' ,
'dbus' ,
'devguide' ,
'docs' ,
'downloads' ,
'drivers' ,
'drvbhyve' ,
'drvesx' ,
'drvhyperv' ,
'drvlxc' ,
'drvnodedev' ,
'drvopenvz' ,
'drvqemu' ,
'drvremote' ,
'drvsecret' ,
'drvtest' ,
'drvvbox' ,
'drvvirtuozzo' ,
'drvvmware' ,
'drvxen' ,
'errors' ,
'firewall' ,
'formatcaps' ,
'formatdomaincaps' ,
'format' ,
'formatnetwork' ,
'formatnetworkport' ,
'formatnode' ,
'formatnwfilter' ,
'formatsecret' ,
'formatsnapshot' ,
'formatstoragecaps' ,
'formatstorageencryption' ,
'formatstorage' ,
'goals' ,
'governance' ,
'hooks' ,
'index' ,
'internals' ,
'java' ,
'logging' ,
'migration' ,
'nss' ,
'pci-hotplug' ,
'php' ,
'python' ,
'remote' ,
'securityprocess' ,
'storage' ,
'strategy' ,
'support' ,
'testapi' ,
'testsuites' ,
'testtck' ,
'tlscerts' ,
'uri' ,
'virshcmdref' ,
'windows' ,
]
2020-06-18 03:25:19 +03:00
docs_rst_files = [
2021-03-12 13:12:47 +03:00
'aclpolkit' ,
2020-06-18 03:25:19 +03:00
'advanced-tests' ,
2021-03-12 13:30:33 +03:00
'api_extension' ,
2021-03-12 13:53:13 +03:00
'api' ,
2021-03-12 14:14:57 +03:00
'apps' ,
2021-03-12 14:04:40 +03:00
'auditlog' ,
2021-03-12 14:09:01 +03:00
'bindings' ,
2020-06-18 03:25:19 +03:00
'best-practices' ,
'ci' ,
'coding-style' ,
'committer-guidelines' ,
'daemons' ,
'developer-tooling' ,
'formatbackup' ,
'formatcheckpoint' ,
2020-07-10 18:09:35 +03:00
'formatdomain' ,
2020-09-24 15:22:17 +03:00
'glib-adoption' ,
2020-06-18 03:25:19 +03:00
'hacking' ,
'libvirt-go' ,
'libvirt-go-xml' ,
'newreposetup' ,
'pci-addresses' ,
'platforms' ,
'programming-languages' ,
'styleguide' ,
'submitting-patches' ,
]
2020-07-23 19:40:12 +03:00
# list of web targets to build for docs/web rule
install_web_deps = [ ]
install_web_files = [ ]
2020-06-18 03:20:37 +03:00
install_data ( docs_assets , install_dir : docs_html_dir )
2020-06-25 15:31:59 +03:00
2020-07-23 19:16:14 +03:00
aclperms_gen = custom_target (
'aclperms.htmlinc' ,
input : access_perm_h ,
output : 'aclperms.htmlinc' ,
command : [
2020-11-09 16:52:10 +03:00
meson_python_prog , python3_prog , genaclperms_prog , '@INPUT@' ,
2020-07-23 19:16:14 +03:00
] ,
capture : true ,
)
2020-06-29 23:14:13 +03:00
docs_timestamp = run_command (
python3_prog , meson_timestamp_prog . path ( ) , env : runutf8
) . stdout ( ) . strip ( )
2020-06-18 03:24:03 +03:00
site_xsl = files ( 'site.xsl' )
subsite_xsl = files ( 'subsite.xsl' )
page_xsl = files ( 'page.xsl' )
newapi_xsl = files ( 'newapi.xsl' )
2020-06-25 15:31:59 +03:00
docs_api_generated = custom_target (
'generate-api' ,
output : [
'libvirt-api.xml' ,
'libvirt-lxc-api.xml' ,
'libvirt-qemu-api.xml' ,
'libvirt-admin-api.xml' ,
] ,
command : [
2020-11-09 16:52:10 +03:00
meson_python_prog , python3_prog , apibuild_prog ,
2020-06-25 15:31:59 +03:00
meson . current_source_dir ( ) ,
meson . current_build_dir ( ) ,
] ,
install : true ,
install_dir : pkgdatadir / 'api' ,
depend_files : [
libvirt_common_h_in ,
libvirt_include ,
driver_sources ,
libvirt_qemu_sources ,
libvirt_lxc_sources ,
admin_sources ,
util_public_sources ,
] ,
)
docs_api_xml = docs_api_generated [ 0 ]
docs_lxc_api_xml = docs_api_generated [ 1 ]
docs_qemu_api_xml = docs_api_generated [ 2 ]
docs_admin_api_xml = docs_api_generated [ 3 ]
2020-06-18 03:23:00 +03:00
docs_rst2html_gen = generator (
rst2html_prog ,
output : '@BASENAME@.html.in' ,
2020-08-03 08:32:29 +03:00
arguments : [ '--stylesheet=' , '--strict' , '@INPUT@' ] ,
2020-06-18 03:23:00 +03:00
capture : true ,
)
2020-06-18 03:24:51 +03:00
2020-06-18 03:25:19 +03:00
2020-10-13 18:14:53 +03:00
# html_xslt_gen config
html_xslt_gen_xslt = site_xsl
html_xslt_gen_install_dir = docs_html_dir
html_xslt_gen = [ ]
# html_xslt_gen:
2020-06-18 03:25:19 +03:00
# each entry is a dictionary with following items:
2020-10-13 18:14:53 +03:00
# name - base file name (required), output file will become 'name.html'
# file - input file (optional, 'name.html.in' assumed if missing)
2020-08-03 17:38:31 +03:00
# source - source filename relative to repository root (optional, if there is no source)
2020-10-13 12:32:59 +03:00
# depends - explicit dependency on other input (optional)
2020-06-18 03:25:19 +03:00
2020-07-22 21:20:43 +03:00
foreach name : docs_html_in_files
2020-10-13 18:14:53 +03:00
html_xslt_gen + = {
2020-07-22 21:20:43 +03:00
'name' : name ,
2020-10-13 18:14:53 +03:00
'source' : 'docs' / name + '.html.in' ,
2020-07-22 21:20:43 +03:00
}
endforeach
2020-06-18 03:25:19 +03:00
foreach name : docs_rst_files
rst_file = '@0@.rst' . format ( name )
2020-10-13 18:14:53 +03:00
html_xslt_gen + = {
2020-06-18 03:25:19 +03:00
'name' : name ,
'file' : docs_rst2html_gen . process ( rst_file ) ,
2020-08-03 17:38:31 +03:00
'source' : 'docs' / rst_file ,
2020-06-18 03:25:19 +03:00
}
endforeach
2020-10-13 18:14:53 +03:00
html_xslt_gen + = {
'name' : 'acl' ,
2020-10-13 12:32:59 +03:00
'source' : 'docs' / 'acl.html.in' ,
'depends' : aclperms_gen ,
}
2020-06-25 15:32:40 +03:00
hvsupport_html_in = custom_target (
'hvsupport.html.in' ,
output : 'hvsupport.html.in' ,
command : [
meson_python_prog ,
2020-11-09 16:52:10 +03:00
python3_prog ,
hvsupport_prog ,
2020-06-25 15:32:40 +03:00
meson . source_root ( ) ,
meson . build_root ( ) ,
] ,
capture : true ,
depend_files : [
public_sym_file ,
libvirt_qemu_syms ,
libvirt_lxc_syms ,
driver_header ,
] ,
depends : [
docs_api_generated ,
] ,
)
2020-10-13 18:14:53 +03:00
html_xslt_gen + = {
2020-06-25 15:32:40 +03:00
'name' : 'hvsupport' ,
'file' : hvsupport_html_in ,
}
2020-06-25 15:32:55 +03:00
news_html_in = docs_rst2html_gen . process ( meson . source_root ( ) / 'NEWS.rst' )
2020-10-13 18:14:53 +03:00
html_xslt_gen + = {
2020-06-25 15:32:55 +03:00
'name' : 'news' ,
'file' : news_html_in ,
2020-07-22 21:20:43 +03:00
'source' : 'NEWS.rst' ,
2020-06-25 15:32:55 +03:00
}
2020-10-13 18:14:53 +03:00
# The following code between the markers must be kept identical with the other
# copies of the code in various subdirs, since meson doesn't support any kind
# of functions.
# --- begin of XSLT processing ---
2020-06-18 03:25:19 +03:00
2020-10-13 18:14:53 +03:00
foreach data : html_xslt_gen
html_filename = data [ 'name' ] + '.html'
html_file = custom_target (
html_filename ,
input : data . get ( 'file' , data [ 'name' ] + '.html.in' ) ,
output : html_filename ,
2020-06-18 03:25:19 +03:00
command : [
2020-10-12 17:13:08 +03:00
xsltproc_prog ,
'--stringparam' , 'pagesrc' , data . get ( 'source' , '' ) ,
'--stringparam' , 'builddir' , meson . build_root ( ) ,
'--stringparam' , 'timestamp' , docs_timestamp ,
'--nonet' ,
2020-10-13 18:14:53 +03:00
html_xslt_gen_xslt ,
2020-06-18 03:25:19 +03:00
'@INPUT@' ,
] ,
2020-10-13 12:32:59 +03:00
depends : data . get ( 'depends' , [ ] ) ,
2020-06-18 03:25:19 +03:00
depend_files : [ page_xsl ] ,
2020-10-12 17:13:08 +03:00
capture : true ,
2020-06-18 03:25:19 +03:00
install : true ,
2020-10-13 18:14:53 +03:00
install_dir : html_xslt_gen_install_dir ,
2020-06-18 03:25:19 +03:00
)
2020-07-23 19:40:12 +03:00
2020-10-13 18:14:53 +03:00
install_web_deps + = html_file
install_web_files + = html_file . full_path ( ) + ':' + html_xslt_gen_install_dir
2020-06-18 03:25:19 +03:00
endforeach
2020-06-18 03:27:09 +03:00
2020-10-13 18:14:53 +03:00
html_xslt_gen = [ ]
# --- end of XSLT processing ---
2020-06-18 03:27:48 +03:00
subdir ( 'fonts' )
2020-06-18 03:28:33 +03:00
subdir ( 'html' )
2020-06-18 03:29:29 +03:00
subdir ( 'internals' )
2020-06-18 03:30:14 +03:00
subdir ( 'js' )
2020-06-18 03:30:40 +03:00
subdir ( 'kbase' )
2020-06-18 03:31:31 +03:00
subdir ( 'logos' )
2020-06-25 15:33:22 +03:00
subdir ( 'manpages' )
2020-06-25 15:33:56 +03:00
subdir ( 'schemas' )
2020-06-18 03:27:48 +03:00
2020-06-18 03:27:09 +03:00
foreach file : docs_assets
2020-07-23 19:40:12 +03:00
# This hack enables us to view the web pages
# from within the uninstalled build tree
2020-06-18 03:27:09 +03:00
configure_file ( input : file , output : file , copy : true )
2020-07-23 19:40:12 +03:00
install_web_files + = '@0@:@1@' . format ( meson . current_source_dir ( ) / file , docs_html_dir )
2020-06-18 03:27:09 +03:00
endforeach
2020-07-23 19:40:12 +03:00
run_target (
'install-web' ,
command : [
meson_python_prog , python3_prog . path ( ) , meson_install_web_prog . path ( ) ,
install_web_files ,
] ,
depends : install_web_deps ,
)