summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--wscript30
1 files changed, 29 insertions, 1 deletions
diff --git a/wscript b/wscript
index 7396925..0abb4a4 100644
--- a/wscript
+++ b/wscript
@@ -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):