diff options
Diffstat (limited to 'gtkdochelper.py')
-rwxr-xr-x | gtkdochelper.py | 39 |
1 files changed, 23 insertions, 16 deletions
diff --git a/gtkdochelper.py b/gtkdochelper.py index c063bb6..c37e4d4 100755 --- a/gtkdochelper.py +++ b/gtkdochelper.py @@ -34,10 +34,10 @@ def build_gtkdoc(source_root, build_root, doc_subdir, src_subdir, abs_src = os.path.join(source_root, src_subdir) abs_out = os.path.join(build_root, doc_subdir) htmldir = os.path.join(abs_out, 'html') - subprocess.check_call(['gtkdoc-scan', - '--module=' + module, - '--source-dir=' + abs_src, - '--output-dir=.'] + scan_args, + scan_cmd = ['gtkdoc-scan', + '--module=' + module, + '--source-dir=' + abs_src] + scan_args + subprocess.check_call(scan_cmd, cwd=abs_out) if main_file.endswith('sgml'): modeflag = '--sgml-mode' @@ -51,26 +51,33 @@ def build_gtkdoc(source_root, build_root, doc_subdir, src_subdir, main_abs = os.path.join(source_root, doc_subdir, main_file) if len(main_file) > 0: # Yes, this is the flag even if the file is in xml. - mkdb_cmd.append('--main-sgml-file=' + main_abs) + mkdb_cmd.append('--main-sgml-file=' + main_file) +# print(mkdb_cmd) +# sys.exit(1) subprocess.check_call(mkdb_cmd, cwd=abs_out) shutil.rmtree(htmldir, ignore_errors=True) try: os.mkdir(htmldir) except Exception: pass - mkhtml_cmd = ['gtkdoc-mkhtml', module] + html_args + mkhtml_cmd = ['gtkdoc-mkhtml', + '--path=' + abs_src, + module, + ] + html_args if len(main_file) > 0: - # Workaround for - # https://bugzilla.gnome.org/show_bug.cgi?id=753145 - plainfile = os.path.split(main_abs)[1] - shutil.copy(main_abs, os.path.join(abs_out, plainfile)) - mkhtml_cmd.append('../' + plainfile) + mkhtml_cmd.append('../' + main_file) else: - mkhtml_cmd.append('../%s-docs.xml' % module) - subprocess.check_call(mkhtml_cmd, cwd=htmldir, shell=False) - subprocess.check_call(['gtkdoc-fixxref', - '--module=' + module, - '--module-dir=html'], cwd=abs_out) + mkhtml_cmd.append('%s-docs.xml' % module) + # html gen must be run in the HTML dir +# print(mkhtml_cmd) +# sys.exit(1) + subprocess.check_call(mkhtml_cmd, cwd=os.path.join(abs_out, 'html'), shell=False) + fixref_cmd = ['gtkdoc-fixxref', + '--module=' + module, + '--module-dir=html'] +# print(fixref_cmd) +# sys.exit(1) + subprocess.check_call(fixref_cmd, cwd=abs_out) def install_gtkdoc(build_root, doc_subdir, install_prefix, datadir, module): source = os.path.join(build_root, doc_subdir, 'html') |