Recent

Author Topic: Portable verion of FPC and Lazarus  (Read 1617 times)

backprop

  • Full Member
  • ***
  • Posts: 236
Portable verion of FPC and Lazarus
« on: May 19, 2026, 07:25:02 am »
I would like to have portable version of FPC and Lazarus. If not possible to create AppImage, at least to have portable version I can run anywhere, which will not create config files to local SSD, etc. Simply to run  isolated and with all dependent files necessary to run at KDE and Gnome with necessary libraries from OPM and third party ones.

Is that planned at all or existed highly customized way to achive it?

P.S. I do not need AI created reply here, but from devs or CEOs who knows exactly what they doing and what will work according to initial need. I do not want AI "halucinated" messy replies have no clue what both projects can do with in the latest versions.
« Last Edit: May 19, 2026, 09:59:38 am by backprop »

Thausand

  • Hero Member
  • *****
  • Posts: 560
Re: Portable verion of FPC and Lazarus
« Reply #1 on: May 19, 2026, 10:21:09 am »
Is that planned at all or existed highly customized way to achive it?
fpcupdeluxe is good start for how can make: https://wiki.freepascal.org/fpcupdeluxe
A docile goblin always follow HERMES.md


rvk

  • Hero Member
  • *****
  • Posts: 7045
Re: Portable verion of FPC and Lazarus
« Reply #3 on: May 19, 2026, 11:04:35 am »
@backprop You also might want to clarify... do you want real portability or do you just want a install that doesn't touch your SSD drive?

Lazarus and FPC itself are already highly customizable regarding location of the installation and config files.
You can specify locations in .cfg files so it doesn't touch anything you don't want.

All Some mentioned methods above install it like that.

But for real portability you would want to move the complete installation from say /home/mememe to /home/youyou and still have it working correctly. For that, all paths in the cfg files would need to be relative. I'm not sure if that works for everything... (that's why I asked for you to clarify).

For anyone else answering... keep that in mind.

LeP

  • Sr. Member
  • ****
  • Posts: 331
Re: Portable verion of FPC and Lazarus
« Reply #4 on: May 19, 2026, 11:53:40 am »
It's real possible to do this in Linux ?

FPC and Lazarus require external libraries to run (e.g., GTK, QT, SSL, libc, and others I'm not familiar with) on Linux, as well as probably on Windows for samething else.
Without a Docker or a VM, I don't think it's feasible.

I'm curious ....
Un Sistema per domarli, un IDE per trovarli, un codice per ghermirli e nel framework incatenarli.
An operating system to tame them, an IDE to find them, a code to catch them and in the framework chain them.

Thausand

  • Hero Member
  • *****
  • Posts: 560
Re: Portable verion of FPC and Lazarus
« Reply #5 on: May 19, 2026, 01:12:19 pm »
It's real possible to do this in Linux ?
Yes.

Quote
FPC and Lazarus require external libraries to run (e.g., GTK, QT, SSL, libc, and others I'm not familiar with) on Linux, as well as probably on Windows for samething else.
Without a Docker or a VM, I don't think it's feasible.
How not smart is for want run GUI application when OS not have GUI ? Yes, then need xwindows, wayland, all library etc. same true for libc (btw: can have musl)

Is same for want run database and not have install database. Or want networking and not have network install for OS. It is dependency for program and dependency is same for Lazarus. Is possible for make have less dependency for application (lazarus) and not have need for many dependency (example fpgui, mse) but that many work.

Docker or snap is solution (there many more ?) for complete solution (not smart solution imho).

Quote
I'm curious ....
I want have my car fly... now curious what is need for make car fly. Same problem.
A docile goblin always follow HERMES.md

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 12899
  • FPC developer.
Re: Portable verion of FPC and Lazarus
« Reply #6 on: May 19, 2026, 01:30:22 pm »
FPC and Lazarus require external libraries to run (e.g., GTK, QT, SSL, libc, and others I'm not familiar with) on Linux.

Lazarus does. FPC and fpc binaries don't.   

Quote
marcov:~/bin$ ldd fpc
        not a dynamic executable
marcov:~/bin$ ldd ppcx64
        not a dynamic executable

Creating binaries might need glibc-devel, (for crtbegin.o and crtend.o etc), though I'm not 100% sure nowadays.

Thaddy

  • Hero Member
  • *****
  • Posts: 19268
  • Glad to be alive.
Re: Portable verion of FPC and Lazarus
« Reply #7 on: May 19, 2026, 02:49:48 pm »
@Marcov,

FPC needs build-essential installed on Linux, if only to resolve crtbegin/end and the tools (make, ld, as, all of which are not default)
That is not installed by default on many user friendly distro's, but most development machines need that, not only FPC.
For FPC you only need everything that is in the fp-compiler package (will install ONLY the compiler, no packages) in Debian and that will install build-essential too. I don't know if it works the same on non-Debian derived Linux systems.
FPC itself is quite easy to do on Linux, provided the above. There is only one fpc.cfg and that can be included as a resource and read from memory. You can even skip that if you accept you have to create longer compile command lines.
Otherwise FPC only need libraries you actually use, like openssl etc. including their -dev packages.

Lazarus in Linux is a completely different story and much more difficult to pack as a portable app.
(Would require X - which is contrary to common belief not a requirement - , GTK2,3,4,5, Qt3,4,5,6 just to support the most common GUI frameworks in the same distro, which makes it huge)

I would go for a docker solution, and that already exists.
« Last Edit: May 19, 2026, 03:15:58 pm by Thaddy »
objects are fine constructs. You can even initialize them with constructors.

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 12899
  • FPC developer.
Re: Portable verion of FPC and Lazarus
« Reply #8 on: May 19, 2026, 03:51:57 pm »
@Marcov,

FPC needs build-essential installed on Linux

No, that is just easiest. It installs a bunch of packages, including gcc, which is not needed.

In the past it was only binutils and make, but as said maybe there is some crtbegin/crtend needed. But maybe that is only needed when you start linking to libraries, not for small potato stuff. I haven't had a bare bones system in years, ever since SD cards started getting larger, and you didn't need it on rpi and similar systems.


Thaddy

  • Hero Member
  • *****
  • Posts: 19268
  • Glad to be alive.
Re: Portable verion of FPC and Lazarus
« Reply #9 on: May 19, 2026, 04:14:31 pm »
Yeah, you can always copy out just crtbegin/end from a GNU distribution, that is true.
Leaves out the tooling..... ld,as,make and a couple more.
Certainly the internal linker does not support everything.
objects are fine constructs. You can even initialize them with constructors.

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 12899
  • FPC developer.
Re: Portable verion of FPC and Lazarus
« Reply #10 on: May 19, 2026, 04:33:32 pm »
Yeah, you can always copy out just crtbegin/end from a GNU distribution, that is true.

No just install a few packages rather than one big meta package. As said "binutils" "make" and "glibc-devel" probably go a long way.

Thausand

  • Hero Member
  • *****
  • Posts: 560
Re: Portable verion of FPC and Lazarus
« Reply #11 on: May 19, 2026, 04:42:54 pm »
No just install a few packages rather than one big meta package. As said "binutils" "make" and "glibc-devel" probably go a long way.
I think there one except and is when want build self or is require more new binutils because (example) target is require patch. Then is more easy for install gcc/build-essential. Yes, most user can make simple and use package.
A docile goblin always follow HERMES.md

Fred vS

  • Hero Member
  • *****
  • Posts: 3944
    • StrumPract is the musicians best friend
Re: Portable verion of FPC and Lazarus
« Reply #12 on: May 19, 2026, 05:11:11 pm »
You may use fpc-ootb, nothing is installed on the system and fpc.cfg is loaded from the folder of binary of fpc, so out-of-the box from a usb stick.
https://github.com/fredvs/freepascal-ootb/releases/
I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

backprop

  • Full Member
  • ***
  • Posts: 236
Re: Portable verion of FPC and Lazarus
« Reply #13 on: May 19, 2026, 06:54:32 pm »
Scenario 1: Working PC with KDE and Gnome (Kubunt and Ubuntu, for instance). Here are plainly installed FPC and Lazarus and all dependencise. Howerver, I would prefer to move FPC and Lazarus on HDD and avoid any writing to SSD, which assume reinstalling entire Lazarus whenever new components is installed or when some compiler parameters are changed for desired release or debugging.

Scenario 2: Entriely portable version on flash disk which contain all necessary files to run it without any installation, isolated, on any other linux machines, not specifically prepared for development. Practically as live, snap version. That assume build-essential etc, and many dev package files. Basically, Lazarus is primarily compiled for GTK2, as GTK3 is still not completed. However, version with Qt5 also can be compiled (Qt6 is not free anymore) and all that also can be an option...

But main point is not to touch SSD at all, not during rebuilding (.local or whatever is now), compiling, nor to mess with config files in .config on SSD. And when started from flash disk, to save on virtual disk (memory) and not to mess with local SSD nor HDD.

Compilers create enourmous impact on SSD, less than cache of browsers (which can be totally avoided/disabled), but still we have enormous transfer rate, thus lifespan of SSD will be quite fast reached.
« Last Edit: May 19, 2026, 07:29:11 pm by backprop »

Thausand

  • Hero Member
  • *****
  • Posts: 560
Re: Portable verion of FPC and Lazarus
« Reply #14 on: May 19, 2026, 07:08:35 pm »
@backprop
Then have fpcupdeluxe for install and have configure compiler output result to virtual memory.
A docile goblin always follow HERMES.md

 

TinyPortal © 2005-2018