[GTK] Install web and plugin processes in libexecdir instead of bindir
authorcarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 3 Aug 2011 12:20:12 +0000 (12:20 +0000)
committercarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 3 Aug 2011 12:20:12 +0000 (12:20 +0000)
https://bugs.webkit.org/show_bug.cgi?id=65600

Reviewed by Martin Robinson.

.:

* GNUmakefile.am: Initialize libexec_PROGRAMS, only used by
WebKit2 in this moment.

Source/WebKit2:

Launch processes from libexecdir or WEBKIT_EXEC_PATH
environment variable when it's set. This variable will be used by
MiniBrowser and unit tests to find processes without having to
install them.

* GNUmakefile.am:
* UIProcess/Launcher/gtk/ProcessLauncherGtk.cpp:
(WebKit::ProcessLauncher::launchProcess):

Tools:

Set WEBKIT_EXEC_PATH environment variable to use web and plugin
process from current directory instead of the intalled ones.

* MiniBrowser/gtk/GNUmakefile.am:
* MiniBrowser/gtk/main.c:
(main):
* WebKitTestRunner/GNUmakefile.am:
* WebKitTestRunner/gtk/main.cpp:
(main):

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

ChangeLog
GNUmakefile.am
Source/WebKit2/ChangeLog
Source/WebKit2/GNUmakefile.am
Source/WebKit2/UIProcess/Launcher/gtk/ProcessLauncherGtk.cpp
Tools/ChangeLog
Tools/MiniBrowser/gtk/GNUmakefile.am
Tools/MiniBrowser/gtk/main.c
Tools/WebKitTestRunner/GNUmakefile.am
Tools/WebKitTestRunner/gtk/main.cpp

index cf3d940..6cd8f60 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,15 @@
 2011-08-03  Carlos Garcia Campos  <cgarcia@igalia.com>
 
+        [GTK] Install web and plugin processes in libexecdir instead of bindir
+        https://bugs.webkit.org/show_bug.cgi?id=65600
+
+        Reviewed by Martin Robinson.
+
+        * GNUmakefile.am: Initialize libexec_PROGRAMS, only used by
+        WebKit2 in this moment.
+
+2011-08-03  Carlos Garcia Campos  <cgarcia@igalia.com>
+
         [GTK] Reorganize pkg-config files
         https://bugs.webkit.org/show_bug.cgi?id=65548
 
index 695cd4c..d21f7ee 100644 (file)
@@ -45,6 +45,7 @@ pkgconfigdir := $(libdir)/pkgconfig
 # Libraries and support components
 bin_PROGRAMS :=
 noinst_PROGRAMS :=
+libexec_PROGRAMS :=
 noinst_HEADERS :=
 noinst_LTLIBRARIES :=
 lib_LTLIBRARIES :=
index ed73b67..066dfb8 100644 (file)
@@ -1,3 +1,19 @@
+2011-08-03  Carlos Garcia Campos  <cgarcia@igalia.com>
+
+        [GTK] Install web and plugin processes in libexecdir instead of bindir
+        https://bugs.webkit.org/show_bug.cgi?id=65600
+
+        Reviewed by Martin Robinson.
+
+        Launch processes from libexecdir or WEBKIT_EXEC_PATH
+        environment variable when it's set. This variable will be used by
+        MiniBrowser and unit tests to find processes without having to
+        install them.
+
+        * GNUmakefile.am:
+        * UIProcess/Launcher/gtk/ProcessLauncherGtk.cpp:
+        (WebKit::ProcessLauncher::launchProcess):
+
 2011-08-03  Pavel Feldman  <pfeldman@chromium.org>
 
         Web Inspector: remove Node parameter from the InspectorClient::highlight
index f25123c..3383198 100644 (file)
@@ -844,6 +844,7 @@ libwebkit2gtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_CPP
        -I$(top_builddir)/DerivedSources/WebKit2/include/JavaScriptCore \
        -I$(top_builddir)/DerivedSources/WebKit2/include/WebCore \
        -I$(top_builddir)/DerivedSources/WebKit2/include/WebKit2 \
+       -DLIBEXECDIR=\""$(libexecdir)"\" \
        $(webcore_cppflags) \
        $(webcoregtk_cppflags) \
        $(javascriptcore_cppflags) \
@@ -960,7 +961,7 @@ DISTCLEANFILES += \
        $(top_builddir)/WebKit2/webkit2gtk-@WEBKITGTK_API_VERSION@.pc
 
 # WebKitWebProcess
-bin_PROGRAMS += \
+libexec_PROGRAMS += \
        Programs/WebKitWebProcess
 
 Programs_WebKitWebProcess_CPPFLAGS = \
@@ -1037,7 +1038,7 @@ libWebCoreGtk2_la_CPPFLAGS = \
        $(XT_CFLAGS) \
        $(ZLIB_LIBS)
 
-bin_PROGRAMS += \
+libexec_PROGRAMS += \
        Programs/WebKitPluginProcess
 
 Programs_WebKitPluginProcess_CPPFLAGS = \
index 2a398c3..f2d3262 100644 (file)
@@ -76,7 +76,8 @@ void ProcessLauncher::launchProcess()
         return;
     }
 
-    GOwnPtr<gchar> binaryPath(g_build_filename(applicationDirectoryPath().data(),
+    const gchar* execDirectory = g_getenv("WEBKIT_EXEC_PATH");
+    GOwnPtr<gchar> binaryPath(g_build_filename(execDirectory ? execDirectory : LIBEXECDIR,
                                                m_launchOptions.processType == ProcessLauncher::WebProcess ? gWebKitWebProcessName : gWebKitPluginProcessName, NULL));
     GOwnPtr<gchar> socket(g_strdup_printf("%d", sockets[0]));
     char* argv[3];
index 34d7e22..a2a36e6 100644 (file)
@@ -1,3 +1,20 @@
+2011-08-03  Carlos Garcia Campos  <cgarcia@igalia.com>
+
+        [GTK] Install web and plugin processes in libexecdir instead of bindir
+        https://bugs.webkit.org/show_bug.cgi?id=65600
+
+        Reviewed by Martin Robinson.
+
+        Set WEBKIT_EXEC_PATH environment variable to use web and plugin
+        process from current directory instead of the intalled ones.
+
+        * MiniBrowser/gtk/GNUmakefile.am:
+        * MiniBrowser/gtk/main.c:
+        (main):
+        * WebKitTestRunner/GNUmakefile.am:
+        * WebKitTestRunner/gtk/main.cpp:
+        (main):
+
 2011-08-02  Anders Carlsson  <andersca@apple.com>
 
         Add mac-lion platform to old-run-webkit-tests
index 60ee0dc..e378576 100644 (file)
@@ -4,6 +4,7 @@ bin_PROGRAMS += \
 Programs_MiniBrowser_CPPFLAGS = \
        -I$(srcdir)/Source \
        -I$(top_builddir)/DerivedSources/WebKit2/include \
+       -DWEBKIT_EXEC_PATH=\"${shell pwd}/$(top_builddir)/Programs/\" \
        $(global_cppflags) \
        $(GLIB_CFLAGS) \
        $(GTK_CFLAGS)
index a0c514f..3cbf2bc 100644 (file)
@@ -93,6 +93,9 @@ int main(int argc, char *argv[])
     }
     g_option_context_free (context);
 
+    // Prefer the not installed web and plugin processes.
+    g_setenv("WEBKIT_EXEC_PATH", WEBKIT_EXEC_PATH, FALSE);
+
     WKContextRef processContext = createWKContextWithInjectedBundle();
 
     if (uriArguments) {
index d957340..d2feca5 100644 (file)
@@ -24,6 +24,7 @@ Programs_WebKitTestRunner_CPPFLAGS = \
        -include Tools/WebKitTestRunner/WebKitTestRunnerPrefix.h \
        -I$(srcdir)/Tools/WebKitTestRunner \
        -I$(top_builddir)/DerivedSources/WebKit2/include \
+       -DWEBKIT_EXEC_PATH=\"${shell pwd}/$(top_builddir)/Programs/\" \
        $(global_cppflags) \
        $(javascriptcore_cppflags) \
        $(GLOBALDEPS_CFLAGS) \
index 7405197..4ed8ffb 100644 (file)
@@ -31,6 +31,8 @@
 int main(int argc, char** argv)
 {
     gtk_init(&argc, &argv);
+    // Prefer the not installed web and plugin processes.
+    g_setenv("WEBKIT_EXEC_PATH", WEBKIT_EXEC_PATH, FALSE);
     WTR::TestController controller(argc, const_cast<const char**>(argv));
     return 0;
 }