Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2023-12

Can I rebuild Lazarus installed via apt on an RPi4B?

5 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Bo Berglund

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?

So how does this work?

I have trouble installing from sources on a PiOS bookworm 32 bit system, so I figured I could get it via apt. But that is only an option if I can somehow add the packages I need into Lazarus...

I get this on a 32 bit system:

$ apt policy lazarus
lazarus:
Installed: (none)
Candidate: 2.2.6+dfsg2-2
Version table:
2.2.6+dfsg2-2 500
500 http://raspbian.raspberrypi.com/raspbian bookworm/main armhf Packages

And on a 64 bit system like this:

$ apt policy lazarus
lazarus:
Installed: (none)
Candidate: 2.2.6+dfsg2-2
Version table:
2.2.6+dfsg2-2 500
500 http://deb.debian.org/debian bookworm/main arm64 Packages 500 http://deb.debian.org/debian bookworm/main armhf Packages

Bo Berglund Developer in Sweden

Reply by email

Mattias Gaertner
to Bo Berglund
Bo Berglund wrote 6 lines
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.

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. If you want to compile lazarus with make, use a git clone of the lazarus repository.

[...]

Mattias

Reply by email

Bo Berglund
to Mattias Gaertner
Mattias Gaertner wrote 11 lines
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...

Show quoted text 7 lines
> 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 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

Reply by email

Mattias Gaertner
to Bo Berglund
Bo Berglund wrote
[...] Also looked at the /usr/bin dir and it is owned by root so no chance of installing as a user there...

Yes, see
https://en.wikipedia.org/wiki/Filesystem_Hierarchy_Standard

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

You can extract a debian package anywhere, but you can install it only as root to fixed folders.

Show quoted text 16 lines
>> 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

Seeing all your experiments I don't know if it is sufficient for you. It sounds right.
Although if you don't want to use the defaults, then I recommend to *not* install Lazarus from apt, but simply download the git, create a lazarus.cfg and "make clean all".

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

Yes.

Show quoted text 8 lines
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?

Yes.

Show quoted text 9 lines
[...] 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

Shorter:
make clean bigide PP=$HOME/bin/ppcarm

Show quoted text 5 lines
[...] > 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?

For compiling your project set the compiler in Project Options. Use build modes for multiple platforms.
For compiling the IDE with different fpc versions, install the fpc sources in paths that only differ in version number, so you can use the IDE macro $(FPCVer). Then you can easily switch the used fpc in Tools / Options / Env / Files.

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.

Using build modes sounds easier.

Mattias

Reply by email

Salvatore Coppola
to Mattias Gaertner

A simple way to get lazarus compiled from source:
1. Install the right fpc via packages;
2. Compile lazarus from source via makefile

Salvatore

?Ottieni BlueMail per Android ?

Il giorno 7 Dic 2023, 11:50, alle ore 11:50, Mattias Gaertner via lazarus ha scritto:

Show quoted text 117 lines
On 07.12.23 11:22, Bo Berglund via lazarus wrote: >[...] > Also looked at the /usr/bin dir and it is owned by root so no chance of > installing as a user there... Yes, see https://en.wikipedia.org/wiki/Filesystem_Hierarchy_Standard > I thought that perhaps when running apt without sudo it would change install > path to something inside the $HOME location, but apparently not... You can extract a debian package anywhere, but you can install it only as root to fixed folders. >>> 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 Seeing all your experiments I don't know if it is sufficient for you. It sounds right. Although if you don't want to use the defaults, then I recommend to *not* install Lazarus from apt, but simply download the git, create a lazarus.cfg and "make clean all". > ... > If I use sudo apt install lazarus, will that also pull fpc as a dependency Yes. > 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? Yes. >[...] > 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 Shorter: make clean bigide PP=$HOME/bin/ppcarm >[...] > 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? For compiling your project set the compiler in Project Options. Use build modes for multiple platforms. For compiling the IDE with different fpc versions, install the fpc sources in paths that only differ in version number, so you can use the IDE macro $(FPCVer). Then you can easily switch the used fpc in Tools / Options / Env / Files. > 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. Using build modes sounds easier. Mattias -- _______________________________________________ lazarus mailing list https://lists.lazarus-ide.org/listinfo/lazarus

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20231209/16ea32f7/attachment.htm>

Reply by email