Skip to content

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.

Dependencies

  • cmake
  • gcc
    • 32 bits
      • gcc-multilib package in Arch
      • gcc-multilib package in Ubuntu
  • 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
  • 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 flag qt4 in Gentoo
    • 32 bits
      • lib32-libdbusmenu-qt package in Arch
      • libdbusmenu-qt-dev:i386 package in Ubuntu

How to build

  1. Install bzr
  2. Clone the branch
    bzr branch lp:sni-qt
  3. Use terminal to go the cloned directory
    cd ./sni-qt
  4. 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)) {
    
  1. Load the patch
    patch -p1 -i patches/custom-icons-injection
  2. Create a build folder using
    mkdir build && cd ./build
    • 64bits:
    1. Type in your terminal
      cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release ../
    2. And afterwards
      make
    3. sudo make install
    • 32bits:
    1. 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}"
      
    1. Type in your terminal
    cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release -DQT_PLUGINS_DIR=/usr/lib32/qt/plugins ../
    1. 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.

Clone this wiki locally