IÃ¢â‚¬â„¢m coming to appreciate more and more all of the hard work software developers perform. I wouldnÃ¢â‚¬â„¢t consider myself an open source elitist, but thereÃ¢â‚¬â„¢s something special about the associated ideologies. When a large community of people band together to work on a project, a lot of fantastic products can be created.
One such product is WebKit, the open source Web browser rendering engine used by Safari (as well as a number of other products). ItÃ¢â‚¬â„¢s very important to keep in mind that Safari and WebKit are two very different things. Safari is a Web browser that uses WebKit as itÃ¢â‚¬â„¢s rendering engine.
The WebKit developers put forth the effort to port WebKit to Qt, which is, as stated by the developers:
Qt is a comprehensive development framework that includes an extensive array of features, capabilities and tools that enable development of high-performance, cross-platform rich-client and server-side applications.
Qt is truly cross-platform and allows deployment on a wide range of hardware configurations, as opposed to other Ã¢â‚¬Å“cross-platformÃ¢â‚¬Â products that are restricted to Windows and Mac OS X. The fact that the WebKit developers put forth the effort of porting to Qt4 gives users the ability to run their rendering engine on any platform. Thanks to their hard work, itÃ¢â‚¬â„¢s quite easy to run a WebKit-based browser in Linux.
Preparing your Linux system for WebKit
IÃ¢â‚¬â„¢d like to be explicit in saying that the following instructions are geared towards a fresh install of Ubuntu 7.04, FC8, FC9, OpenSuse 10.3 but should be applicable to a wide variety of other Linux distributions. First and foremost youÃ¢â‚¬â„¢ll need to add extra repositories. After you have followed those steps we can begin.
There are a number of packages youÃ¢â‚¬â„¢ll need to successfully build a Qt4 Web browser that uses WebKit.
There will be a lot of additional packages to install, so donÃ¢â‚¬â„¢t be surprised if the list of packages for installation is significantly large.
Obtaining a nightly build of WebKit
Next, weÃ¢â‚¬â„¢ll need to use Subversion to check out the WebKit source. The following command will check out files to a folder titled
WebKit within your working directory, so be sure your working directory is appropriate (I used my
svn checkout http://svn.webkit.org/repository/webkit/trunk WebKit
You will be able to monitor the checkout process as each file is listed in your terminal.
Building your Qt4 WebKit browser
When the checkout is complete, you can initiate the build of your Qt4 WebKit browser using the following command:
The script will take a minute to prepare the build, and then the process will begin.
This step can take quite a bit of time depending on your hardware configuration, so take a few minutes to have a cup of coffee and relax while your browser is being built. Your terminal will scroll with hundreds of lines of build commands and more, so donÃ¢â‚¬â„¢t feel the need to sit and watch it build (unless youÃ¢â‚¬â„¢re interested Ã¢â‚¬â€ I was).
Running the browser
A successful build means you can run your Qt4 WebKit browser using the following command:
A very basic browser window will appear with limited controls and an address bar. There will be some information scrolling in your terminal, but it can generally be disregarded.
YouÃ¢â‚¬â„¢ve now got a native WebKit browser to play around with in Linux. I took a second to attach the launch command to an entry in an panel using the WebKit icon. ItÃ¢â‚¬â„¢s more convenient than keeping the command saved somewhere to copy and paste when IÃ¢â‚¬â„¢d like to test in WebKit.
Things to keep in mind
Perhaps the most important thing to keep in mind is that youÃ¢â‚¬â„¢re running a nightly build of WebKit, not the build Safari is using. The nightly versions are much more advanced than SafariÃ¢â‚¬â„¢s WebKit, so some of the quirks that appear in Safari may be handled in your Qt4 browser.
Due to the version discrepancy, you canÃ¢â‚¬â„¢t depend on a nightly build of WebKit sufficing for a legitimate test in Safari. It is useful, however, to take a quick look at overall structural elements of your designs before making the effort of moving to an OS X machine.
and Do export the path variables of QT and the Qt version must be >= 4.3