Recent

Author Topic: Are Linux distro packages broken or is the issue with Lazarus itself?  (Read 880 times)

oldcastle

  • New member
  • *
  • Posts: 8
Hi!

I'm new here and to Lazarus. I noticed that most (if not all) distros install Lazarus on /usr/lib/lazarus, which doesn't allow me to make changes because of users permissions. So, if I want to make changes, I would need to start Lazarus as root, which is not a good idea.

So, my question is why do distros create the Lazarus package that way? Is this the only way to go, or is a Lazarus "flaw"? Any tips on how to fix this issue?

Thank you!

Bart

  • Hero Member
  • *****
  • Posts: 4747
    • Bart en Mariska's Webstek
Re: Are Linux distro packages broken or is the issue with Lazarus itself?
« Reply #1 on: April 16, 2022, 11:06:19 am »
Distro packages are for "normal" users (who just want to program their own code and not develop Lazarus itself).
If you want to make changes to Lazarus yourself, then build Lazarus from source:
Get he source from git (main or 2.2.0)
Put it somewhere in your home directory (I use ~/devel/lazarus)
cd to the source directory
do a "make bigide" (or make bigide OPT="-gl" if you want to enable line info in Lazarus itself for easier debugging)
Use the startlazarus executable there to start the IDE.
First time you need to pint Lazarus to the fpc sources (and maybe to the compiler and make binaries).

Now you can change lazarus and simply rebuild.

Sounds complicated but is, even for a linux novie like me, rather simple and starigh forward.

Bart

oldcastle

  • New member
  • *
  • Posts: 8
Re: Are Linux distro packages broken or is the issue with Lazarus itself?
« Reply #2 on: April 16, 2022, 01:54:29 pm »
Thanks for your reply. But how about installing new Lazarus packages. For example: https://github.com/FlKo/LazarusDockedDesktops#how-to-install or https://www.youtube.com/watch?v=Y8O7yG2u8_M. Those changes I cannot make too, right?

MarkMLl

  • Hero Member
  • *****
  • Posts: 5150
Re: Are Linux distro packages broken or is the issue with Lazarus itself?
« Reply #3 on: April 16, 2022, 06:00:30 pm »
What's wrong with using the instructions in the Github link you've posted?

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

oldcastle

  • New member
  • *
  • Posts: 8
Re: Are Linux distro packages broken or is the issue with Lazarus itself?
« Reply #4 on: April 16, 2022, 07:36:38 pm »
That's what I'm trying to get my head around. So, for "normal" development, I just use Lazarus as it is. But, if I want to make any change to Lazarus itself, then I invoke it as root and save the changes. After that, I go back to use Lazarus as a normal user. Am I right?

MarkMLl

  • Hero Member
  • *****
  • Posts: 5150
Re: Are Linux distro packages broken or is the issue with Lazarus itself?
« Reply #5 on: April 16, 2022, 07:57:09 pm »
Simply install Lazarus as "yourself". There's plenty about this in the Wiki etc., but here's what I do.

If working on a new machine, I D/L the FPC binaries and install as root in /usr/local. Then I recompile from scratch and make sure the binaries are in e.g. /usr/local/bin/fpc.d/3.2.2 with minimal files copied to /usr/local/bin... you don't need to do this but I like to have several different versions available.

Then as root create e.g. /usr/local/share/lazarus-stable, and chown it to yourself. Copy the Lazarus sources into that, and build as described. After that you have full control of what's done with that instance. You could, as an alternative, obviously put it somewhere in ~, just make sure that the binaries (lazarus, startlazarus, lazbuild) are on the path.

I emphasise that that's my personal modus operandi and there's almost certainly people to whom it's anathema. But it's done me well for 10+ years.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 10290
  • FPC developer.
Re: Are Linux distro packages broken or is the issue with Lazarus itself?
« Reply #6 on: April 16, 2022, 08:58:03 pm »
Afaik many distros allow to also do local package installations for one user only. Most global paths then get directed to some ~/prefix.

dbannon

  • Hero Member
  • *****
  • Posts: 2077
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Are Linux distro packages broken or is the issue with Lazarus itself?
« Reply #7 on: April 17, 2022, 02:49:23 am »
Yes, its possible to install a deb package in a directory determine by yourself. You need to download the package and use dpkg rather than apt. Honestly, its a very risky thing to do, especially if the package puts some things in unexpected places. I very, very strongly recommend against it. (no, I will not give you the command line, its the wrong thing to do).

Bart gave the first and correct answer, install Lazarus from source. Only the most superficial usage will work with a package installed version. So, use the package to try it out, see if you like the feel and can handle the syntax. Maybe do a school project. Then, remove at least Lazarus and build your own. It does not need to be "installed", built it and use it directly.

https://wiki.freepascal.org/Installing_Lazarus_on_Linux

Davo
Lazarus 2, Linux (and reluctantly Win10, OSX)
My Project - https://github.com/tomboy-notes/tomboy-ng

MarkMLl

  • Hero Member
  • *****
  • Posts: 5150
Re: Are Linux distro packages broken or is the issue with Lazarus itself?
« Reply #8 on: April 17, 2022, 10:33:29 am »
I suspect that Marco meant that some distreaux specifically allow per-user package installation. I've not seen such but I've been focussed on Debian for... years, and my suspicion is that these days most people brush that sort of thing under the carpet on the assumption that Docker etc. can handle it.

The problem with dpkg is that it puts /everything/ relative to the specified root: there's no concept of "this part /must/ be global... this part /may/ be in opt or local... this part /might/ be per user".

I think the important things are that (a) by and large, an FPC installation can be read-only and the important files are kept separate by version number and (b) a Lazarus installation can't realistically be read-only since package installation tends to be intrusive.

FPC configuration files etc. have a high degree of backward-compatibility. Lazarus is somewhat less tolerant, and in practice I use the --primary-config-path option to keep different versions separate... and in fact to keep "pure" variants separate from those that OLPM have fiddled with since I don't entirely trust it.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

 

TinyPortal © 2005-2018