Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
midori:contribute [2013/06/26 18:31] kalikiana [Backwards compatibility] |
midori:contribute [2015/08/30 21:14] (current) kalikiana |
||
---|---|---|---|
Line 17: | Line 17: | ||
Join [[irc://irc.freenode.net/midori|#midori]] on Freenode [[https://kiwiirc.com/client/irc.freenode.net/midori|or use webchat]] to talk about Midori, discuss bugs and new ideas. | Join [[irc://irc.freenode.net/midori|#midori]] on Freenode [[https://kiwiirc.com/client/irc.freenode.net/midori|or use webchat]] to talk about Midori, discuss bugs and new ideas. | ||
+ | |||
+ | //Note: Midori also has a mirrored room in [[https://elementary.io/|Elementary]]'s Slack ([[https://ele.slack.com/messages/midori/|invite-only]]) which means #midori is logged (logs are only available to admins, not all users) and you may be talking to users through the gateway.// | ||
+ | |||
====== Contribute other than touching code ====== | ====== Contribute other than touching code ====== | ||
Line 22: | Line 25: | ||
* [[https://www.bountysource.com/#trackers/130181-midori|Add a bounty]] for a feature or bug you'd like to support | * [[https://www.bountysource.com/#trackers/130181-midori|Add a bounty]] for a feature or bug you'd like to support | ||
* [[https://translations.launchpad.net/midori/trunk/+pots/trunk|Translate to your own language]] | * [[https://translations.launchpad.net/midori/trunk/+pots/trunk|Translate to your own language]] | ||
+ | * [[https://github.com/eustasy/midori-browser.org/issues|Report website bugs]] | ||
+ | * Write [[http://wiki.xfce.org/midori/tutorial|your own extension]] - granted that's code, too, but maybe a little easier than hacking the core. | ||
+ | |||
+ | ====== Documentation resources ====== | ||
+ | |||
+ | * [[https://wiki.gnome.org/Projects/Vala/Tutorial|Vala Tutorial]] | ||
+ | * [[http://midori-browser.org/docs/api/vala/midori/|Midori Vala Docs]] | ||
+ | * [[http://midori-browser.org/docs/api/c/html/|Midori C Docs]] | ||
+ | |||
====== Build the code ====== | ====== Build the code ====== | ||
- | <code bash>./waf configure --prefix=/usr | + | <code bash>mkdir _build |
- | ./waf build | + | cd _build |
- | sudo ./waf install</code> | + | cmake -DCMAKE_INSTALL_PREFIX=/usr .. |
+ | make | ||
+ | sudo make install | ||
+ | sudo gtk-update-icon-cache /usr/share/icons/hicolor | ||
+ | </code> | ||
+ | |||
+ | //Advanced Tip: Pass "-G Ninja" to cmake to use [[http://martine.github.io/ninja/|Ninja]] instead of make (usually packaged as ninja or ninja-build).// | ||
+ | |||
+ | If using GTK+3 you'll want to add <code bash>-DUSE_GTK3=1</code> to the cmake command line. | ||
+ | |||
+ | You can build Midori using another C Compiler for example Clang. Just | ||
+ | add -DCMAKE_C_COMPILER=/path/to/compiler to the cmake arguments. | ||
+ | Then you can build following your normal procedure. Like this: | ||
+ | <code bash>cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_C_COMPILER=/usr/bin/clang .. | ||
+ | make</code> | ||
Midori can be **run without being installed**. | Midori can be **run without being installed**. | ||
- | <code bash>_build/default/midori/midori</code> | + | <code bash>_build/midori/midori</code> |
You can use a **temporary folder for testing** without affecting normal settings | You can use a **temporary folder for testing** without affecting normal settings | ||
- | <code bash>_build/default/midori/midori -c /tmp/midoridev</code> | + | <code bash>_build/midori/midori -c /tmp/midoridev</code> |
You'll want to **unit test** the code if you're testing a new version or contributed your own changes: | You'll want to **unit test** the code if you're testing a new version or contributed your own changes: | ||
- | <code bash>xvfb-run ./waf check</code> | + | <code bash>xvfb-run make check</code> |
Automated daily builds in Launchpad ([[https://launchpad.net/~elementary-os/+archive/daily|ppa:elementary-os/daily]] and [[https://launchpad.net/~midori/+archive/midori-dev|ppa:midori/midori-dev]]) run these tests as well. | Automated daily builds in Launchpad ([[https://launchpad.net/~elementary-os/+archive/daily|ppa:elementary-os/daily]] and [[https://launchpad.net/~midori/+archive/midori-dev|ppa:midori/midori-dev]]) run these tests as well. | ||
Line 45: | Line 71: | ||
Testing an installed release may reveal crashers or memory corruption which require investigating from a local build and obtaining a stacktrace (backtrace, crash log). | Testing an installed release may reveal crashers or memory corruption which require investigating from a local build and obtaining a stacktrace (backtrace, crash log). | ||
- | <code bash>_build/default/midori/midori -g [OPTIONAL ARGUMENTS]</code> | + | <code bash>_build/midori/midori -g [OPTIONAL ARGUMENTS]</code> |
If the problem is a warning, not a crash GLib has a handy feature | If the problem is a warning, not a crash GLib has a handy feature | ||
- | <code bash>env G_DEBUG=all _build/default/midori/midori -g</code> | + | <code bash>env G_DEBUG=all _build/midori/midori -g</code> |
For more specific debugging output, depending on the feature in question you may use | For more specific debugging output, depending on the feature in question you may use | ||
- | <code bash>env MIDORI_DEBUG=help _build/default/midori/midori</code> | + | <code bash>env MIDORI_DEBUG=help _build/midori/midori</code> |
+ | |||
+ | Whilst -g is convenient you may want to use proper gdb: | ||
+ | |||
+ | <code bash>gdb | ||
+ | file _build/midori/midori | ||
+ | run | ||
+ | … | ||
+ | bt</code> | ||
+ | |||
+ | On Windows you can open the folder where Midori is installed and double-click gdb.exe. A black command line window should appear. | ||
+ | |||
+ | <code bash>file midori.exe | ||
+ | run | ||
+ | … | ||
+ | bt</code> | ||
+ | |||
+ | To verify a regression you might need to revert a particular change: | ||
+ | |||
+ | <code bash> | ||
+ | # Revert only r6304 | ||
+ | bzr merge . -r 6304..6303 | ||
+ | </code> | ||
====== Coding style and quality ====== | ====== Coding style and quality ====== | ||
Line 181: | Line 229: | ||
| webkit | 1.8.3-1.fc17 | 1.10.0-0ubuntu1 | | | webkit | 1.8.3-1.fc17 | 1.10.0-0ubuntu1 | | ||
====== Midori with(out) Granite ====== | ====== Midori with(out) Granite ====== | ||
- | When built with Granite (--enable-granite) there're a few key differences: | + | When built with Granite (-DUSE_GRANITE=1 or --enable-granite) there're a few key differences: |
* Preferences uses a [[http://valadoc.elementaryos.org/Granite/Granite.Widgets.StaticNotebook.html|Granite.Widgets.StaticNotebook]] | * Preferences uses a [[http://valadoc.elementaryos.org/Granite/Granite.Widgets.StaticNotebook.html|Granite.Widgets.StaticNotebook]] | ||
* URL completion styling is slightly different | * URL completion styling is slightly different | ||
* Clear Private Data uses **Granite.Widgets.LightWindow** | * Clear Private Data uses **Granite.Widgets.LightWindow** | ||
* Edit Bookmark and Security Details use [[http://valadoc.elementaryos.org/Granite/Granite.Widgets.PopOver.html|Granite.Widgets.PopOver]] instead of Gtk.Window | * Edit Bookmark and Security Details use [[http://valadoc.elementaryos.org/Granite/Granite.Widgets.PopOver.html|Granite.Widgets.PopOver]] instead of Gtk.Window | ||
- | * Browser uses **Granite.Widgets.DynamicNotebook** instead of Gtk.Notebook | + | |
====== Midori for Windows ====== | ====== Midori for Windows ====== | ||
- | ===== Dependencies ===== | + | |
+ | ===== For Linux developers ===== | ||
+ | ==== Dependencies ==== | ||
Midori for Windows is compiled on a Linux host and MinGW stack. For the current build Fedora 18 packages are used. Packages needed are listed below: | Midori for Windows is compiled on a Linux host and MinGW stack. For the current build Fedora 18 packages are used. Packages needed are listed below: | ||
Line 197: | Line 247: | ||
For cross-compilation | For cross-compilation | ||
- | <code bash>yum install mingw{32,64}-webkitgtk3 mingw{32,64}-glib-networking mingw{32,64}-gdb</code> | + | <code bash>yum install mingw{32,64}-webkitgtk3 mingw{32,64}-glib-networking mingw{32,64}-gdb mingw{32,64}-gstreamer-plugins-good</code> |
Packages needed when assembling the archive | Packages needed when assembling the archive | ||
- | <code bash> yum install faenza-icon-theme p7zip mingw32-nsis</code> | + | <code bash> yum install faenza-icon-theme p7zip mingw32-nsis greybird-gtk3-theme</code> |
Installing those should get you the packages needed to successfully build and develop Midori for Win32. | Installing those should get you the packages needed to successfully build and develop Midori for Win32. | ||
- | + | ==== Building ==== | |
- | ===== Building ===== | + | |
For 32-bit builds: | For 32-bit builds: | ||
<code bash> | <code bash> | ||
- | mingw32-env | + | mkdir _mingw32 |
- | ./configure --enable-gtk3 --prefix=/usr/i686-w64-mingw32/sys-root/mingw/ | + | cd _mingw32 |
+ | mingw32-cmake .. -DUSE_ZEITGEIST=0 -DUSE_GTK3=1 -DCMAKE_INSTALL_PREFIX=/usr/i686-w64-mingw32/sys-root/mingw -DCMAKE_VERBOSE_MAKEFILE=0 | ||
make | make | ||
sudo make install</code> | sudo make install</code> | ||
Line 214: | Line 264: | ||
For 64-bit builds: | For 64-bit builds: | ||
<code bash> | <code bash> | ||
- | mingw64-env | + | mkdir _mingw64 |
- | ./configure --enable-gtk3 --prefix=/usr/x86_64-w64-mingw32/sys-root/mingw/ | + | cd _mingw64 |
+ | mingw64-cmake .. -DUSE_ZEITGEIST=0 -DUSE_GTK3=1 -DCMAKE_INSTALL_PREFIX=/usr/x86_64-w64-mingw32/sys-root/mingw -DCMAKE_VERBOSE_MAKEFILE=0 | ||
make | make | ||
sudo make install</code> | sudo make install</code> | ||
Line 224: | Line 275: | ||
64-bit build: | 64-bit build: | ||
<code bash>env MINGW_PREFIX="/usr/x86_64-w64-mingw32/sys-root/mingw/" ./win32/makedist/makedist.midori x64</code> | <code bash>env MINGW_PREFIX="/usr/x86_64-w64-mingw32/sys-root/mingw/" ./win32/makedist/makedist.midori x64</code> | ||
- | |||
===== Testing ===== | ===== Testing ===== | ||
For testing your changes unfortuantely a real system is needed because Midori and WebKitGTK+ don't work properly under Wine. Even if it works some problems are not visible when using Wine, but are present when running under a real Windows system and vice versa. | For testing your changes unfortuantely a real system is needed because Midori and WebKitGTK+ don't work properly under Wine. Even if it works some problems are not visible when using Wine, but are present when running under a real Windows system and vice versa. | ||
One way around it is to virtualize Windows on a Linux host and mount your MinGW directories as a network drive or shared folder. | One way around it is to virtualize Windows on a Linux host and mount your MinGW directories as a network drive or shared folder. | ||
+ | |||
+ | ===== For Windows developers ===== | ||
+ | Rough list of prerequisites for building with MinGW on Windows | ||
+ | |||
+ | If in doubt whether to get 32 or 64 bit versions use 32 bit ones, they are more | ||
+ | universal and tend to be less broken. | ||
+ | |||
+ | |||
+ | ==== MinGW compiler ==== | ||
+ | Compiler should match the one that was used to build packages ideally. | ||
+ | |||
+ | * We will user *mingw64 rubenvb* release | ||
+ | * Lastest stable release is gcc 4.8.0 | ||
+ | |||
+ | [[http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting | ||
+ | %20Win64/Personal%20Builds/rubenvb/gcc-4.8-release/|Releases]] | ||
+ | |||
+ | [[http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting | ||
+ | %20Win64/Personal%20Builds/rubenvb/gcc-4.8-release/x86_64-w64-mingw32-gcc-4.8.0- | ||
+ | win32_rubenvb.7z/download|Download]] | ||
+ | |||
+ | |||
+ | ==== 7zip ==== | ||
+ | We will need 7zip to extract various archives | ||
+ | |||
+ | [[http://www.7-zip.org/download.html|Homepage]] | ||
+ | |||
+ | |||
+ | [[http://downloads.sourceforge.net/sevenzip/7z920.exe|32bit Installer]] | ||
+ | |||
+ | |||
+ | ==== Python3 (to extract rpms) ==== | ||
+ | We will need python3 to use download-mingw-rpm.py script. | ||
+ | If you don't plan to use it you can safely skip this step. | ||
+ | |||
+ | We get python3, whatever is the lastes stable release. | ||
+ | |||
+ | [[http://www.python.org/download/releases/3.3.5|Releases]] | ||
+ | |||
+ | [[http://www.python.org/downloads/release/python-335/|Download]] | ||
+ | |||
+ | [[http://www.python.org/ftp/python/3.3.5/python-3.3.5.amd64.msi|Installer]] | ||
+ | |||
+ | Install Python and be sure to check "addd python.exe to path" installer checkbox. | ||
+ | |||
+ | ==== download-mingw-rpm.py ==== | ||
+ | We get download-mingw-rpm.py script from github. It uses Python3 and should fetch and | ||
+ | unpack rpm files for us. | ||
+ | |||
+ | [[https://github.com/mkbosmans/download-mingw-rpm/blob/master/download- | ||
+ | mingw-rpm.py|View Script]] | ||
+ | |||
+ | [[https://github.com/mkbosmans/download-mingw-rpm/raw/master/download- | ||
+ | mingw-rpm.py|Download Script]] | ||
+ | |||
+ | Usage: | ||
+ | |||
+ | * Launch cmd.exe | ||
+ | * Navigate to folder where the script was saved | ||
+ | * Make sure that python can access 7z.exe | ||
+ | * Run command and wait, it should extract the packages into your current directory | ||
+ | |||
+ | <code bash>c:\Python33\python.exe download-mingw-rpm.py -u http://ftp.wsisiz.edu.pl/pub/linux/fedora/linux/updates/18/i386/ --deps mingw32-webkitgtk mingw32-glib-networking mingw32-gdb mingw32-gstreamer-plugins-good</code> | ||
+ | |||
+ | [[http://dl.fedoraproject.org/pub/fedora/linux/releases/18/Everything/i386/os/Packages | ||
+ | /m/|Fedora 18 packages]] | ||
+ | |||
+ | The above URL for some reason does not work with the script. | ||
+ | |||
+ | ==== MSYS ==== | ||
+ | Msys contains shell and some small utilities | ||
+ | |||
+ | [[http://sourceforge.net/projects/mingw-w64/files/External%20binary | ||
+ | %20packages%20%28Win64%20hosted%29/MSYS%20%2832-bit%29/MSYS-20111123.zip/download|Download]] | ||
+ | |||
+ | |||
+ | ==== CMake ==== | ||
+ | [[http://www.cmake.org/cmake/resources/software.html|Homepage]] | ||
+ | [[http://www.cmake.org/files/v2.8/cmake-2.8.12.2-win32-x86.exe|Installer]] | ||
+ | |||
+ | When installing check the installer checkbox "add to path" | ||
+ | |||
+ | |||
+ | ==== Bazaar ==== | ||
+ | [[http://wiki.bazaar.canonical.com/WindowsDownloads|Homepage]] | ||
+ | |||
+ | We will get 2.4 Stable Release (standalone) | ||
+ | |||
+ | [[http://launchpad.net/bzr/2.4/2.4.2/+download/bzr-2.4.2-1-setup.exe|Installer]] | ||
+ | |||
+ | When installing check the installer checkbox "add to path" | ||
+ | |||
+ | ==== Vala ==== | ||
+ | [[http://ftp.gnome.org/pub/gnome/sources/vala/0.20/vala-0.20.0.tar.xz|Source]] | ||
+ | |||
+ | ==== Globbing it all together ==== | ||
+ | |||
+ | Extracted rpms msys and mingw packages should form uniform unix like folder. | ||
+ | You use msys.bat to launch a shell | ||
====== Jargon ====== | ====== Jargon ====== | ||
- | * freeze: the 4th week of a 4 week release cycle, bug fixes only | + | * freeze: a period of bug fixes only eg. 4/2 cycle means 4 weeks of features and 2 weeks to focus on resolving existing problems |
* MR: merge request, a branch proposed for review | * MR: merge request, a branch proposed for review | ||
* ninja: an internal tab, usually empty label, used for taking screenshots | * ninja: an internal tab, usually empty label, used for taking screenshots | ||
* fortress: user of an ancient release like 0.4.3 as found on Raspberry Pie, Debian, Ubuntu | * fortress: user of an ancient release like 0.4.3 as found on Raspberry Pie, Debian, Ubuntu | ||
* katze, sokoke, tabby: API names and coincidentally cat breeds | * katze, sokoke, tabby: API names and coincidentally cat breeds |