diff options
author | David Robillard <d@drobilla.net> | 2013-03-18 17:00:28 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2013-03-18 17:00:28 +0000 |
commit | ffc2213e30454e6d02cd9ff02f961fee05f60065 (patch) | |
tree | fb1b8839cf7477fe5563b3c4978d3123f97b61b6 | |
parent | 216f5b243ad18d5bce38ef406d44e0452f6dbed1 (diff) | |
download | ganv-ffc2213e30454e6d02cd9ff02f961fee05f60065.tar.gz ganv-ffc2213e30454e6d02cd9ff02f961fee05f60065.tar.bz2 ganv-ffc2213e30454e6d02cd9ff02f961fee05f60065.zip |
Generate documentation with g-ir-doc-tool.
git-svn-id: http://svn.drobilla.net/lad/trunk/ganv@5090 a436a847-0d15-0410-975c-d299462d15a1
-rw-r--r-- | wscript | 30 |
1 files changed, 29 insertions, 1 deletions
@@ -1,6 +1,7 @@ #!/usr/bin/env python import os import waflib.Options as Options +import waflib.Utils as Utils import waflib.extras.autowaf as autowaf # Library and package version (UNIX style major, minor, micro) @@ -46,6 +47,8 @@ def configure(conf): if Options.options.gir: autowaf.check_pkg(conf, 'gobject-introspection-1.0', uselib_store='GIR', mandatory=False) + conf.find_program('g-ir-doc-tool', var='G_IR_DOC_TOOL', mandatory=False) + conf.find_program('yelp-build', var='YELP_BUILD', mandatory=False) if not Options.options.no_graphviz: autowaf.check_pkg(conf, 'libgvc', uselib_store='AGRAPH', @@ -80,6 +83,12 @@ ganv_source = [ 'src/widget.c' ] +def declare_doc_files(task): + bld = task.generator.bld + path = bld.path.get_bld().find_or_declare('doc-html') + for i in path.ant_glob('*', remove=False): + i.sig = Utils.h_file(i.abspath()) + def build(bld): # Headers includedir = '${INCLUDEDIR}/ganv-%s/ganv' % GANV_MAJOR_VERSION @@ -138,7 +147,7 @@ def build(bld): target = 'src/ganv_test') # Documentation - autowaf.build_dox(bld, 'GANV', GANV_VERSION, top, out) + #autowaf.build_dox(bld, 'GANV', GANV_VERSION, top, out) if bld.is_defined('HAVE_GIR'): bld.add_group() @@ -170,6 +179,25 @@ def build(bld): install_path = '${LIBDIR}/girepository-1.0', rule = 'g-ir-compiler ${SRC} -o ${TGT}') + if bld.env.DOCS and bld.env['G_IR_DOC_TOOL'] and bld.env['YELP_BUILD']: + # The source and target files used here aren't exclusive, + # but are declared so waf can track dependencies + bld(rule = '${G_IR_DOC_TOOL} --language C -o doc-xml ${SRC}', + source = 'Ganv-1.0.gir', + target = 'doc-xml/index.page') + bld(name = 'yelp-build', + rule = '${YELP_BUILD} html -o doc-html doc-xml', + source = 'doc-xml/index.page', + target = 'doc-html/index.html') + bld(name = 'find-docs', + always = True, + rule = declare_doc_files, + after = 'yelp-build') + + bld.install_files( + os.path.join('${DOCDIR}', 'ganv-0', 'html'), + bld.path.get_bld().ant_glob('doc-html/*')) + bld.add_post_fun(autowaf.run_ldconfig) def test(ctx): |