Difference between revisions of "Installing Lazarus on FreeBSD"

From Free Pascal wiki
Jump to navigationJump to search
(14 intermediate revisions by 2 users not shown)
Line 1: Line 1:
= Installing Lazarus on FreeBSD =
+
{{LanguageBar}}
  
The following applies to FreeBSD 11-STABLE, 11.2 and 11.3, 12-STABLE and 12.0 only. Earlier FreeBSD versions are end-of-life and not supported.
+
== Installing Lazarus on FreeBSD ==
  
==via the Ports tree==
+
The following applies to FreeBSD 11.x, 12.x and maybe 13.x only. Earlier FreeBSD versions are end-of-life and not supported.
  
The latest version of Lazarus available in the FreeBSD port tree is v 2.0.4. We can use that to install Lazarus (GTK2 or QT5).
+
===via the Ports tree===
 +
 
 +
The latest version of Lazarus available in the FreeBSD ports tree is v2.0.10 and the latest version of the Free Pascal Compiler is v3.2.0. You can install the GTK2 version ''or'' QT5 version of Lazarus as follows:
  
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
Line 17: Line 19:
 
</syntaxhighlight>
 
</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 sources are located. Small problem, they have not been installed. You can, however, find a compressed tar file of the sources in the '''/usr/ports/distfiles/freepascal''' directory.
+
Note: Installing Lazarus will also install the Free Pascal Compiler and its source files.
 
 
You can either install the sources in your home directory or in the system-wide '''/usr/local/share/fpsrc''' directory. You will need to do this as root if you use the system-wide directory.
 
 
 
=== Installing FPC sources ===
 
 
 
<syntaxhighlight lang="bash">
 
# cd /usr/ports/lang/fpc-source && make install clean
 
</syntaxhighlight>
 
  
==via the pkg system==
+
===via the pkg system===
  
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
Line 39: Line 33:
 
</syntaxhighlight>
 
</syntaxhighlight>
  
At this point Lazarus will complain about the missing Free Pascal source files.  If you don't have them:
+
Lazarus should install the Free Pascal Compiler source files.  If you don't have them, you can add them:
  
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
  fetch http://distcache.freebsd.org/ports-distfiles/freepascal/fpc-3.0.4.source.tar.gz
+
# pkg install lang/fpc-source
 
</syntaxhighlight>
 
</syntaxhighlight>
  
You can either install the sources in your home directory or in the system-wide '''/usr/local/share/fpsrc''' directory. You will need to do this as root if you use the system-wide directory.
+
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.0'''
  
=== Installing FPC sources in home directory ===
+
===via the Lazarus repository===
  
Create a directory to hold the Free Pascal sources under your home directory. Note that when you extract the compressed tar file, it will include a directory of fpc-3.0.4, so if that is good enough for you go ahead and:
+
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">
 
<syntaxhighlight lang="bash">
tar xvzf /usr/ports/distfiles/freepascal/fpc-3.0.4.source.tar.gz
+
  cd /path/to/lazarus_source
 +
  gmake distclean all bigide
 
</syntaxhighlight>
 
</syntaxhighlight>
  
=== Installing FPC sources in system-wide directory ===
+
=== What does the bigide make argument do? ===
  
As root, create the '''fpcsrc''' directory in '''/usr/local/share''', change to the new directory and:
+
{{BigIDE}}
  
<syntaxhighlight lang="bash">
+
== Installation troubleshooting ==
tar xvzf /usr/ports/distfiles/freepascal/fpc-3.0.4.source.tar.gz
 
</syntaxhighlight>
 
  
==via the Lazarus repository==
+
Troubleshooting details that should (hopefully) be applicable across platforms may be found in the article [[Installation Troubleshooting]].
  
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).
+
Some additional notes for FreeBSD installations can be found in the articles [[FreeBSD]] and [[Installing the Free Pascal Compiler]].
  
* 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.
+
== Multiple Lazarus installs ==
  
* 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'''.
+
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.
  
<syntaxhighlight lang="bash">
+
== Lazarus FAQ ==
  cd /path/to/lazarus_source
 
  gmake clean all
 
</syntaxhighlight>
 
 
 
==Installation troubleshooting==
 
  
Troubleshooting details that should (hopefully) be applicable across platforms may be found in the article [[Installation Troubleshooting]].
+
The Lazarus FAQ - Frequently Asked Questions - page is available [[Lazarus_Faq|here]].
  
Some additional notes for FreeBSD installations can be found in the article [[FreeBSD]].
+
== Installing old versions ==
  
 +
See [[Installation hints for old versions]]
  
 +
[[Category:FPC]]
 +
[[Category:Lazarus]]
 
[[Category:Install]]
 
[[Category:Install]]
 
[[Category:FreeBSD]]
 
[[Category:FreeBSD]]

Revision as of 06:58, 17 January 2021

English (en)

Installing Lazarus on FreeBSD

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

via the Ports tree

The latest version of Lazarus available in the FreeBSD ports tree is v2.0.10 and the latest version of the Free Pascal Compiler is v3.2.0. 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

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

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.0

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