From 316a907b6cbf701a621851a0ee938833aa68b0c3 Mon Sep 17 00:00:00 2001 From: "kov@webkit.org" Date: Thu, 9 Feb 2012 02:28:31 +0000 Subject: [PATCH] [GTK] doc rebasing does not respect DESTDIR https://bugs.webkit.org/show_bug.cgi?id=78177 Reviewed by Martin Robinson. * GNUmakefile.am: Pass DESTDIR on to generate-gtkdoc, when calling it for rebasing. * gtk/generate-gtkdoc: (get_common_options): Handle the new --virtual-root option. * gtk/gtkdoc.py: (GTKDoc.rebase_installed_docs): If a virtual-root has been given, pass it on to gtkdoc-rebase as dest-dir, and prefix the htmldir with it. git-svn-id: http://svn.webkit.org/repository/webkit/trunk@107164 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- Tools/ChangeLog | 15 +++++++++++++++ Tools/GNUmakefile.am | 2 +- Tools/gtk/generate-gtkdoc | 9 +++++++++ Tools/gtk/gtkdoc.py | 9 ++++++++- 4 files changed, 33 insertions(+), 2 deletions(-) diff --git a/Tools/ChangeLog b/Tools/ChangeLog index 1456888..154c35b 100644 --- a/Tools/ChangeLog +++ b/Tools/ChangeLog @@ -1,3 +1,18 @@ +2012-02-08 Gustavo Noronha Silva + + [GTK] doc rebasing does not respect DESTDIR + https://bugs.webkit.org/show_bug.cgi?id=78177 + + Reviewed by Martin Robinson. + + * GNUmakefile.am: Pass DESTDIR on to generate-gtkdoc, when + calling it for rebasing. + * gtk/generate-gtkdoc: + (get_common_options): Handle the new --virtual-root option. + * gtk/gtkdoc.py: + (GTKDoc.rebase_installed_docs): If a virtual-root has been given, pass + it on to gtkdoc-rebase as dest-dir, and prefix the htmldir with it. + 2012-02-08 Adam Barth Remove Python 2.5 support from WebKit diff --git a/Tools/GNUmakefile.am b/Tools/GNUmakefile.am index 23d8112..fc8ed6b 100644 --- a/Tools/GNUmakefile.am +++ b/Tools/GNUmakefile.am @@ -326,7 +326,7 @@ if ENABLE_WEBKIT2 fi; \ fi endif - $(srcdir)/Tools/gtk/generate-gtkdoc --rebase + $(srcdir)/Tools/gtk/generate-gtkdoc --rebase --virtual-root=$${DESTDIR} uninstall-local: @DOC_MODULE_VERSION=`cat ./Documentation/webkitgtk/version.xml`; \ diff --git a/Tools/gtk/generate-gtkdoc b/Tools/gtk/generate-gtkdoc index 996b91a..04f0bda 100755 --- a/Tools/gtk/generate-gtkdoc +++ b/Tools/gtk/generate-gtkdoc @@ -50,10 +50,19 @@ def get_gtkdoc_module_paths(xref_dep_packages): def get_common_options(): + # TODO: We should consider using an arguments parsing library if + # we need more of these complex ones. + virtual_root = '' + for argument in sys.argv: + if argument.startswith('--virtual-root='): + virtual_root = argument.split('=')[1] + break + return { 'decorator': 'WEBKIT_API', 'deprecation_guard': 'WEBKIT_DISABLE_DEPRECATED', 'library_path' : common.build_path('.libs'), + 'virtual_root' : virtual_root, } def get_common_xref_deps(): diff --git a/Tools/gtk/gtkdoc.py b/Tools/gtk/gtkdoc.py index ffaa832..a2586ac 100644 --- a/Tools/gtk/gtkdoc.py +++ b/Tools/gtk/gtkdoc.py @@ -74,6 +74,11 @@ class GTKDoc(object): interactive -- Whether or not errors or warnings should prompt the user to continue or not. When this value is false, generation will continue despite warnings. (default False) + + virtual_root -- A temporary installation directory which is used as the root + where the actual installation prefix lives; this is mostly + useful for packagers, and should be set to what is given to + make install as DESTDIR. """ def __init__(self, args): @@ -356,13 +361,15 @@ class GTKDoc(object): self._run_command(args, cwd=self.output_dir, ignore_warnings=True) def rebase_installed_docs(self): - html_dir = os.path.join(self.prefix, 'share', 'gtk-doc', 'html', self.module_name) + html_dir = os.path.join(self.virtual_root + self.prefix, 'share', 'gtk-doc', 'html', self.module_name) if not os.path.isdir(html_dir): return args = ['gtkdoc-rebase', '--relative', '--html-dir=%s' % html_dir] args.extend(['--other-dir=%s' % extra_dir for extra_dir in self.cross_reference_deps]) + if self.virtual_root: + args.extend(['--dest-dir=%s' % self.virtual_root]) self._run_command(args, cwd=self.output_dir) -- 2.7.4