[GTK] Allow to run any jhbuild command with jhbuild-wrapper script
[WebKit-https.git] / Tools / gtk / run-with-jhbuild
index bf0fb80..9ff0034 100755 (executable)
@@ -1,5 +1,7 @@
 #!/usr/bin/env python
 # Copyright (C) 2011 Igalia S.L.
+# Copyright (C) 2012 Gustavo Noronha Silva <gns@gnome.org>
+# Copyright (C) 2012 Intel Corporation
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
 # 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:])
+jhbuild_wrapper = common.top_level_path('Tools', 'jhbuild', 'jhbuild-wrapper')
+process = subprocess.Popen([jhbuild_wrapper, '--gtk', 'run'] + sys.argv[1:])
 process.wait()
 sys.exit(process.returncode)
-
-
-