To build packages not in the KaOS repositories you need to get the proper PKGBUILD AND need to build all missing depends for such an app first (again, using the proper PKGBUILD files). As for FPC, make sure to use the proper PKGBUILD, so it installs where the system/Lazarus can find it.
On a rolling distro, never install any package outside of the package manager.