diff --git a/docs/fonts/meson.build b/docs/fonts/meson.build index 8c0a2f1554..e4109c6e7d 100644 --- a/docs/fonts/meson.build +++ b/docs/fonts/meson.build @@ -15,8 +15,10 @@ fonts = [ install_data(fonts, install_dir: docs_html_dir / 'fonts') -# This hack enables us to view the web pages -# from within the uninstalled build tree foreach file : fonts + # This hack enables us to view the web pages + # from within the uninstalled build tree configure_file(input: file, output: file, copy: true) + + install_web_files += '@0@:@1@'.format(meson.current_source_dir() / file, docs_html_dir / 'fonts') endforeach diff --git a/docs/html/meson.build b/docs/html/meson.build index c87cc9f7ea..e194b5942c 100644 --- a/docs/html/meson.build +++ b/docs/html/meson.build @@ -7,6 +7,10 @@ apipng = [ install_data(apipng, install_dir: docs_html_dir / 'html') +foreach file : apipng + install_web_files += '@0@:@1@'.format(meson.current_source_dir() / file, docs_html_dir / 'html') +endforeach + docs_html_gen = [] docs_html_dep = [] @@ -80,8 +84,11 @@ endforeach docs_html_paths = [] +install_web_deps += docs_html_dep + foreach file : docs_html_gen docs_html_paths += file.full_path() + install_web_files += '@0@:@1@'.format(file.full_path(), docs_html_dir / 'html') endforeach test( diff --git a/docs/internals/meson.build b/docs/internals/meson.build index 2d6fa42ee9..169cc5d5f0 100644 --- a/docs/internals/meson.build +++ b/docs/internals/meson.build @@ -9,7 +9,7 @@ foreach name : internals_in_files html_in_file = '@0@.html.in'.format(name) html_file = '@0@.html'.format(name) - custom_target( + out_file = custom_target( html_file, input: html_in_file, output: html_file, @@ -31,4 +31,7 @@ foreach name : internals_in_files install: true, install_dir: docs_html_dir / 'internals', ) + + install_web_deps += out_file + install_web_files += '@0@:@1@'.format(out_file.full_path(), docs_html_dir / 'internals') endforeach diff --git a/docs/js/meson.build b/docs/js/meson.build index da90cbf96e..cbf2dc2633 100644 --- a/docs/js/meson.build +++ b/docs/js/meson.build @@ -4,8 +4,10 @@ docs_js_files = [ install_data(docs_js_files, install_dir: docs_html_dir / 'js') -# This hack enables us to view the web pages -# from within the uninstalled build tree foreach file : docs_js_files + # This hack enables us to view the web pages + # from within the uninstalled build tree configure_file(input: file, output: file, copy: true) + + install_web_files += '@0@:@1@'.format(meson.current_source_dir() / file, docs_html_dir / 'js') endforeach diff --git a/docs/kbase/meson.build b/docs/kbase/meson.build index 98b12e4c62..f72e426223 100644 --- a/docs/kbase/meson.build +++ b/docs/kbase/meson.build @@ -21,7 +21,7 @@ foreach name : docs_kbase_files html_in = docs_rst2html_gen.process(rst_file) - custom_target( + out_file = custom_target( html_file, input: html_in, output: html_file, @@ -43,4 +43,7 @@ foreach name : docs_kbase_files install: true, install_dir: docs_html_dir / 'kbase', ) + + install_web_deps += out_file + install_web_files += '@0@:@1@'.format(out_file.full_path(), docs_html_dir / 'kbase') endforeach diff --git a/docs/logos/meson.build b/docs/logos/meson.build index da92c397cd..70ba67d71c 100644 --- a/docs/logos/meson.build +++ b/docs/logos/meson.build @@ -22,8 +22,10 @@ docs_logo_files = [ install_data(docs_logo_files, install_dir: docs_html_dir / 'logos') -# This hack enables us to view the web pages -# from within the uninstalled build tree foreach file : docs_logo_files + # This hack enables us to view the web pages + # from within the uninstalled build tree configure_file(input: file, output: file, copy: true) + + install_web_files += '@0@:@1@'.format(meson.current_source_dir() / file, docs_html_dir / 'logos') endforeach diff --git a/docs/manpages/meson.build b/docs/manpages/meson.build index fb4e254a8f..e9d9ac8069 100644 --- a/docs/manpages/meson.build +++ b/docs/manpages/meson.build @@ -103,7 +103,7 @@ foreach data : docs_man_files capture: true, ) - custom_target( + out_file = custom_target( html_file, input: html_in, output: html_file, @@ -125,4 +125,7 @@ foreach data : docs_man_files install: true, install_dir: docs_html_dir / 'manpages', ) + + install_web_deps += out_file + install_web_files += '@0@:@1@'.format(out_file.full_path(), docs_html_dir / 'manpages') endforeach diff --git a/docs/meson.build b/docs/meson.build index 687305bd71..c2d7fd1bf4 100644 --- a/docs/meson.build +++ b/docs/meson.build @@ -129,6 +129,10 @@ docs_rst_files = [ 'submitting-patches', ] +# list of web targets to build for docs/web rule +install_web_deps = [] +install_web_files = [] + install_data(docs_assets, install_dir: docs_html_dir) aclperms_gen = custom_target( @@ -192,7 +196,7 @@ foreach name : docs_html_in_files html_in_file = '@0@.html.in'.format(name) html_file = '@0@.html'.format(name) - custom_target( + out_file = custom_target( html_file, input: html_in_file, output: html_file, @@ -214,6 +218,9 @@ foreach name : docs_html_in_files install: true, install_dir: docs_html_dir, ) + + install_web_deps += out_file + install_web_files += '@0@:@1@'.format(out_file.full_path(), docs_html_dir) endforeach @@ -267,7 +274,7 @@ foreach data : docs_html_in_gen html_file = '@0@.html'.format(data['name']) rst_in_file = '@0@.rst'.format(data['name']) - custom_target( + out_file = custom_target( html_file, input: data['file'], output: html_file, @@ -289,6 +296,9 @@ foreach data : docs_html_in_gen install: true, install_dir: docs_html_dir, ) + + install_web_deps += out_file + install_web_files += '@0@:@1@'.format(out_file.full_path(), docs_html_dir) endforeach subdir('fonts') @@ -301,8 +311,19 @@ subdir('manpages') subdir('schemas') -# This hack enables us to view the web pages -# from within the uninstalled build tree foreach file : docs_assets + # This hack enables us to view the web pages + # from within the uninstalled build tree configure_file(input: file, output: file, copy: true) + + install_web_files += '@0@:@1@'.format(meson.current_source_dir() / file, docs_html_dir) endforeach + +run_target( + 'install-web', + command: [ + meson_python_prog, python3_prog.path(), meson_install_web_prog.path(), + install_web_files, + ], + depends: install_web_deps, +) diff --git a/scripts/meson-install-web.py b/scripts/meson-install-web.py new file mode 100755 index 0000000000..a03f8523cd --- /dev/null +++ b/scripts/meson-install-web.py @@ -0,0 +1,10 @@ +#!/usr/bin/env python3 + +import os +import shutil +import sys + +for desc in sys.argv[1:]: + inst = desc.split(':') + os.makedirs(inst[1], exist_ok=True) + shutil.copy(inst[0], inst[1]) diff --git a/scripts/meson.build b/scripts/meson.build index 39b0e899f4..59b3c9bacd 100644 --- a/scripts/meson.build +++ b/scripts/meson.build @@ -25,6 +25,7 @@ scripts = [ 'meson-html-gen.py', 'meson-install-dirs.py', 'meson-install-symlink.py', + 'meson-install-web.py', 'meson-python.sh', 'meson-timestamp.py', 'mock-noinline.py',