diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2018-08-29 21:18:26 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-29 21:18:26 +0300 |
commit | b86f2fd17f1f0825e16b1df2b1f3f598c0d77b85 (patch) | |
tree | e005f958d9a87590fc0a05c88314ed0f160b10a6 /mesonbuild/scripts | |
parent | 28c1f31d7e2b46a8473d8ebe8f029fb7602fde09 (diff) | |
parent | 1ea743a0bfd5ab3ab74009fdd0fb2db64e8e79d8 (diff) | |
download | meson-b86f2fd17f1f0825e16b1df2b1f3f598c0d77b85.zip meson-b86f2fd17f1f0825e16b1df2b1f3f598c0d77b85.tar.gz meson-b86f2fd17f1f0825e16b1df2b1f3f598c0d77b85.tar.bz2 |
Merge pull request #4016 from thiblahute/hotdoc
modules: Add an 'hotdoc' module
Diffstat (limited to 'mesonbuild/scripts')
-rw-r--r-- | mesonbuild/scripts/hotdochelper.py | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/mesonbuild/scripts/hotdochelper.py b/mesonbuild/scripts/hotdochelper.py new file mode 100644 index 0000000..826745d --- /dev/null +++ b/mesonbuild/scripts/hotdochelper.py @@ -0,0 +1,36 @@ +import os +import shutil +import subprocess + +from . import destdir_join + +import argparse + +parser = argparse.ArgumentParser() +parser.add_argument('--install') +parser.add_argument('--extra-extension-path', action="append", default=[]) +parser.add_argument('--name') +parser.add_argument('--builddir') +parser.add_argument('--project-version') + + +def run(argv): + options, args = parser.parse_known_args(argv) + subenv = os.environ.copy() + + for ext_path in options.extra_extension_path: + subenv['PYTHONPATH'] = subenv.get('PYTHONPATH', '') + ':' + ext_path + + res = subprocess.call(args, cwd=options.builddir, env=subenv) + if res != 0: + exit(res) + + if options.install: + source_dir = os.path.join(options.builddir, options.install) + destdir = os.environ.get('DESTDIR', '') + installdir = destdir_join(destdir, + os.path.join(os.environ['MESON_INSTALL_PREFIX'], + 'share/doc/', options.name, "html")) + + shutil.rmtree(installdir, ignore_errors=True) + shutil.copytree(source_dir, installdir) |