[jhbuild] Make it possible to build GTK/EFL in same repository
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 4 Nov 2014 19:05:42 +0000 (19:05 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 4 Nov 2014 19:05:42 +0000 (19:05 +0000)
https://bugs.webkit.org/show_bug.cgi?id=137448

Patch by Tibor Meszaros <tmeszaros.u-szeged@partner.samsung.com> on 2014-11-04
Reviewed by Martin Robinson.

* Scripts/webkitdirs.pm:
(getJhbuildPath):
* WebKitTestRunner/InjectedBundle/efl/FontManagement.cpp:
(getPlatformFontsPath):
* WebKitTestRunner/InjectedBundle/gtk/ActivateFontsGtk.cpp:
(WTR::getFontsPath):
* jhbuild/jhbuild-wrapper:
(determine_platform):
(install_jhbuild):
* jhbuild/jhbuildrc_common.py:
(init):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@175555 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Tools/ChangeLog
Tools/Scripts/webkitdirs.pm
Tools/WebKitTestRunner/InjectedBundle/efl/FontManagement.cpp
Tools/WebKitTestRunner/InjectedBundle/gtk/ActivateFontsGtk.cpp
Tools/jhbuild/jhbuild-wrapper
Tools/jhbuild/jhbuildrc_common.py

index fa19d72..16d9803 100644 (file)
@@ -1,3 +1,22 @@
+2014-11-04  Tibor Meszaros  <tmeszaros.u-szeged@partner.samsung.com>
+
+        [jhbuild] Make it possible to build GTK/EFL in same repository
+        https://bugs.webkit.org/show_bug.cgi?id=137448
+
+        Reviewed by Martin Robinson.
+
+        * Scripts/webkitdirs.pm:
+        (getJhbuildPath):
+        * WebKitTestRunner/InjectedBundle/efl/FontManagement.cpp:
+        (getPlatformFontsPath):
+        * WebKitTestRunner/InjectedBundle/gtk/ActivateFontsGtk.cpp:
+        (WTR::getFontsPath):
+        * jhbuild/jhbuild-wrapper:
+        (determine_platform):
+        (install_jhbuild):
+        * jhbuild/jhbuildrc_common.py:
+        (init):
+
 2014-11-04  Dániel Bátyai  <dbatyai.u-szeged@partner.samsung.com>
 
         [EFL] Bump LLVM to version 3.5.0
index 8b06b12..55a8250 100755 (executable)
@@ -1636,7 +1636,13 @@ sub getJhbuildPath()
     if (isGit() && isGitBranchBuild() && gitBranch()) {
         pop(@jhbuildPath);
     }
-    push(@jhbuildPath, "Dependencies");
+    if (isEfl()) {
+        push(@jhbuildPath, "DependenciesEFL");
+    } elsif (isGtk()) {
+        push(@jhbuildPath, "DependenciesGTK");
+    } else {
+        die "Cannot get JHBuild path for platform that isn't GTK+ or EFL.\n";
+    }
     return File::Spec->catdir(@jhbuildPath);
 }
 
index eee26d1..3ff3f08 100644 (file)
@@ -102,7 +102,7 @@ static CString getPlatformFontsPath()
 {
     CString customBuildDir = getCustomBuildDir();
     if (!customBuildDir.isNull()) {
-        CString fontsPath = buildPath(customBuildDir.data(), "Dependencies", "Root", "webkitgtk-test-fonts", 0);
+        CString fontsPath = buildPath(customBuildDir.data(), "DependenciesEFL", "Root", "webkitgtk-test-fonts", 0);
         if (!ecore_file_exists(fontsPath.data()))
             fprintf(stderr, "WEBKIT_OUTPUTDIR set to '%s', but could not local test fonts.\n", customBuildDir.data());
         return fontsPath;
index fd8dec2..74f3ab0 100644 (file)
@@ -68,7 +68,7 @@ CString getOutputDir()
 static CString getFontsPath()
 {
     CString webkitOutputDir = getOutputDir();
-    GUniquePtr<char> fontsPath(g_build_filename(webkitOutputDir.data(), "Dependencies", "Root", "webkitgtk-test-fonts", nullptr));
+    GUniquePtr<char> fontsPath(g_build_filename(webkitOutputDir.data(), "DependenciesGTK", "Root", "webkitgtk-test-fonts", nullptr));
     if (g_file_test(fontsPath.get(), static_cast<GFileTest>(G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR)))
         return fontsPath.get();
 
index bf227df..45222af 100755 (executable)
@@ -26,9 +26,21 @@ import sys
 
 jhbuild_revision = 'c0cb46177d79189ffe0f760703c732f1c7ea8b29'
 
+def determine_platform():
+    if '--efl' in sys.argv:
+        return "efl";
+    if '--gtk' in sys.argv:
+        return "gtk";
+    raise ValueError('No platform specified for jhbuild-wrapper.')
+
+try:
+    platform = determine_platform()
+except ValueError as e:
+    sys.exit(e)
+
 dependencies_path = jhbuildutils.get_dependencies_path()
-installation_prefix = os.path.abspath(os.path.join(dependencies_path, 'Root'))
-source_path = os.path.abspath(os.path.join(dependencies_path, 'Source'))
+installation_prefix = os.path.abspath(os.path.join(dependencies_path + platform.upper(), 'Root'))
+source_path = os.path.abspath(os.path.join(dependencies_path + platform.upper(), 'Source'))
 jhbuild_source_path = os.path.join(source_path, 'jhbuild')
 jhbuild_path = os.path.join(installation_prefix, 'bin', 'jhbuild')
 
@@ -92,15 +104,6 @@ def install_jhbuild():
     if process.returncode != 0:
         raise Exception('jhbuild configure failed with return code: %i' % process.returncode)
 
-
-def determine_platform():
-    if '--efl' in sys.argv:
-        return "efl";
-    if '--gtk' in sys.argv:
-        return "gtk";
-    raise ValueError('No platform specified for jhbuild-wrapper.')
-
-
 def ensure_jhbuild(platform):
     if not jhbuild_cloned():
         clone_jhbuild()
@@ -116,10 +119,6 @@ def ensure_jhbuild(platform):
 if os.environ.has_key('UNDER_JHBUILD') and os.environ.has_key('ACLOCAL_FLAGS'):
     del os.environ['ACLOCAL_FLAGS']
 
-try:
-    platform = determine_platform()
-except ValueError as e:
-    sys.exit(e)
 ensure_jhbuild(platform)
 
 os.execve(jhbuild_path, [jhbuild_path, '--no-interact', '-f', jhbuildutils.get_config_file_for_platform(platform)] + sys.argv[2:], os.environ)
index 00d635b..cf78cee 100644 (file)
@@ -54,11 +54,11 @@ def init(jhbuildrc_globals, platform):
         jhbuildrc_globals["modules"].extend(__extra_modules)
 
     if 'WEBKIT_OUTPUTDIR' in os.environ:
-        jhbuildrc_globals["checkoutroot"] = checkoutroot = os.path.abspath(os.path.join(os.environ['WEBKIT_OUTPUTDIR'], 'Dependencies', 'Source'))
-        jhbuildrc_globals["prefix"] = os.path.abspath(os.path.join(os.environ['WEBKIT_OUTPUTDIR'], 'Dependencies', 'Root'))
+        jhbuildrc_globals["checkoutroot"] = checkoutroot = os.path.abspath(os.path.join(os.environ['WEBKIT_OUTPUTDIR'], 'Dependencies' + platform.upper(), 'Source'))
+        jhbuildrc_globals["prefix"] = os.path.abspath(os.path.join(os.environ['WEBKIT_OUTPUTDIR'], 'Dependencies' + platform.upper(), 'Root'))
     else:
-        jhbuildrc_globals["checkoutroot"] = checkoutroot = os.path.abspath(top_level_path('WebKitBuild', 'Dependencies', 'Source'))
-        jhbuildrc_globals["prefix"] = os.path.abspath(top_level_path('WebKitBuild', 'Dependencies', 'Root'))
+        jhbuildrc_globals["checkoutroot"] = checkoutroot = os.path.abspath(top_level_path('WebKitBuild', 'Dependencies' + platform.upper(), 'Source'))
+        jhbuildrc_globals["prefix"] = os.path.abspath(top_level_path('WebKitBuild', 'Dependencies' + platform.upper(), 'Root'))
 
     jhbuildrc_globals["nonotify"] = True
     jhbuildrc_globals["notrayicon"] = True