Installing Lazarus on FreeBSD
Installing Lazarus on FreeBSD
The following applies to FreeBSD 10+ only.
via the Ports tree
The latest version of Lazarus available in the FreeBSD port tree, is v 2.0.0 We can use that to install Lazarus (GTK2 by default, QT4 or QT5).
[]# cd /usr/ports/editors/lazarus && make install clean clean-depends
[]# cd /usr/ports/editors/lazarus-qt4 && make install clean clean-depends
[]# cd /usr/ports/editors/lazarus-qt5 && make install clean clean-depends
If you start Lazarus IDE and you get a messages about missing source files, then go to Environment - Environment Options - Files Tab: FPC source library and enter the directory of the FPC source files. It can be obtained from /usr/ports/distfiles/freepascal
via pkg
[]# pkg install editors/lazarus
[]# pkg install editors/lazarus-qt4
[]# pkg install editors/lazarus-qt5
At this point Lazarus might complain about missing source files. If you don't have them:-
mkdir /usr/ports/distfiles mkdir /usr/ports/distfiles/freepscal cd /usr/ports/distfiles/freepascal wget http://distcache.freebsd.org/ports-distfiles/freepascal/fpc-3.0.4.source.tar.gz tar xvfz fpc-3.0.4.source.tar.gz
Change the 3.0.4 to whatever version of fpc you have installed. Then go to Environment - Environment Options - Files Tab: FPC source library and enter
/usr/ports/distfiles/freepascal/fpc-3.0.4
If when you try to compile something you get this error
Error: resource compiler "fpcres" not found, switching to external mode
Then you can install fpcres like this
[]# pkg install lang/fpc-utils
via the Lazarus repository
This option will often be used if you want to follow Lazarus Trunk, a Fixes branch, or some other release (eg: compiling from a source tarball).
- Use the SubVersion or Git repositories to checkout a copy of the source code you want, or unpack a downloaded source archive into a suitable location
- The readme.txt file in Lazarus directory mentions 'make clean all'. This works if you are using Linux. Under FreeBSD 9.1 I had to replace 'make' with 'gmake'.
cd /patch/to/lazarus_source gmake clean all