# Installation of Lazarus on FreeBSD 13



## allu62 (Nov 1, 2022)

Hi. I'm actually playing around with VMware virtual machines and one of the software packages I try to install on each of them is Lazarus/Free Pascal. No major problems on macOS, nor on a dozen of Linux distributions. But, on FreeBSD, it seems to be nothing else then a lose of time.

My system is FreeBSD 13.0 64bit with KDE Plasma desktop. I did not succeed in updating the system (using pkg). Error: Repository FreeBSD contains packages for wrong OS version. I got this same error when trying to install Lazarus. Setting IGNORE_OSVERSION=yes, Lazarus installed, but when rebooting the machine, KDE did not start up anymore (I think here again there is a version problem with VMware drivers and/or KDE). Finally, I installed Lazarus via the ports. This went well (Lazarus version installed = 2.0.10), all components found, the IDE starts up. But, not possible to build applications. Error: /bin/ld.bfd not found. I tried to install binutils, what also ended with an error...

No idea, why I spend hours with an installation, that I don't need on an OS that I don't need. Maybe, because I'm not willing to believe that FreeBSD only works as a server system and that it couldn't be possible that an intermediate user could use it as they use some Linux distribution. Greatful for any help or suggestions. A nice day to everyone!


----------



## SirDice (Nov 1, 2022)

allu62 said:


> My system is FreeBSD 13.0


FreeBSD 13.0 is End-of-Life and not supported anymore.



allu62 said:


> Error: Repository FreeBSD contains packages for wrong OS version.


Packages are built for 13.1 because 13.0 is end-of-life. Packages built for 13.1 do not work on 13.0. 



allu62 said:


> Setting IGNORE_OSVERSION=yes,


Don't do that. You're getting that error for a reason.



allu62 said:


> Greatful for any help or suggestions.


Upgrade to a _supported_ version, which is 13.1 at this time.


----------



## Keve (Nov 1, 2022)

I tried Lazarus a couple of years ago. I did not spend much time with it on anything else other than Windows, because it kept crashing on every other platform (tried OS X, FreeBSD, Linux).


----------



## tingo (Nov 1, 2022)

FWIW, Lazurus (and Free Pascal) works fine on FreeBSD and has done so for quite a few releases now.


----------



## allu62 (Nov 2, 2022)

> SirDice said:
> 
> 
> > FreeBSD 13.0 is End-of-Life and not supported anymore.


Sorry, I didn't know. And I'm surprised that it's not possible to use a no more supported OS. Doing so works well with old (and very old) Windows versions, also with Linux. Is this BSD/UNIX specific? For security and stability reasons?



Keve said:


> I tried Lazarus a couple of years ago. I did not spend much time with it on anything else other than Windows, because it kept crashing on every other platform (tried OS X, FreeBSD, Linux).


Maybe that installation is sometimes tricky, but I amsuccessfully running Lazarus on macOS, a dozen of Linux distributions and also on FreeDOS. The only problem, I see, is that some components behave completely differently and thus, some of my applications, developped on Windows, do not work correctly on Linux.

Anyway, thanks for this really fast reply. That's a more than positive sign. And it makes it worth to continue spending time with FreeBSD. I will try to upgrade to 13.1 in the next days and retry Lazarus. Thanks again.


----------



## SirDice (Nov 2, 2022)

allu62 said:


> Doing so works well with old (and very old) Windows versions, also with Linux.


Not supported though, in either case. So if you have problems you're on your own.



allu62 said:


> I will try to upgrade to 13.1 in the next days


You might be surprised how easy this is.


----------



## Crivens (Nov 2, 2022)

Last time I tried, fpcupdeluxe was happily building fpc and lazarus from the git repos without any problems.


allu62 said:


> Maybe that installation is sometimes tricky, but I amsuccessfully running Lazarus on macOS, a dozen of Linux distributions and also on FreeDOS.


Lazarus on FreeDOS. I have to see that before I belive it. Or do you mean the fp environment, which is a textmode IDE for the compiler?


----------



## Lamia (Nov 3, 2022)

Lazarus on FreeBSD requires a lot of tweaks. You should get most if not all FPC packages installed. And if memory serves me right, the ports version fail; I had to pull it from its repo and build from source.


----------



## allu62 (Nov 5, 2022)

> Crivens said:
> 
> 
> > Lazarus on FreeDOS. I have to see that before I belive it.
> ...


----------



## Criosphinx (Nov 6, 2022)

I also tried it years, ago unfortunately didn't invest the time to learn properly, but everything worked fine. 

Today I installed it on 13.1-RELEASE-p3 running inside VirtualBox. It was as easy as `doas pkg install lazarus-gtk2` compiled one example and again everything works without problems.


----------



## allu62 (Dec 4, 2022)

Sorry for only being back now. I actually had given up...
The upgrade to 13.1 worked well, but for the rest it was the same as with 13.0. With pkg (without "doas"? and using package lazarus (not lazarus-gtk2), the install succeeded, but after reboot, the desktop had gone and starting X did give nothing else than this bizarre "4-terminal window". This is also the case when trying to upgrade the software packages using pkg. Using the ports, installation succeeded with some problems, everything seemed fine, but the build aborted with the message "Error: Util/bin/ld.bfd not found, switching to external linking".


----------



## tingo (Dec 9, 2022)

Interesting. Where did you get the package "lazarus" from? Here is from one of my 13.1 machines:

```
root@kg-core1:~ # freebsd-version -ku
13.1-RELEASE-p3
13.1-RELEASE-p4
root@kg-core1:~ # pkg -vv | grep url
    url             : "pkg+http://pkg.FreeBSD.org/FreeBSD:13:amd64/quarterly",
root@kg-core1:~ # pkg search lazarus
lazarus-gtk2-2.2.2_1           Portable Delphi-like IDE for the FreePascal compiler (GTK2)
lazarus-gtk2-devel-2.3.0       Portable Delphi-like IDE for the FreePascal compiler (GTK2 devel)
lazarus-qt5-2.2.2_1            Portable Delphi-like IDE for the FreePascal compiler (QT5)
lazarus-qt5-devel-2.3.0        Portable Delphi-like IDE for the FreePascal compiler (QT5 devel)
```
It has lazarus-gtk2 and lazarus-qt5.


----------



## Alain De Vos (Dec 9, 2022)

You can have:

```
editors/lazarus-qt5
editors/lazarus
```


----------



## tingo (Dec 9, 2022)

Alain De Vos said:


> You can have:
> 
> ```
> editors/lazarus-qt5
> ...


As ports, yes. As packages, no. (Well, in theory you could)


----------



## Alain De Vos (Dec 9, 2022)

As packages I found,

```
pkg search lazarus
lazarus-gtk2-2.2.2_1           Portable Delphi-like IDE for the FreePascal compiler (GTK2)
lazarus-gtk2-devel-2.3.0       Portable Delphi-like IDE for the FreePascal compiler (GTK2 devel)
lazarus-qt5-2.2.2_1            Portable Delphi-like IDE for the FreePascal compiler (QT5)
lazarus-qt5-devel-2.3.0        Portable Delphi-like IDE for the FreePascal compiler (QT5 devel)
```


----------



## SirDice (Dec 9, 2022)

The port editors/lazarus builds a -gtk2 package by default:

```
PKGNAMESUFFIX?=  -gtk2
{...}
.if ${PKGNAMESUFFIX} == "-gtk2"
USES+=		gnome
USE_GNOME=	cairo gtk20 gdkpixbuf2
.endif
```

The editors/lazarus-qt5 port is a _slave_ port (there's only a Makefile). Which means it sets up a different set of variables then simply builds the main editors/lazarus port. 


```
PKGNAMESUFFIX?=  -qt5
{...}
MASTERDIR=	${.CURDIR}/../../editors/lazarus
```

That's why there are only packages with -gtk2 or -qt5 suffixes.


----------

