Skip to content

Building, installing and using

Ivailo Monev edited this page Jan 16, 2020 · 255 revisions

Status

Build Status

The following tests are known to fail:

  • tst_qchar (2 tests, both depend on ICU normalization support)
  • tst_qsqldatabase (InnoDB assertion failure in Travis)
  • tst_qhostinfo (2 tests, IPv6 lookup issue)
  • tst_qiodevice (1 test)

Requirements

The following software is required to build the project:

The following software is recommended:

The following software is required to cross-build the project:

*The software mentioned has know alternative(s) which is also supported, such as LibreSSL which is almost a drop-in replacement for OpenSSL, JPEG 9 as an alternative to libjpeg-turbo, iODBC as an alternative to UnixODBC or MariaDB as an alternative to MySQL.

Building

  • Learn how to take advantage of the flexible build system
  • If performance matters build with Release as CMAKE_BUILD_TYPE, KATIE_ALLINONE set to ON and -ffast-math -fno-exceptions in CXXFLAGS
  • If size matters build with MinSizeRel as CMAKE_BUILD_TYPE and -flto -fno-exceptions in CXXFLAGS
  • If time and disk space for building matters build with KATIE_ALLINONE set to ON
  • Create packages via cpack, make package or a native package via the provided package files for various distributions

⚠️ KATIE_ALLINONE build option will raise the memory required for building the GUI component to 2Gb (if not more) when the build type is RelWithDebInfo (which is the default) and even more when it is Debug

⚠️ Setting CMAKE_SKIP_RPATH to FALSE when configuring releases prior to 4.9.0-rc16 can cause the tools which are run during the build stage (moc, uic, rcc and lrelease) to misbehave if Katie is already installed on the system and if the version you are going to build is not binary compatible with the version installed which may be the case when building with different options or optimization (including LTO).

sudo apt-get update
sudo apt-get install git build-essential

git clone --depth=1 git://github.com/fluxer/katie
cd katie
ln -sv package/debian .
sudo apt-get build-dep .
dpkg-buildpackage -uc -nc -b --no-sign
sudo dpkg -i ../katie-git*.deb
pacman -Syu git

git clone --depth=1 git://github.com/fluxer/katie
cd katie/package/archlinux
makepkg -s
sudo pacman -U katie-git*.pkg.tar.xz
pkg install git
portsnap auto

git clone --depth=1 git://github.com/fluxer/katie
cd katie/package/freebsd
make makesum
make build
make package
pkg install work/pkg/katie-*.txz

other UNIX-like system

git clone --depth=1 git://github.com/fluxer/katie
mkdir -pv katie/build
cd katie/build
cmake ../ -DCMAKE_INSTALL_PREFIX=/usr -DKATIE_SETTINGS_FULL=/etc/xdg -DKATIE_LDCONF_FULL=/etc/ld.so.conf.d -DKATIE_PROFILE_FULL=/etc/profile.d
make 
sudo make install

Cross-building

⚠️ Before you attempt to use the steps bellow, consider using clean chroot environment. Archbootstrap and Debootstrap for an example can setup one. Debootstrap can create usable chroot environments for non-native (to the host system) architectures aswell meaning you can avoid many cross-compilation issues however it has the downside of being much slower due to emulation of CPU instructions for every process, not just the tools which are run during the build stage (moc, uic, rcc and lrelease), and not supporting all CPU instructions that may be required by the processes.

sudo dpkg --add-architecture armhf
sudo apt-get update
sudo apt-get install git crossbuild-essential-armhf qemu-user-static

git clone --depth=1 git://github.com/fluxer/katie
cd katie
ln -sv package/debian .
sudo apt-get build-dep -a armhf .
dpkg-buildpackage -uc -nc -b --no-sign -a armhf
sudo dpkg -i ../katie-git*.deb

Post installation

  • Run sudo ldconfig so that the libraries paths are cached, systems using musl libc, uClibc or uClibc-ng do not require this step
  • Logout and login so that the project specific Shell profile file has effect, note that the file requires the Shell to be login or the profile file to be sourced from the Shell specific config (e.g. ~/.bashrc or ~/.ashrc)

Using

  • Watch out for tools/scripts that alter environmental variables (e.g. sudo) such as PATH, LD_LIBRARY_PATH, PKG_CONFIG_PATH and ensure that the binaries, libraries, etc. can be located by other projects in the environment you will be building and using them:
echo $PATH
echo $LD_LIBRARY_PATH
echo $PKG_CONFIG_PATH

If the project files are no installed in one of the locations printed by the code above or the fallback that is used (empty means fallback, e.g set when building Bash, GNU libc, pkg-config) then you will have to tinker with your system.

  • Verify the installation:
echo '#include <QDebug>

QT_USE_NAMESPACE

int main()
{
    qDebug() << "<insert kool joke here>";
    return 0;
}' > kk.cpp
g++ kk.cpp $(pkg-config --cflags --libs KtCore) -std=c++11 -o kk
./kk
  • Report any issues and suggestions you may have

Clone this wiki locally