BCS Logo
Brooks Computing Systems
Quality, Reliability & Service
Jacksonville

Install Lazarus on Gentoo

Complete guide with prerequisites, widgetsets, troubleshooting, and verification

Build a full Pascal desktop IDE on Gentoo

Lazarus is a cross-platform IDE for Free Pascal. On Gentoo, the clean approach is to install Free Pascal, enable the proper Lazarus widgetset, and then rebuild if necessary for GTK or Qt depending on your desktop.

Since you are likely using a modern desktop such as KDE Plasma, the Qt widgetset often gives the most native look. GTK is also a perfectly valid choice.

Developer workstation showing code editor

Installing Lazarus on Gentoo typically pulls in the following core pieces:

  • dev-lang/fpc — the Free Pascal Compiler
  • dev-lang/fpc-source — compiler sources, often needed by Lazarus tools and packages
  • dev-pascal/lazarus — the Lazarus IDE itself
  • GUI libraries for your selected widgetset such as GTK or Qt
Recommendation: On Plasma, start with a Qt-based build. On XFCE, MATE, or lighter GTK desktops, GTK is usually the easiest choice.
Laptop with source code displayed

Set your USE flags before emerging. This reduces rebuild churn and makes the initial install cleaner.

For a GTK build:

sudo mkdir -p /etc/portage/package.use
printf "dev-lang/fpc source\n" | sudo tee -a /etc/portage/package.use/lazarus
printf "dev-pascal/lazarus gtk\n" | sudo tee -a /etc/portage/package.use/lazarus

For a Qt build:

sudo mkdir -p /etc/portage/package.use
printf "dev-lang/fpc source\n" | sudo tee -a /etc/portage/package.use/lazarus
printf "dev-pascal/lazarus qt5\n" | sudo tee -a /etc/portage/package.use/lazarus

If your overlay/profile exposes qt6 for Lazarus and your system is already aligned for it, you can replace qt5 with qt6. If it fails, go back to qt5.

Terminal screen with commands

Once the USE flags are in place, sync and install:

sudo emerge --sync
sudo emerge --ask dev-lang/fpc dev-lang/fpc-source dev-pascal/lazarus

If you already have FPC installed, Portage will only add what is missing or rebuild what changed.

Tip: If Gentoo reports pending config merges after the build, process them before troubleshooting the IDE.
Software development screen with code and UI

If emerge tells you that files in /etc/portage need updating, process them:

sudo etc-update

or, if you prefer:

sudo dispatch-conf

This matters because stale package.use, make.conf, or repository configuration can cause confusing follow-up errors.

Server room perspective

After installation completes, start the IDE:

lazarus

You can also verify the command path:

which lazarus
which lazbuild
fpc -iV

On first launch, Lazarus may build some packages or ask about compiler paths. In most cases, the defaults are fine when installed through Portage.

Code editor on screen

If you are using KDE Plasma, rebuild Lazarus against Qt:

printf "dev-pascal/lazarus qt5 -gtk\n" | sudo tee /etc/portage/package.use/lazarus
sudo emerge --ask --newuse dev-pascal/lazarus

If your system supports Qt6 for this package and you want to try it:

printf "dev-pascal/lazarus qt6 -gtk\n" | sudo tee /etc/portage/package.use/lazarus
sudo emerge --ask --newuse dev-pascal/lazarus

If one widgetset fails, do not fight it for an hour. Switch to the other one and rebuild cleanly.

Modern development desktop

A. Missing compiler source
sudo emerge --ask dev-lang/fpc-source
B. Widgetset mismatch

Rebuild Lazarus after adjusting USE flags. Example for GTK:

printf "dev-pascal/lazarus gtk -qt5 -qt6\n" | sudo tee /etc/portage/package.use/lazarus
sudo emerge --ask --newuse dev-pascal/lazarus
C. Strange package state
sudo emerge --ask --depclean
sudo emerge --ask @world
sudo emerge --ask dev-lang/fpc dev-lang/fpc-source dev-pascal/lazarus
D. Lazarus launches but build tools fail

Check these directly:

lazbuild --version
fpc -i
echo $PATH
E. Permissions or profile drift

Confirm your Gentoo profile, accepted keywords, and overlays are sane before chasing Lazarus-specific ghosts.

Circuit board closeup representing troubleshooting

Run these checks:

lazarus --version || true
lazbuild --version
fpc -iV
equery list dev-pascal/lazarus

If lazbuild and fpc both respond cleanly, the toolchain is generally in good shape.

Good final test: create a new GUI application in Lazarus, build it, and run it from inside the IDE.
Desktop developer environment

Here is the straight-through install sequence:

sudo mkdir -p /etc/portage/package.use

# GTK build
printf "dev-lang/fpc source\n" | sudo tee -a /etc/portage/package.use/lazarus
printf "dev-pascal/lazarus gtk\n" | sudo tee -a /etc/portage/package.use/lazarus

# OR use Qt on Plasma
# printf "dev-lang/fpc source\n" | sudo tee -a /etc/portage/package.use/lazarus
# printf "dev-pascal/lazarus qt5\n" | sudo tee -a /etc/portage/package.use/lazarus

sudo emerge --sync
sudo emerge --ask dev-lang/fpc dev-lang/fpc-source dev-pascal/lazarus
sudo etc-update

which lazarus
which lazbuild
fpc -iV
lazarus
Brooks Computing Systems · Quality, Reliability & Service · Jacksonville
Quality, Reliability & Service
Thank You For Visiting
Brooks Computing Systems - Jacksonville
Visit https://bcs.archman.us