Qt 5

From LeechCraft
Jump to: navigation, search

Prerequisites

Make sure you have Qt 5 installed, and the libraries required by the plugins you want to build are built in Qt5 mode (there are either libraries suffixed -qt5 or the unsuffixed versions are built with Qt5). For now, the more or less complete list of such libs is:

  • Qwt (for core and a bunch of other plugins).
  • QXmpp (for Azoth Xoox).
  • Poppler (for Monocle PDF).
  • KQOauth (for Azoth WoodPecker and some Blasq subplugins).
  • QTermWidget (for Eleeminator).
  • liblastfm (for LastFMScrobble).
  • Qross (for Qrosp and scripting support).

Please note that if there are no -qt5 suffixed libraries unsuffixed versions are used, and no check is done if they are built with Qt5 or Qt4. Such builds will likely crash on startup or soon after that.

A good way to check if everything is built with Qt5 is to search for non-Qt5 libraries in the link list by issuing ldd /usr/local/lib/leechcraft/plugins/*.so | grep Qt | grep -v Qt5. If everything is built with Qt5, no library names should be returned.

Building

Run the following commands:

cd path/to/leechcraft
mkdir -p build/qt5
cd build/qt5
cmake -DUSE_QT5=True ../../src
make

This will build a more or less standard set of LeechCraft plugins. Altenatively, all of them can be configured to be disabled by default by using the following cmake invocation instead of the above:

cmake -DWITH_PLUGINS=False -DUSE_QT5=True ../../src

Then, individual plugins can be enabled via ccmake or by editing CMakeLists.txt manually.

On Gentoo, the cmake command may look like this:

cmake -DUSE_QT5=True -DENABLE_HARBINGER=False -DENABLE_VTYULC=False -DENABLE_LADS=False -DENABLE_AZOTH_SARIN=True -DENABLE_AZOTH_OTROID=True -DENABLE_AZOTH_ZHEET=True -DENABLE_LMP_JOS=True -DENABLE_LMP_MTPSYNC=True -DENABLE_LMP_POTORCHU=True -DENABLE_POSHUKU_QRD=True -DENABLE_KBSWITCH=True -DENABLE_CRYPT=False ../../src

Running

make install
leechcraft

Running sudo ldconfig can be required first time after installing LeechCraft.

Porting notes

The following is broken

Overall

Krigstask

Window snapshotting in desktop switcher quark is broken. There is no easy way to convert X11 pixmap to QPixmap, like there was a QPixmap::fromX11Pixmap in Qt4.

MelloneTray

Icons embeddeding and/or updating may be broken. XDamage events need to be checked to be handled correctly.

Popishu

Won't be ported to Qt5 until a working ebuild for qscintilla will be available supporting Qt5. I'm too lazy to port it.