- Revision
- 101814
- Author
- [email protected]
- Date
- 2011-12-02 09:44:05 -0800 (Fri, 02 Dec 2011)
Log Message
[GTK] Create a wrapper script that knows how to install jhbuild and run commands with it
https://bugs.webkit.org/show_bug.cgi?id=73669
Reviewed by Gustavo Noronha Silva.
Add a wrapper script that knows how to install jhbuild and also to wrap commands
in the jhbuild shell.
* Scripts/webkitdirs.pm:
(runAutogenForAutotoolsProject): Use the new wrapper script.
(mustReRunAutogen): Ditto.
(buildAutotoolsProject): Ditto.
* Scripts/webkitpy/layout_tests/port/gtk.py:
(GtkDriver.cmd_line): Ditto.
* gtk/run-with-jhbuild: Added.
Modified Paths
Added Paths
Diff
Modified: trunk/Tools/ChangeLog (101813 => 101814)
--- trunk/Tools/ChangeLog 2011-12-02 17:42:54 UTC (rev 101813)
+++ trunk/Tools/ChangeLog 2011-12-02 17:44:05 UTC (rev 101814)
@@ -1,3 +1,21 @@
+2011-12-02 Martin Robinson <[email protected]>
+
+ [GTK] Create a wrapper script that knows how to install jhbuild and run commands with it
+ https://bugs.webkit.org/show_bug.cgi?id=73669
+
+ Reviewed by Gustavo Noronha Silva.
+
+ Add a wrapper script that knows how to install jhbuild and also to wrap commands
+ in the jhbuild shell.
+
+ * Scripts/webkitdirs.pm:
+ (runAutogenForAutotoolsProject): Use the new wrapper script.
+ (mustReRunAutogen): Ditto.
+ (buildAutotoolsProject): Ditto.
+ * Scripts/webkitpy/layout_tests/port/gtk.py:
+ (GtkDriver.cmd_line): Ditto.
+ * gtk/run-with-jhbuild: Added.
+
2011-12-01 Adam Roben <[email protected]>
Teach check-webkit-style how to check the syntax of JSON files
Modified: trunk/Tools/Scripts/webkitdirs.pm (101813 => 101814)
--- trunk/Tools/Scripts/webkitdirs.pm 2011-12-02 17:42:54 UTC (rev 101813)
+++ trunk/Tools/Scripts/webkitdirs.pm 2011-12-02 17:44:05 UTC (rev 101814)
@@ -84,7 +84,6 @@
my $isQt;
my $qmakebin = "qmake"; # Allow override of the qmake binary from $PATH
my $isGtk;
-my @jhbuildArgs;
my $isWinCE;
my $isWinCairo;
my $isWx;
@@ -1610,8 +1609,7 @@
# Prefix the command with jhbuild run.
unshift(@buildArgs, "$relSourceDir/autogen.sh");
- unshift(@buildArgs, @jhbuildArgs);
-
+ unshift(@buildArgs, "$sourceDir/Tools/gtk/run-with-jhbuild");
if (system(@buildArgs) ne 0) {
die "Calling autogen.sh failed!\n";
}
@@ -1621,8 +1619,6 @@
{
my ($sourceDir, $filename, @currentArguments) = @_;
- @jhbuildArgs = ("jhbuild", "-f", "$sourceDir/Tools/gtk/jhbuildrc", "run");
-
if (! -e $filename) {
return 1;
}
@@ -1738,8 +1734,9 @@
runAutogenForAutotoolsProject($dir, $prefix, $sourceDir, $buildingWebKit, $autogenArgumentsFile, @buildArgs);
}
- my $jhbuild = join(' ', @jhbuildArgs);
- if (system("$jhbuild $make $makeArgs") ne 0) {
+ my $gtkScriptsPath = "$sourceDir/Tools/gtk";
+ my $runWithJhbuild = "$gtkScriptsPath/run-with-jhbuild";
+ if (system("$runWithJhbuild $make $makeArgs") ne 0) {
die "\nFailed to build WebKit using '$make'!\n";
}
@@ -1747,7 +1744,7 @@
if ($buildingWebKit) {
my $relativeScriptsPath = relativeScriptsDir();
- if (system("$jhbuild $relativeScriptsPath/../gtk/generate-gtkdoc --skip-html")) {
+ if (system("$runWithJhbuild $gtkScriptsPath/generate-gtkdoc --skip-html")) {
die "\n gtkdoc did not build without warnings\n";
}
}
Modified: trunk/Tools/Scripts/webkitpy/layout_tests/port/gtk.py (101813 => 101814)
--- trunk/Tools/Scripts/webkitpy/layout_tests/port/gtk.py 2011-12-02 17:42:54 UTC (rev 101813)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/port/gtk.py 2011-12-02 17:44:05 UTC (rev 101814)
@@ -69,8 +69,8 @@
self._xvfb_process = None
def cmd_line(self):
- config_path = self._port.path_from_webkit_base("Tools", "gtk", "jhbuildrc")
- return ["jhbuild", "-f", config_path, "run"] + WebKitDriver.cmd_line(self)
+ wrapper_path = self._port.path_from_webkit_base("Tools", "gtk", "run-with-jhbuild")
+ return [wrapper_path] + WebKitDriver.cmd_line(self)
class GtkPort(WebKitPort):
Added: trunk/Tools/gtk/run-with-jhbuild (0 => 101814)
--- trunk/Tools/gtk/run-with-jhbuild (rev 0)
+++ trunk/Tools/gtk/run-with-jhbuild 2011-12-02 17:44:05 UTC (rev 101814)
@@ -0,0 +1,63 @@
+#!/usr/bin/env python
+# Copyright (C) 2011 Igalia S.L.
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+import common
+import os
+import subprocess
+import sys
+
+def install_and_run_jhbuild():
+ installation_prefix = os.path.abspath(common.top_level_path('WebKitBuild', 'Dependencies', 'Root'))
+ source_path = os.path.abspath(common.top_level_path('WebKitBuild', 'Dependencies', 'Source'))
+ jhbuild_source_path = os.path.join(source_path, 'jhbuild')
+
+ if not os.path.exists(source_path):
+ os.makedirs(source_path)
+ if not os.path.exists(installation_prefix):
+ os.makedirs(installation_prefix)
+
+ if not os.path.exists(jhbuild_source_path):
+ process = subprocess.Popen(['git', 'clone', 'git://git.gnome.org/jhbuild'], cwd=source_path)
+ process.wait()
+ if process.returncode != 0:
+ raise Exception('jhbuild git clone failed with return code: %i' % process.returncode)
+
+ process = subprocess.Popen(['./autogen.sh', '--prefix=%s' % installation_prefix], cwd=jhbuild_source_path)
+ process.wait()
+ if process.returncode != 0:
+ raise Exception('jhbuild configure failed with return code: %i' % process.returncode)
+
+ process = subprocess.Popen(['make', 'install'], cwd=jhbuild_source_path)
+ process.wait()
+ if process.returncode != 0:
+ raise Exception('jhbuild configure failed with return code: %i' % process.returncode)
+
+ process = subprocess.Popen(common.top_level_path('Tools', 'Scripts', 'update-webkitgtk-libs'))
+ process.wait()
+ if process.returncode != 0:
+ raise Exception('jhbuild configure failed with return code: %i' % process.returncode)
+
+jhbuild_path = common.top_level_path('WebKitBuild', 'Dependencies', 'Root', 'bin', 'jhbuild')
+if not os.path.exists(jhbuild_path):
+ install_and_run_jhbuild()
+
+process = subprocess.Popen([jhbuild_path, '-f', common.top_level_path('Tools', 'gtk', 'jhbuildrc'), 'run'] + sys.argv[1:])
+process.wait()
+sys.exit(process.returncode)
+
+
+
Property changes on: trunk/Tools/gtk/run-with-jhbuild
___________________________________________________________________
Added: svn:executable