Skip to content

Building, installing and using

Ivailo Monev edited this page Jun 26, 2023 · 255 revisions

Pre-build packages

Packages for Debian 12 provided here, packages for FreeBSD 13.2 provided here. Contributions welcome.

Status

CodeQL

The following test is known to fail on 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 following font is required as last resort:

The software mentioned has know alternative(s) which is also supported, such as pkgconf which is drop-in replacement for pkg-config.

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.

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

git clone --depth=1 https:/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
sudo pacman -Syu git base-devel

git clone --depth=1 https:/fluxer/katie
cd katie/package/archlinux
makepkg -s
sudo pacman -U katie-git*.pkg.tar.zst

⚠️The instructions bellow will work only if you are logged in as administrator (root).

pkg install git-lite
portsnap auto

git clone --depth=1 https:/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
sudo pkg install git cmake gcc-10 pkg-config dbus jansson

git clone --depth=1 https:/fluxer/katie
mkdir -pv katie/build
cd katie/build
cmake ../ -DCMAKE_INSTALL_PREFIX=/usr -DKATIE_UNIFDEF=""
make 
sudo make install

other UNIX-like system

git clone --depth=1 https:/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 https:/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 commands 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