Difference between revisions of "User:Robin Cornelius/standalone qtwebkit"
(Refresh patch and mention it was already applied) |
|||
(8 intermediate revisions by 5 users not shown) | |||
Line 3: | Line 3: | ||
== Part 1 qtwebkit in shared form == | == Part 1 qtwebkit in shared form == | ||
First of all you need to grab the latest code for qt/webkit this is in a | First of all you need to grab the latest code for qt/webkit this is in a mercurial (hg) repository and if you install the mercurial tools for your distribution you can then fetch the code with | ||
hg clone http://hg.secondlife.com/llqtwebkit/ | hg clone http://hg.secondlife.com/llqtwebkit/ | ||
To get this to build some minor changes are required :- | To get this to build some minor changes are required :- | ||
diff -r | diff -r 808d018bf497 llembeddedbrowserwindow.cpp | ||
--- a/llembeddedbrowserwindow.cpp | --- a/llembeddedbrowserwindow.cpp Tue Dec 01 16:01:02 2009 -0800 | ||
+++ b/llembeddedbrowserwindow.cpp | +++ b/llembeddedbrowserwindow.cpp Thu Dec 10 17:43:04 2009 +0100 | ||
@@ -68,7 +68,7 @@ | @@ -68,7 +68,7 @@ | ||
#include <qdebug.h> | #include <qdebug.h> | ||
Line 20: | Line 20: | ||
LLEmbeddedBrowserWindow::LLEmbeddedBrowserWindow() | LLEmbeddedBrowserWindow::LLEmbeddedBrowserWindow() | ||
{ | { | ||
diff -r | diff -r 808d018bf497 llnetworkaccessmanager.cpp | ||
--- a/llnetworkaccessmanager.cpp | --- a/llnetworkaccessmanager.cpp Tue Dec 01 16:01:02 2009 -0800 | ||
+++ b/llnetworkaccessmanager.cpp | +++ b/llnetworkaccessmanager.cpp Thu Dec 10 17:43:04 2009 +0100 | ||
@@ -75,7 +75,7 @@ | @@ -75,7 +75,7 @@ | ||
Line 41: | Line 41: | ||
} | } | ||
diff -r | diff -r 808d018bf497 llqtwebkit.pro | ||
--- a/llqtwebkit.pro | --- a/llqtwebkit.pro Tue Dec 01 16:01:02 2009 -0800 | ||
+++ b/llqtwebkit.pro | +++ b/llqtwebkit.pro Thu Dec 10 17:43:04 2009 +0100 | ||
@@ -1,4 +1,4 @@ | @@ -1,4 +1,4 @@ | ||
-CONFIG += static | -CONFIG += static | ||
Line 50: | Line 50: | ||
TARGET = | TARGET = | ||
DEPENDPATH += . | DEPENDPATH += . | ||
diff -r | diff -r 808d018bf497 llwebpage.cpp | ||
--- a/static.pri | --- a/llwebpage.cpp Tue Dec 01 16:01:02 2009 -0800 | ||
+++ b/static.pri | +++ b/llwebpage.cpp Thu Dec 10 17:43:04 2009 +0100 | ||
@@ -42,7 +42,7 @@ | |||
#include "llembeddedbrowserwindow.h" | |||
#include "llembeddedbrowserwindow_p.h" | |||
-#define LINKTARGETPATCH | |||
+//#define LINKTARGETPATCH | |||
LLWebPage::LLWebPage(QObject *parent) | |||
: QWebPage(parent) | |||
diff -r 808d018bf497 static.pri | |||
--- a/static.pri Tue Dec 01 16:01:02 2009 -0800 | |||
+++ b/static.pri Thu Dec 10 17:43:04 2009 +0100 | |||
@@ -1,4 +1,5 @@ | @@ -1,4 +1,5 @@ | ||
unix { | unix { | ||
Line 62: | Line 74: | ||
} | } | ||
This disables some features that are not | This disables some features that are not available in current qt4/ and in the case of the prepend patch will never be available and also changes the build to use a shared qt4 | ||
To apply the above as a patch copy it to a local file, eg shared_qt.patch then from the llqtwebkit folder run :- | To apply the above as a patch copy it to a local file, eg shared_qt.patch then from the llqtwebkit folder run :- | ||
Line 68: | Line 80: | ||
patch -p1 < shared_qt.patch | patch -p1 < shared_qt.patch | ||
After | After successfully patching the code you can build with | ||
qmake-qt4 | qmake-qt4 | ||
Line 77: | Line 89: | ||
cp *.so /usr/local/lib/ | cp *.so /usr/local/lib/ | ||
cp llqtwebkit.h /usr/local/include/ | cp llqtwebkit.h /usr/local/include/ | ||
Note that installation is necessary; using an CXXFLAGS that includes the header directly from the source tree will fail because the project contains a header (llstyle.h) with the same name as an already existing header file of the viewer, and compilation of the viewer will break. | |||
I had to also perform these additional steps to get it work with the latest snowglobe svn: | |||
ln -s /usr/local/lib/llqtwebkit.so /usr/local/lib/llqtwebkit.so.1 | |||
...and add the following line to snowglobe: | |||
export LD_LIBRARY_PATH=/usr/local/lib | |||
== Part 2 Patching the viewer to use a shared libqtwebkit == | == Part 2 Patching the viewer to use a shared libqtwebkit == | ||
Line 83: | Line 105: | ||
It is already included in snowglobe 1.2 (revision 2976 and higher). | It is already included in snowglobe 1.2 (revision 2976 and higher). | ||
Index: indra/cmake/WebKitLibPlugin.cmake | Index: indra/cmake/WebKitLibPlugin.cmake | ||
=================================================================== | =================================================================== | ||
--- indra/cmake/WebKitLibPlugin.cmake (revision 2973) | --- indra/cmake/WebKitLibPlugin.cmake (revision 2973) | ||
+++ indra/cmake/WebKitLibPlugin.cmake (working copy) | +++ indra/cmake/WebKitLibPlugin.cmake (working copy) | ||
@@ -34,30 +34,34 @@ | @@ -34,30 +34,34 @@ | ||
debug ${ARCH_PREBUILT_DIRS_RELEASE}/libllqtwebkit.dylib | |||
) | |||
elseif (LINUX) | |||
- set(WEBKIT_PLUGIN_LIBRARIES | - set(WEBKIT_PLUGIN_LIBRARIES | ||
- llqtwebkit | - llqtwebkit | ||
+ if (STANDALONE) | + if (STANDALONE) | ||
+ set(WEBKIT_PLUGIN_LIBRARIES llqtwebkit) | + set(WEBKIT_PLUGIN_LIBRARIES llqtwebkit) | ||
+ else (STANDALONE) | + else (STANDALONE) | ||
+ set(WEBKIT_PLUGIN_LIBRARIES | + set(WEBKIT_PLUGIN_LIBRARIES | ||
+ llqtwebkit | + llqtwebkit | ||
- qgif | - qgif | ||
-# qico | -# qico | ||
- qjpeg | - qjpeg | ||
-# qpng | -# qpng | ||
-# qtiff | -# qtiff | ||
-# qsvg | -# qsvg | ||
+ qgif | + qgif | ||
+# qico | +# qico | ||
+ qjpeg | + qjpeg | ||
+# qpng | +# qpng | ||
+# qtiff | +# qtiff | ||
+# qsvg | +# qsvg | ||
-# QtSvg | -# QtSvg | ||
- QtWebKit | - QtWebKit | ||
- QtOpenGL | - QtOpenGL | ||
- QtNetwork | - QtNetwork | ||
- QtGui | - QtGui | ||
- QtCore | - QtCore | ||
+# QtSvg | +# QtSvg | ||
+ QtWebKit | + QtWebKit | ||
+ QtOpenGL | + QtOpenGL | ||
+ QtNetwork | + QtNetwork | ||
+ QtGui | + QtGui | ||
+ QtCore | + QtCore | ||
- fontconfig | - fontconfig | ||
- X11 | - X11 | ||
- Xrender | - Xrender | ||
- GL | - GL | ||
+ fontconfig | + fontconfig | ||
+ X11 | + X11 | ||
+ Xrender | + Xrender | ||
+ GL | + GL | ||
-# sqlite3 | -# sqlite3 | ||
-# Xi | -# Xi | ||
-# SM | -# SM | ||
- ) | - ) | ||
+# sqlite3 | +# sqlite3 | ||
+# Xi | +# Xi | ||
+# SM | +# SM | ||
+ ) | + ) | ||
+ endif (STANDALONE) | + endif (STANDALONE) | ||
endif (WINDOWS) |
Latest revision as of 21:54, 29 December 2009
Instructions for building the qt/webkit media plugin using distribution (shared) qt4, instead of static qt4 that the default LL build uses.
First of all you need to grab the latest code for qt/webkit this is in a mercurial (hg) repository and if you install the mercurial tools for your distribution you can then fetch the code with
hg clone http://hg.secondlife.com/llqtwebkit/
To get this to build some minor changes are required :-
diff -r 808d018bf497 llembeddedbrowserwindow.cpp --- a/llembeddedbrowserwindow.cpp Tue Dec 01 16:01:02 2009 -0800 +++ b/llembeddedbrowserwindow.cpp Thu Dec 10 17:43:04 2009 +0100 @@ -68,7 +68,7 @@ #include <qdebug.h> #endif -#define WEBHISTORYPATCH +//#define WEBHISTORYPATCH LLEmbeddedBrowserWindow::LLEmbeddedBrowserWindow() { diff -r 808d018bf497 llnetworkaccessmanager.cpp --- a/llnetworkaccessmanager.cpp Tue Dec 01 16:01:02 2009 -0800 +++ b/llnetworkaccessmanager.cpp Thu Dec 10 17:43:04 2009 +0100 @@ -75,7 +75,7 @@ void LLNetworkAccessManager::authenticationRequired(QNetworkReply *reply, QAuthenticator *authenticator) { - authenticator->tryAgainLater = true; + //authenticator->tryAgainLater = true; AuthDialog authDialog; int i; for (i = 0; i < authDialogs.count(); ++i) { @@ -107,7 +107,7 @@ authDialog.authenticationDialog->deleteLater(); authDialog.authenticationDialog = 0; authDialogs.removeAt(i); - authenticator->tryAgainLater = false; + //authenticator->tryAgainLater = false; } } diff -r 808d018bf497 llqtwebkit.pro --- a/llqtwebkit.pro Tue Dec 01 16:01:02 2009 -0800 +++ b/llqtwebkit.pro Thu Dec 10 17:43:04 2009 +0100 @@ -1,4 +1,4 @@ -CONFIG += static +CONFIG += shared TEMPLATE = lib TARGET = DEPENDPATH += . diff -r 808d018bf497 llwebpage.cpp --- a/llwebpage.cpp Tue Dec 01 16:01:02 2009 -0800 +++ b/llwebpage.cpp Thu Dec 10 17:43:04 2009 +0100 @@ -42,7 +42,7 @@ #include "llembeddedbrowserwindow.h" #include "llembeddedbrowserwindow_p.h" -#define LINKTARGETPATCH +//#define LINKTARGETPATCH LLWebPage::LLWebPage(QObject *parent) : QWebPage(parent) diff -r 808d018bf497 static.pri --- a/static.pri Tue Dec 01 16:01:02 2009 -0800 +++ b/static.pri Thu Dec 10 17:43:04 2009 +0100 @@ -1,4 +1,5 @@ unix { - DEFINES += STATIC_QT - QTPLUGIN += qgif + #DEFINES += STATIC_QT + #QTPLUGIN += qgif + QMAKE_LFLAGS_SHLIB *= "--rpath=/usr/lib/qt4/plugins/imageformats" }
This disables some features that are not available in current qt4/ and in the case of the prepend patch will never be available and also changes the build to use a shared qt4
To apply the above as a patch copy it to a local file, eg shared_qt.patch then from the llqtwebkit folder run :-
patch -p1 < shared_qt.patch
After successfully patching the code you can build with
qmake-qt4 make
This will produce a libqtwebkit.so and some symlinks to the library with so name versions. To install the quick and easy way is to
cp *.so /usr/local/lib/ cp llqtwebkit.h /usr/local/include/
Note that installation is necessary; using an CXXFLAGS that includes the header directly from the source tree will fail because the project contains a header (llstyle.h) with the same name as an already existing header file of the viewer, and compilation of the viewer will break.
I had to also perform these additional steps to get it work with the latest snowglobe svn:
ln -s /usr/local/lib/llqtwebkit.so /usr/local/lib/llqtwebkit.so.1
...and add the following line to snowglobe:
export LD_LIBRARY_PATH=/usr/local/lib
The following patch needs to be applied to viewer code older than SVN revision 2976, to only link against libqtwebkit. It is already included in snowglobe 1.2 (revision 2976 and higher).
Index: indra/cmake/WebKitLibPlugin.cmake =================================================================== --- indra/cmake/WebKitLibPlugin.cmake (revision 2973) +++ indra/cmake/WebKitLibPlugin.cmake (working copy) @@ -34,30 +34,34 @@ debug ${ARCH_PREBUILT_DIRS_RELEASE}/libllqtwebkit.dylib ) elseif (LINUX) - set(WEBKIT_PLUGIN_LIBRARIES - llqtwebkit + if (STANDALONE) + set(WEBKIT_PLUGIN_LIBRARIES llqtwebkit) + else (STANDALONE) + set(WEBKIT_PLUGIN_LIBRARIES + llqtwebkit - qgif -# qico - qjpeg -# qpng -# qtiff -# qsvg + qgif +# qico + qjpeg +# qpng +# qtiff +# qsvg -# QtSvg - QtWebKit - QtOpenGL - QtNetwork - QtGui - QtCore +# QtSvg + QtWebKit + QtOpenGL + QtNetwork + QtGui + QtCore - fontconfig - X11 - Xrender - GL + fontconfig + X11 + Xrender + GL -# sqlite3 -# Xi -# SM - ) +# sqlite3 +# Xi +# SM + ) + endif (STANDALONE) endif (WINDOWS)