Difference between revisions of "Installing Lazarus on FreeBSD"

From Free Pascal wiki
Jump to navigationJump to search
(Content extracted from "Installing Lazarus" page)
(28 intermediate revisions by 2 users not shown)
Line 1: Line 1:
= Installing Lazarus on FreeBSD =
+
{{LanguageBar}}
  
{{Warning|Work in Progress - Updates to be made}}
+
== Installing Lazarus on FreeBSD ==
  
The following applies to FreeBSD 10+ only.
+
The following applies to FreeBSD 12.x and 13.x only. Earlier FreeBSD versions are end-of-life and not supported.
  
==via the Ports tree==
+
===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).
+
Currently, two versions of Lazarus are available in the FreeBSD ports tree v2.2.2 (release version) and v2.3.0 (development version). The latest version of the Free Pascal Compiler in the ports tree is v3.2.2. You can install the GTK2 version ''or'' QT5 version of Lazarus as follows:
  
<syntaxhighlight lang="bash">[]# cd /usr/ports/editors/lazarus && make install clean clean-depends</syntaxhighlight>
+
<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">[]# cd /usr/ports/editors/lazarus-qt4 && make install clean clean-depends</syntaxhighlight>
+
# cd /usr/ports/editors/lazarus && make install clean
<syntaxhighlight lang="bash">[]# cd /usr/ports/editors/lazarus-qt5 && make install clean clean-depends</syntaxhighlight>
+
</syntaxhighlight>
  
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
+
or
  
==via pkg==
+
<syntaxhighlight lang="bash">
 +
# cd /usr/ports/editors/lazarus-qt5 && make install clean
 +
</syntaxhighlight>
  
<syntaxhighlight lang="bash">[]# pkg install editors/lazarus</syntaxhighlight>
+
If you want use development (aka trunk) version of Lazarus do the following:
<syntaxhighlight lang="bash">[]# pkg install editors/lazarus-qt4</syntaxhighlight>
 
<syntaxhighlight lang="bash">[]# pkg install editors/lazarus-qt5</syntaxhighlight>
 
  
At this point Lazarus might complain about missing source files.  If you don't have them:-
+
<syntaxhighlight lang="bash">
 +
# cd /usr/ports/editors/lazarus-devel && make install clean
 +
</syntaxhighlight>
  
  mkdir /usr/ports/distfiles
+
or
  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
+
<syntaxhighlight lang="bash">
 +
# cd /usr/ports/editors/lazarus-qt5-devel && make install clean
 +
</syntaxhighlight>
  
  /usr/ports/distfiles/freepascal/fpc-3.0.4
 
  
If when you try to compile something you get this error
+
Note: Installing Lazarus will also install the Free Pascal Compiler and its source files.
  
  Error: resource compiler "fpcres" not found, switching to external mode
+
===via the pkg system===
  
Then you can install fpcres like this
+
<syntaxhighlight lang="bash">
 +
# pkg install editors/lazarus
 +
</syntaxhighlight>
  
<syntaxhighlight lang="bash">[]# pkg install lang/fpc-utils</syntaxhighlight>
+
or
  
==via the Lazarus repository==
+
<syntaxhighlight lang="bash">
 +
# pkg install editors/lazarus-qt5
 +
</syntaxhighlight>
  
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).
+
or
  
* 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
+
<syntaxhighlight lang="bash">
* 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'.
+
# pkg install editors/lazarus-devel
 +
</syntaxhighlight>
  
  cd /patch/to/lazarus_source
+
or
  gmake clean all
 
  
 +
<syntaxhighlight lang="bash">
 +
# pkg install editors/lazarus-qt5-devel
 +
</syntaxhighlight>
  
 +
Lazarus should install the Free Pascal Compiler source files.  If you don't have them, you can add them:
 +
 +
<syntaxhighlight lang="bash">
 +
# pkg install lang/fpc-source
 +
</syntaxhighlight>
 +
 +
If you start Lazarus IDE at this point by typing '''lazarus''' you will get a dialog which needs you to input the directory in which the Free Pascal source files are located. Set it to '''/usr/local/share/fpc-source-3.2.2'''
 +
 +
===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. Recent versions of FreeBSD include the '''svn''' command as '''svnlite''', so you do not need to install full Subversion package to checkout a copy of the source code.
 +
 +
* The readme.txt file in Lazarus directory mentions '''make clean all'''. This only works if you are using Linux. Under FreeBSD you need to replace '''make''' with '''gmake''' and ensure that you have also installed the GNU gmake from ports.
 +
 +
<syntaxhighlight lang="bash">
 +
  cd /path/to/lazarus_source
 +
  gmake distclean all bigide
 +
</syntaxhighlight>
 +
 +
=== What does the bigide make argument do? ===
 +
 +
{{BigIDE}}
 +
 +
== Installation troubleshooting ==
 +
 +
Troubleshooting details that should (hopefully) be applicable across platforms may be found in the article [[Installation Troubleshooting]].
 +
 +
Some additional notes for FreeBSD installations can be found in the articles [[FreeBSD]] and [[Installing the Free Pascal Compiler]].
 +
 +
== Multiple Lazarus installs ==
 +
 +
Please see [[Multiple Lazarus]] for details on having more than one Lazarus version installed on one system. We cover issues that can arise due to multiple Lazarus installs here, because they can also happen when installing over a previous version.
 +
 +
== Lazarus FAQ ==
 +
 +
The Lazarus FAQ - Frequently Asked Questions - page is available [[Lazarus_Faq|here]].
 +
 +
== Installing old versions ==
 +
 +
See [[Installation hints for old versions]]
 +
 +
[[Category:FPC]]
 +
[[Category:Lazarus]]
 
[[Category:Install]]
 
[[Category:Install]]
 
[[Category:FreeBSD]]
 
[[Category:FreeBSD]]

Revision as of 07:51, 19 June 2022

English (en)

Installing Lazarus on FreeBSD

The following applies to FreeBSD 12.x and 13.x only. Earlier FreeBSD versions are end-of-life and not supported.

via the Ports tree

Currently, two versions of Lazarus are available in the FreeBSD ports tree v2.2.2 (release version) and v2.3.0 (development version). The latest version of the Free Pascal Compiler in the ports tree is v3.2.2. You can install the GTK2 version or QT5 version of Lazarus as follows:

# cd /usr/ports/editors/lazarus && make install clean

or

# cd /usr/ports/editors/lazarus-qt5 && make install clean

If you want use development (aka trunk) version of Lazarus do the following:

# cd /usr/ports/editors/lazarus-devel && make install clean

or

# cd /usr/ports/editors/lazarus-qt5-devel && make install clean


Note: Installing Lazarus will also install the Free Pascal Compiler and its source files.

via the pkg system

# pkg install editors/lazarus

or

# pkg install editors/lazarus-qt5

or

# pkg install editors/lazarus-devel

or

# pkg install editors/lazarus-qt5-devel

Lazarus should install the Free Pascal Compiler source files. If you don't have them, you can add them:

# pkg install lang/fpc-source

If you start Lazarus IDE at this point by typing lazarus you will get a dialog which needs you to input the directory in which the Free Pascal source files are located. Set it to /usr/local/share/fpc-source-3.2.2

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. Recent versions of FreeBSD include the svn command as svnlite, so you do not need to install full Subversion package to checkout a copy of the source code.
  • The readme.txt file in Lazarus directory mentions make clean all. This only works if you are using Linux. Under FreeBSD you need to replace make with gmake and ensure that you have also installed the GNU gmake from ports.
  cd /path/to/lazarus_source
  gmake distclean all bigide

What does the bigide make argument do?

The bigide make argument adds a bunch of packages to Lazarus that many find useful and cannot do without. The packages that are added are:

  • cairocanvas
  • chmhelp
  • datetimectrls
  • externhelp
  • fpcunit
  • fpdebug
  • instantfpc
  • jcf2
  • lazcontrols
  • lazdebuggers
  • lclextensions
  • leakview
  • macroscript
  • memds
  • onlinepackagemanager
  • pas2js
  • PascalScript
  • printers
  • projecttemplates
  • rtticontrols
  • sdf
  • sqldb
  • synedit
  • tachart
  • tdbf
  • todolist
  • turbopower_ipro
  • virtualtreeview

The above list is sourced from the [Lazarus source directory]/IDE/Makefile.fpc and may be subject to change.

Note that if you have not compiled your own Lazarus IDE with the bigide argument, you can install any of these packages yourself using the Lazarus IDE Package > Install/Uninstall Packages... dialog.

Installation troubleshooting

Troubleshooting details that should (hopefully) be applicable across platforms may be found in the article Installation Troubleshooting.

Some additional notes for FreeBSD installations can be found in the articles FreeBSD and Installing the Free Pascal Compiler.

Multiple Lazarus installs

Please see Multiple Lazarus for details on having more than one Lazarus version installed on one system. We cover issues that can arise due to multiple Lazarus installs here, because they can also happen when installing over a previous version.

Lazarus FAQ

The Lazarus FAQ - Frequently Asked Questions - page is available here.

Installing old versions

See Installation hints for old versions