From 7800335d5269df34a7aad8a02fcf09df37207c87 Mon Sep 17 00:00:00 2001 From: Paul Brossier Date: Fri, 16 Sep 2016 18:33:17 +0200 Subject: [PATCH] wscript: build sphinx documentation if sphinx-build is found in PATH --- wscript | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/wscript b/wscript index c665ff5b..72abc0d2 100644 --- a/wscript +++ b/wscript @@ -326,6 +326,12 @@ def configure(ctx): except ctx.errors.ConfigurationError: ctx.to_log('doxygen was not found (ignoring)') + # check if sphinx-build is installed, optional + try: + ctx.find_program('sphinx-build', var='SPHINX') + except ctx.errors.ConfigurationError: + ctx.to_log('sphinx-build was not found (ignoring)') + def build(bld): bld.env['VERSION'] = VERSION bld.env['LIB_VERSION'] = LIB_VERSION @@ -367,6 +373,16 @@ def build(bld): cwd = bld.path.find_dir ('doc/web'), relative_trick = True) + # build documentation from source files using sphinx-build + if bld.env['SPHINX']: + bld( name = 'sphinx', rule = 'make html', + source = ['doc/conf.py'] + bld.path.ant_glob('doc/**.rst'), + cwd = 'doc') + bld.install_files( '${PREFIX}' + '/share/doc/libaubio-doc/sphinx', + bld.path.ant_glob('doc/_build/html/**'), + cwd = bld.path.find_dir ('doc/_build/html'), + relative_trick = True) + def shutdown(bld): from waflib import Logs if bld.options.target_platform in ['ios', 'iosimulator']: -- 2.11.0