I finally found a bit of time to play with this. It is not quite solved, but it is a progress...
Building FPC and Lazarus from source (KDE and Qt5)
Assume FPC 3.2.2 and Lazarus 4.6 where installed from .deb "official"
Craeted /FPC_LAZ directory in /tmp and from it performed:
git clone
https://gitlab.com/freepascal.org/fpc/source.gitgit clone
https://gitlab.com/freepascal.org/lazarus/lazarus/-/tree/mainAssume there is two directories now:
/tmp/FPC_LAZ/fpc-main
/tmp/FPC_LAZ/lazarus-main
Assume also this is installed as minimum:
sudo apt-get install git build-essential pkg-config libgtk2.0-dev libgtk-3-dev libpango1.0-dev libx11-dev libgdk-pixbuf2.0-dev libqt5pas-dev
or
sudo apt-get sudo apt-get install git build-essential pkg-config libgtk2.0-dev libgtk-3-dev libpango1.0-dev libx11-dev libgdk-pixbuf2.0-dev libxpm-dev libjpeg-dev libtiff-dev libpng-dev libxtst-dev libxaw7-dev libglu1-mesa-dev libqt5pas-dev
For FPC this should be performed from FPC_LAZ:
make all -j
For Lazarus and qt5:
make bigide -j LCL_PLATFORM=qt5
/tmp/FPC_LAZ/fpc-main/compiler/ppcx64
Free Pascal Compiler version 3.3.1 [2026/06/06] for x86_64
Copyright (c) 1993-2026 by Florian Klaempfl and others
Now:
/tmp/FPC_LAZ/lazarus-main/lazarus --primary-config-path=/tmp/FPC_LAZ
or
/tmp/FPC_LAZ/lazarus-main/lazarus --pcp=/tmp/FPC_LAZ
And that works fine.
To compile Lazarus with new FPC for qt5:
make bigide -j FPC=/tmp/FPC_LAZ/fpc-main/compiler/ppcx64 LCL_PLATFORM=qt5
Now IDE only complaints it missing .cfg file after inserting /tmp/FPC_LAZ/fpc-main/compiler/ppcx64 as new compiler...