Skip to content

Building, installing and using

Ivailo Monev edited this page Jan 30, 2021 · 255 revisions

Pre-build packages

Packages for Debian provided here, contributions welcome.

Status

Build status Total alerts

The following tests are known to fail on FreeBSD and NetBSD:

tst_qwaitcondition

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, CMAKE_UNITY_BUILD 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 CMAKE_UNITY_BUILD set to ON
  • Create native package via the provided package files

⚠️ CMAKE_UNITY_BUILD 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. You can tweak the requirement by overriding CMAKE_UNITY_BUILD_BATCH_SIZE as CMake argument, however that loses most of the benefits that the CMAKE_UNITY_BUILD option may provide such as reduced build time and catching One Definition Rule (ODR) issues.

⚠️ On OpenIndiana 5.11 mere ucnv_countAvailable() call causes core dump, this means it is unlikely you will be able to build and use it on that platform unless the issue is solved by the platform or ICU maintainers.

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
sudo dnf install git rpmdevtools

cd ~
git clone --depth=1 git://github.com/fluxer/katie
cd katie/package/fedora
rpmdev-setuptree
rmdir -v ~/rpmbuild/BUILD
ln -vs ~/katie ~/rpmbuild/BUILD
sudo dnf install $(grep BuildRequires katie.spec | sed 's|BuildRequires:||g')
rpmbuild -bb katie.spec
sudo dnf install ~/rpmbuild/RPMS/*/katie-*.rpm

⚠️You will need administrator (root) permissions to install packages and update the ports snapshot

pkg install git-lite
portsnap auto

git clone --depth=1 git://github.com/fluxer/katie
cd katie/package/freebsd
make build-depends-list | cut -c 12- | xargs pkg install -y
make makesum
make build
make package
make install

⚠️You will need administrator (root) permissions to install packages and update the ports snapshot

pkg_add git
cd /usr
ftp https://cdn.openbsd.org/pub/OpenBSD/$(uname -r)/ports.tar.gz
tar xzf ports.tar.gz

cd ~
git clone --depth=1 git://github.com/fluxer/katie
mkdir -p /usr/ports/mystuff/devel/
cp -vr $(pwd)/katie/package/openbsd /usr/ports/mystuff/devel/katie
cd /usr/ports/mystuff/devel/katie
make makesum
make build
make package
make install

⚠️You will need administrator (root) permissions to install packages and update the ports snapshot

pkgin install git
ftp ftp://ftp.NetBSD.org/pub/pkgsrc/current/pkgsrc.tar.gz
tar -xzf pkgsrc.tar.gz -C /usr

git clone --depth=1 git://github.com/fluxer/katie
cp -vr $(pwd)/katie/package/netbsd /usr/pkgsrc/devel/katie
cd /usr/pkgsrc/devel/katie
make build-depends-list | xargs pkgin -y install
make makesum
make build
make package
make install

⚠️You will need administrator (root) permissions to install packages and update the ports snapshot

pkg install git-lite
cd /usr
make dports-create-shallow

cd ~
git clone --depth=1 git://github.com/fluxer/katie
cp -vr $(pwd)/katie/package/freebsd /usr/dports/devel/katie
cd /usr/dports/devel/katie
make build-depends-list | cut -c 13- | xargs pkg install -y
make makesum
make build
make package
make install

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
make 
sudo make install

Cross-building

⚠️ Before you attempt to use the steps bellow, consider using clean chroot environment. arch-bootstrap 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 and rcc), 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