Recent

Author Topic: Providing *.deb files for RaspberryPi Linux  (Read 4520 times)

Gustavo 'Gus' Carreno

  • Hero Member
  • *****
  • Posts: 1112
  • Professional amateur ;-P
Providing *.deb files for RaspberryPi Linux
« on: May 24, 2023, 07:25:12 pm »
Hey distribution team,

Side note: I have no idea if this is the best place to drop this, but I'm guessing the very fine moderators will correct me!!!

Ok, so, from the rumour mill there will be ARM GitHub runners in a not so far future.
When this happens I would like to update my setup-lazarus GitHub action to support linux-arm or linux-aarch64 in it.

For this to happen in the same manner that I'm now supporting Linux, Windows and macOS(Via the binaries provided in Source Forge) I would need a set of .deb binaries for the above mentioned os-arch pairs.

The alternative would be to use fpcup and fpcup-laz, which would be a completely new can of worms to open...

I would much prefer the Source Forge binaries route.

So, my ask is: Are there any plans to facilitate .deb binaries for either linux-arm or linux-aarch64, or both, in the future?

Many thanks in advance!!!

Cheers,
Gus
Lazarus 3.99(main) FPC 3.3.1(main) Ubuntu 23.10 64b Dark Theme
Lazarus 3.0.0(stable) FPC 3.2.2(stable) Ubuntu 23.10 64b Dark Theme
http://github.com/gcarreno

Curt Carpenter

  • Sr. Member
  • ****
  • Posts: 396
Re: Providing *.deb files for RaspberryPi Linux
« Reply #1 on: May 24, 2023, 08:27:43 pm »
Agree with the .deb route.  Creating a package is real work though, and we are all deeply in debt to those who have created the packages we have now.

I wonder if something like a "Go Fund Me" for a project like this would be helpful?     

Easy installation is perhaps the key to growing the FPC/Lazarus user base.  Once you've tried it, I think you're hooked.

PascalDragon

  • Hero Member
  • *****
  • Posts: 5446
  • Compiler Developer
Re: Providing *.deb files for RaspberryPi Linux
« Reply #2 on: May 24, 2023, 10:21:54 pm »
The alternative would be to use fpcup and fpcup-laz, which would be a completely new can of worms to open...

For FPC you can just as well use the distribution independent installer we provide with the downloads.

For Lazarus you can simply download the source and trigger a build using make after all you might want to configure it beforehand anyway.

Gustavo 'Gus' Carreno

  • Hero Member
  • *****
  • Posts: 1112
  • Professional amateur ;-P
Re: Providing *.deb files for RaspberryPi Linux
« Reply #3 on: May 24, 2023, 10:48:23 pm »
Hey Curt Carpenter,

Agree with the .deb route.  Creating a package is real work though, and we are all deeply in debt to those who have created the packages we have now.

I could not agree more and I want to throw my own kudos to the whole team!!!

I wonder if something like a "Go Fund Me" for a project like this would be helpful?     

That is not an unreasonable idea, not it's not !!!

Easy installation is perhaps the key to growing the FPC/Lazarus user base.  Once you've tried it, I think you're hooked.

Again, in complete and total agreement!!!

Cheers,
Gus
Lazarus 3.99(main) FPC 3.3.1(main) Ubuntu 23.10 64b Dark Theme
Lazarus 3.0.0(stable) FPC 3.2.2(stable) Ubuntu 23.10 64b Dark Theme
http://github.com/gcarreno

Gustavo 'Gus' Carreno

  • Hero Member
  • *****
  • Posts: 1112
  • Professional amateur ;-P
Re: Providing *.deb files for RaspberryPi Linux
« Reply #4 on: May 24, 2023, 10:58:33 pm »
Hey PascalDragon

For FPC you can just as well use the distribution independent installer we provide with the downloads.

I'm sorry to plead complete ignorance of this!! Can you point me in it's direction?

For Lazarus you can simply download the source and trigger a build using make after all you might want to configure it beforehand anyway.

Agreed, the download-source-and-trgger-build approach is always feasible...
But my gripe is that I would have to open a complete new can of worms in a language/environment I had so much trouble getting my head around when the system for Linux/Windows/macOS is already working so well!!
For me it would be a complete breeze to actually copy/paste the Linux method, change the appropriate names and, presto, support for ARM(32 or 64 bits)
Having some help from fpcup and fpcup-laz would kinda dampen the can of worms effect, just a tad...
But nothing beats a .deb smooth and clean install, amirite?

And @PascalDragon, sorry to press on, you did not answer my question: Are there any plans for a .deb binary for ARM?

Sorry to be an insisting bastard  :D

Cheers,
Gus
Lazarus 3.99(main) FPC 3.3.1(main) Ubuntu 23.10 64b Dark Theme
Lazarus 3.0.0(stable) FPC 3.2.2(stable) Ubuntu 23.10 64b Dark Theme
http://github.com/gcarreno

TRon

  • Hero Member
  • *****
  • Posts: 2435
Re: Providing *.deb files for RaspberryPi Linux
« Reply #5 on: May 25, 2023, 01:13:43 am »
I'm sorry to plead complete ignorance of this!! Can you point me in it's direction?
I'm sorry for not being PascalDragon.

- Point your browser to: https://sourceforge.net/projects/freepascal/files/Linux/3.2.2/
- Assuming you meant arm download either fpc-3.2.2.arm-linux.tar or fpc-3.2.2.aarch64-linux.tar
- untar the file
- execute the install script
- if you leave all options default then FPC is going to be installed in your home directory.

I personally do not understand the obsession with .deb files which is tied to the OS/distribution. Most package maintainers/distributions do not take care of multiple installations the way it should be and which causes so much headaches that you are better off removing the official package and install it manually. Besides that someone would have to take care (waste time) maintaining such package. Most distributions are a tad slow on updating their packages which end up with users using (very) old versions of Free Pascal and having to do a manual install in order to upgrade.
« Last Edit: May 25, 2023, 01:16:14 am by TRon »

Curt Carpenter

  • Sr. Member
  • ****
  • Posts: 396
Re: Providing *.deb files for RaspberryPi Linux
« Reply #6 on: May 25, 2023, 03:54:24 am »
One of the reasons people (like me) are slow to upgrade and stick with older versions lies in past bad experiences with the upgrade process (and the often cryptic and sometimes seemingly conflicting installation instructions that one can find on the web.).  That and dread of needing to spend a week figuring out why an installation fails and then getting all the options reset to recreate a familiar environment once you succeed with the installation.   

Many of the difficulties are certainly down to ignorance (about both the installation and the OS that will support it), but also down to the fact that upgrading is a relatively infrequent process for some of us, and we forget all the steps and insights we gained in making everything work two years ago.  It's not laziness or failure to RTFM -- it's fear.

My last upgrade used three .deb files and one authoritative guide to installing them.  I was overjoyed.  I think a new user that wants to explore Lazarus for the first time would be overjoyed too, rather than frustrated.  Nothing magic about .debs -- but the simplicity was almost magic.

A clean uninstall process for old versions would be helpful too.

TRon

  • Hero Member
  • *****
  • Posts: 2435
Re: Providing *.deb files for RaspberryPi Linux
« Reply #7 on: May 25, 2023, 05:09:59 am »
@Curt Carpenter,
I get it.

If you are new to FPC or even if you are a seasoned user but never had to deal with such things before then setting up Free Pascal (and Lazarus) properly can be a intimidating process, especially when building from source.

If a .deb package is well structured and works as intended then it is by far one of the most simple and recommended ways to install Free Pascal.

I can't remember when and where exactly but my first experience with using the default distribution package manager got me stumped. I 'selected' to install the Free Pascal package and was expecting that after the installation I would be able to run the fpc executable from a terminal window. For sure that worked... until I wanted to use one of the units that is situated in the fcl library (or any other non system units for that matter) and was prompted by FPC that it could not find the corresponding unit(s).  Turned out that all the units were divided into separate packages that I had to manually install one-by-one. Not even an indication from the package manager to suggest to install all the other dependencies that Free Pascal relies on. How on earth is someone not familiar with FPC able to figure that out ?

To whomever invented such dreadful solution (and yes in hindsight I do get why it was done that way) I want to thank the maintainer of that package as from that day forward I learned how to build FPC from source and as a result never ever again used a package manager to install Free Pascal.

Downloading & extracting a tarball, then running a small script is imho a much simpler process and as a bonus does not rely on any distro specifics. From there it is but a small step to make an alias (or file-link) for the fpc executable, make sure that fpc uses /your chosen/ fpc.cfg file and share that configuration file with all your Free Pascal installations. Although the latter is more my pet beef as I prefer to use a single config file.

Curt Carpenter

  • Sr. Member
  • ****
  • Posts: 396
Re: Providing *.deb files for RaspberryPi Linux
« Reply #8 on: May 25, 2023, 05:12:10 pm »
OK TRon -- you've convinced me that I need to make the investment to learn how to install fpc and lazarus from source.  I don't doubt the effort will make me a better fpc/lazarus user/enthusiast if I can master the process, so I'll give it a go starting Monday. 

Do you have any advice you can share on what I should do to prepare/read before I start?  (I'll be trying the install on a 64-bit Linux box (Ubuntu) with Lazarus 2.2.4 and FPC 3.2.2 currently installed.)   Any pointers and links about getting started would be welcomed and appreciated.


Gustavo 'Gus' Carreno

  • Hero Member
  • *****
  • Posts: 1112
  • Professional amateur ;-P
Re: Providing *.deb files for RaspberryPi Linux
« Reply #9 on: May 26, 2023, 01:16:51 am »
Hey TRon,

- Point your browser to: https://sourceforge.net/projects/freepascal/files/Linux/3.2.2/
- Assuming you meant arm download either fpc-3.2.2.arm-linux.tar or fpc-3.2.2.aarch64-linux.tar

This is exactly what I was asking for and I thank thee from the bottom of my heart!!!

I would also need the Lazarus end of it but from your answer I'll have a better look at all the files that are present in Source Forge since I missed this while being right in front of my nose  :-[

Cheers,
Gus
Lazarus 3.99(main) FPC 3.3.1(main) Ubuntu 23.10 64b Dark Theme
Lazarus 3.0.0(stable) FPC 3.2.2(stable) Ubuntu 23.10 64b Dark Theme
http://github.com/gcarreno

Gustavo 'Gus' Carreno

  • Hero Member
  • *****
  • Posts: 1112
  • Professional amateur ;-P
Re: Providing *.deb files for RaspberryPi Linux
« Reply #10 on: May 26, 2023, 02:16:53 am »
Hey Curt Carpenter,

I feel your pain. I, myself, have had some of the issues you've mentioned in the past.

While doing a small detour from the intent of this thread, here's my personal point of view in terms of the many ways that Lazarus/FPC can be installed.

IMPORTANT: Please remember that these are my personal points of view!! They do not reflect a complete knowledge of the many systems involved in all this. Please be kind when criticising any of my most obvious mistakes. Thanks!!

First lets have a, somewhat comprehensive, list of them:
(Anyone please correct me if my lists are not complete)

Linux
  • From source
  • From the repository of your Linux distribution
  • From the packages provided at Source Forge
  • Using fpcupdeluxe
  • Using the pair fpcup/fpclazup

Windows
  • From source
  • From the packages provided at Source Forge
  • Using fpcupdeluxe
  • Using the pair fpcup/fpclazup

Now for my opinion on how the stack up in terms of difficulty:

Linux

In Linux first, since that's where I "live" now, ever since I ditched Windows more than 10 years ago.

The easiest way under Linux is using the distribution repository. It's also the worst one since, as mentioned, they have very old versions of Lazarus/FPC. For a junior Linux user this will be present in the "Store" app of your distribution and makes it easy for those that have command line phobia. This is a system wide install.

The next best way is using the packages in either .deb or .rpm flavour provided on Source Forge. For a medium Linux user, downloading and installing these is not that hard. This is a system wide install.

The above mentioned methods are easy for any junior to senior Linux users with slim to no knowledge of Lazarus/FPC. The following ones require a bit more knowledge of how things are setup in Lazarus/FPC land.

Next we have the fpcupdeluxe way. This is what I'm using at the moment and it ticks a lot of my needs in terms of updatability and having multiple version pairs of Lazarus/FPC to play with in parallel. And because fpcupdeluxe allows you to install every version pair in it's own folder, all is contained in it. This is not a system wide install.

Then we have the fpcup and fpclazup option. These are command line only apps. Actually, fpcupdeluxe embeds these in it's code and provides the GUI niceness to access them. Due to the fact that it's a command line only option, one has to be very familiar with all the switches for these apps. This is not a system wide install.

Then, at last, we have the option to install from source. I myself have never attempted this, mainly due to the fact that once I found fpcupdeluxe, that does all these steps automatically for me to install from source, I've never had the use for it. This can or cannot be a system wide install. Depends on where you install it.

Windows

The levels of difficulty in Windows are the same as above. Maybe system wide is a bit different in Windows, since if you have Lazarus/FPC on your PATH env it can be considered "system wide".

The easiest way is, of course, using the setup binaries provided at Source Forge.

The hardest, obviously, being installing from source since you have to install all pre-requisites for compiling Lazarus/FPC like having GIT, MAKE, LN, GDB and so many other command line tools that are needed to compile Lazarus/FPC and then use it.

Hope that this helps you to better understand all the options available, and their difficulty level, for installing and using Lazarus/FPC.

Cheer,
Gus


fpcupdeluxe: https://github.com/LongDirtyAnimAlf/fpcupdeluxe
fpcup/fpclazup: https://github.com/LongDirtyAnimAlf/Reiniero-fpcup
« Last Edit: May 26, 2023, 02:23:31 am by Gustavo 'Gus' Carreno »
Lazarus 3.99(main) FPC 3.3.1(main) Ubuntu 23.10 64b Dark Theme
Lazarus 3.0.0(stable) FPC 3.2.2(stable) Ubuntu 23.10 64b Dark Theme
http://github.com/gcarreno

PascalDragon

  • Hero Member
  • *****
  • Posts: 5446
  • Compiler Developer
Re: Providing *.deb files for RaspberryPi Linux
« Reply #11 on: May 26, 2023, 09:49:26 pm »
I'm sorry to plead complete ignorance of this!! Can you point me in it's direction?

Seems like TRon was quicker 😅

And @PascalDragon, sorry to press on, you did not answer my question: Are there any plans for a .deb binary for ARM?

Generating packages is annoying and they only allow global installations. Our main method of distribution (pun not intended) on Linux that isn't part of the distribution's package manager is the tar archive with it's installer as that easily allows the installation of multiple versions.

The next best way is using the packages in either .deb or .rpm flavour provided on Source Forge. For a medium Linux user, downloading and installing these is not that hard. This is a system wide install.

You forgot the distribution independant tar installer. That can be system wide or private depending on the settings you provide to the installer.

TRon

  • Hero Member
  • *****
  • Posts: 2435
Re: Providing *.deb files for RaspberryPi Linux
« Reply #12 on: May 27, 2023, 11:57:39 am »
OK TRon -- you've convinced me that I need to make the investment to learn how to install fpc and lazarus from source.  I don't doubt the effort will make me a better fpc/lazarus user/enthusiast if I can master the process, so I'll give it a go starting Monday. 
Although it is not my place to make you do anything I can tell you that it is worth the investment but it depends a little on what you do (or can do) with the obtained knowledge. I mainly use FPC to cross compile and/or create the compiler to/for obscure targets so I need to know what I am doing (*cough* famous last words because 90 percent of the time I have no clue :D )

Having the knowledge so far has let me "install" at least FPC on systems/setups that are restrictive and/or pristine without any additional requirements (other then those required to be able to execute the FPC executable).

Quote
Do you have any advice you can share on what I should do to prepare/read before I start?  (I'll be trying the install on a 64-bit Linux box (Ubuntu) with Lazarus 2.2.4 and FPC 3.2.2 currently installed.)   Any pointers and links about getting started would be welcomed and appreciated.
Sorry for the delay. A small attempt:

In preparation you could read:
- buildfaq: https://wiki.freepascal.org/buildfaq
- Installing the Free Pascal compiler wiki article: https://wiki.freepascal.org/Installing_the_Free_Pascal_Compiler in particular https://wiki.freepascal.org/Installing_the_Free_Pascal_Compiler#Linux
- Getting Lazarus wiki article: https://wiki.lazarus.freepascal.org/Getting_Lazarus
- fpc.cfg configuration file wiki article: https://wiki.freepascal.org/Configuration_file
- fpc.cfg file chapter official documentation: https://www.freepascal.org/docs-html/user/usersu10.html
- Multiple lazarus wiki article: https://wiki.freepascal.org/Multiple_Lazarus
- Lazarus pcp (Primary Config Path) wiki article:  https://wiki.freepascal.org/pcp

Other preparations:
- have the gnu binutils installed (linker, assembler, make etc.). You probably already have done that otherwise you would have a difficult time compiling with Free Pascal/Lazarus right now :-)
- make sure to backup your current configurations of Free Pascal / Lazarus (see also pitfalls)
- if possible (if only for experiment purpose) try to build on a separate machine (where it does not mater if you mess things up)/VM (see previous point).
- If you try to build on machine that does not have FPC installed then you need a startup compiler. You can obtain it from the tarball for your build computer and extract the ppc executable (only that single executable is required). In that case you need to provide the PP option to the make instruction when you want to build the compiler.

Pitfalls:
- If you use the makefile to install the compiled result (make install) then /do not install system wide/ as it will conflict with your current installation (and figuring out the details to fix that is a PITA if you do not know where to look for). That is why I personally always build in a ramdisk and "install" it there too (The result can be copied to anywhere provided that you keep in mind the fpc.cfg options that use an absolute path -> that can be made more comfortable as well if required but requires manual labour).
- If you want to build the compiler for another platform (cross compilation) then you need additional gnu binutils installed on your build-machine that supports the target processor.

Decisions:
- decide whether you want to download the required (source) files using prepared archive files on sourceforge/ftp or if you want to use git. If you are unfamiliar with git then that is a topic on its own. I would advise to initially go the easy route and download the archives in that case.


If you are confident that you can build things as intended then it is time to make some decision about how to setup your build machine so that it is able to host all your installations in a proper way. That means decision time again:
- where do you want your compiler(s) and/or Lazarus(') to be located
- do you want to be able to run multiple installations of FPC and/or Lazarus ? (Usually one does because why bother with this process to begin with and it is always nice to be able to compile with the Free Pascal (3.3.1) compiler from trunk).

Depending on your preference, different paths would need to be taken. An overall (system wide) single installation is of course the easiest route there as hosting multiple versions of the Lazarus IDE and FPC requires additional (manual) setup/configuration. Most of that depends on the distribution you use and how comfortable you want to have things setup on your machine.

Any question you might have (please do feel free to ask) is probably worth another thread e.g. separated from this one in order to not derail.
« Last Edit: May 27, 2023, 12:00:31 pm by TRon »

Bi0T1N

  • Jr. Member
  • **
  • Posts: 85
Re: Providing *.deb files for RaspberryPi Linux
« Reply #13 on: May 27, 2023, 07:05:35 pm »
Docker to the rescue! ;D
You only need to install Lazarus on top, please also consider a contribution.

Curt Carpenter

  • Sr. Member
  • ****
  • Posts: 396
Re: Providing *.deb files for RaspberryPi Linux
« Reply #14 on: May 27, 2023, 08:32:50 pm »
Gustavo and TRon, I appreciate the inputs, and am working through the reading you've suggested, downloading the .targz files to a backup PC and doing a trial FPC install from source with the .sh script provided (worked fine).  I think to really understand what's involved though, I'm going to have to try to understand the Bash scripts that do the magic, and that's going to take some study time.   The aim is to get beyond the automation -- which is great until it doesn't work perfectly.  (Which it often does of course -- thank goodness.)
 
Along the way, I tried using fpcupdeluxe to do a lazarus install to the test machine, and it also worked very well, leaving a non-system-wide working Lazarus in a directory of my choice.  But there were problems after the install (for example:  lazarus package manager couldn't install the Online Package Manager) and I think I won't really understand how to solve those sorts of issues until I understand the install process in a lot more detail.

I'll continue to work on this, but have a lot to learn.  Agree that it's probably a long-overdue investment on my part though. 

I will check out Docker which looks interesting, but right now I'm trying to get free of the magic (that has served me very well for a long time, I should add!)

 

TinyPortal © 2005-2018