[Lazarus] Can I rebuild Lazarus installed via apt on an RPi4B?

Bo Berglund bo.berglund at gmail.com
Thu Dec 7 11:22:59 CET 2023


On Thu, 7 Dec 2023 00:34:01 +0100, Mattias Gaertner via lazarus
<lazarus at lists.lazarus-ide.org> wrote:

>
>
>On 07.12.23 00:05, Bo Berglund via lazarus wrote:
>> Since every customization of Lazarus means the IDE must be rebuilt it also means
>> that Lazarus must be installed where the current user has permissions to do
>> that.
>> 
>> But when installing stuff via sudo apt install package it normally gets into
>> read-only locations, right?
>
>Yes, this is a multi user installation.

My post was done at midnight so I could not test further. But today I checked on
a 32 bit bookworm RPi4B to install lazarus via apt (not sudo apt) and I found
that it complains about not being root, so that route seems to be closed.
Also looked at the /usr/bin dir and it is owned by root so no chance of
installing as a user there...

I thought that perhaps when running apt without sudo it would change install
path to something inside the $HOME location, but apparently not...

>
>> So how does this work?
>
>Lazarus tests before compiling a package if the output directory is 
>writable and if not redirects to a sub directory of its config directory.
>This is a feature of the IDE and lazbuild.
>The makefiles do not support this, so a "make" fails.

So to rebuild Lazarus from the command line I should use lazbuild, right?
What arguments are needed for lazbuild?

I looked here: https://wiki.lazarus.freepascal.org/lazbuild

So will this be sufficient:

lazbuild --build-ide="Normal IDE" --pcp="$HOME/.lazarus_2.2.6"
--compiler=$HOME/bin/ppcarm

...
If I use sudo apt install lazarus, will that also pull fpc as a dependency or
should I use:

 sudo apt install fpc lazarus

instead?
And what about the lazarus sources, are they pulled in as well with the sudo apt
install lazarus command?


>If you want to compile lazarus with make, use a git clone of the lazarus 
>repository.
>

I have been building Fpc/Lazarus from sources since many years, also tested
fpcupdeluxe a few times. So getting/using the sources is known.

I usually download the tarballs with a release tag from gitlab using wget.
After I have built fpc and symlinked into $HOME/bin I build Lazarus like this:

cd $HOME/devtools/lazarus/2.2.6/
make clean PP=$HOME/bin/ppcarm && make bigide PP=$HOME/bin/ppcarm

I create a separate $HOME/.lazarus_2.2.x config dir and specify that in the
desktop file as the --pcp= argument.

Now when I am checking the various new versions of Raspberry Pi and the Pi-OS
(bullseye-bookworm, 32-64 bit, RPi4B-RPi5B etc) it leads to many iterations in
the fpc/lazarus installs...

I have been looking for a simpler way still allowing for having several versions
of Lazarus/fpc and it led me to look at fpcupdeluxe. But that tool was probably
not ready for the new stuff on RPi so it failed to work properly.

New fpc?
Being able to upgrade fpc on the side without disruption of Lazarus is also an
issue for me, is there some setting/config within the pcp directory that I can
change to point Lazarus to a new fpc compiler and it will then be possible to
rebuild Lazarus with that new compiler?

And what about day-to-day project compiles if I want to use the new compiler?
Is it as simple as changing the symlink of $HOME/bin/ppcarm to point to the new
compiler? It would affect all user installs utilizing the ppcarm compiler.


-- 
Bo Berglund
Developer in Sweden



More information about the lazarus mailing list