-
Notifications
You must be signed in to change notification settings - Fork 61
How to build sni qt
Bilal Elmoussaoui edited this page Jan 20, 2017
·
33 revisions
If you're not using a Debian based distro, the best way to install the patched version of sni-qt is by building it from source code.
cmake
-
gcc
- 32 bits
-
gcc-multilib
package in Arch -
gcc-multilib
package in Ubuntu
-
- 32 bits
-
qt4-default
- 64 bits
-
libqt4-dev
in Ubuntu -
qt-devel
package in Fedora
-
- 32 bits
-
lib32-qt4
package in Arch -
libqt4-dev:i386
package in Ubuntu
-
- 64 bits
-
dbusmenu-qt
- 64 bits
-
libdbusmenu-qt-dev
package in Ubuntu -
dbusmenu-qt-devel
package in Fedora -
libdbusmenu-qt4
package in Arch -
libdbusmenu-qt
package with flagqt4
in Gentoo
-
- 32 bits
-
lib32-libdbusmenu-qt
package in Arch -
libdbusmenu-qt-dev:i386
package in Ubuntu
-
- 64 bits
- Install
bzr
- Clone the branch
bzr branch lp:sni-qt
- Use terminal to go the cloned directory
cd ./sni-qt
- Save the content of the patch file as
patches/custom-icons-injection
--- sni-qt-0.2.6.orig/src/iconcache.cpp +++ sni-qt-0.2.6/src/iconcache.cpp @@ -145,7 +145,19 @@
QDir dir(m_themePath);
Q_FOREACH(const QSize& size, sizes) {
-
QPixmap pix = icon.pixmap(size);
-
QPixmap pix;
-
QStringList parts = key.split("_");
-
QString homedirname = QDir::homePath();
-
QString injectionIconFilename = QString(homedirname + "/.local/share/sni-qt/icons/%1/%2.png").arg(parts[0], parts[2]);
-
QString injectionIconFilename2 = QString(homedirname + "/.local/share/sni-qt/icons/%1.png").arg(parts[2]);
-
if (QFile::exists(injectionIconFilename))
-
pix = QPixmap(injectionIconFilename);
-
else if (QFile::exists(injectionIconFilename2))
-
pix = QPixmap(injectionIconFilename2);
-
else
-
pix = icon.pixmap(size);
-
QString dirName = QString("hicolor/%1x%1/apps").arg(size.width()); if (!dir.exists(dirName)) { if (!dir.mkpath(dirName)) {
- Load the patch
patch -p1 -i patches/custom-icons-injection
- Create a
build
folder using
mkdir build && cd ./build
-
- 64bits:
- Type in your terminal
cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release ../
- And afterwards
make
sudo make install
- 32bits:
- Execute those commands one after an other to compile a 32 bits version of the code
export CC="gcc -m32" export CXX="g++ -m32" export PKG_CONFIG_PATH=/usr/lib32/pkgconfig export CFLAGS="$(pkg-config --cflags QtCore) ${CFLAGS}" export CXXFLAGS="$(pkg-config --cflags QtCore) ${CXXFLAGS}"
- Type in your terminal
cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release -DQT_PLUGINS_DIR=/usr/lib32/qt/plugins ../
make && sudo make install
And voilá! You've built and installed the patched version of sni-qt, if you've any issue with that you can open a new issue here.