Difference between revisions of "Installing Lazarus on FreeBSD"

From Free Pascal wiki
(New Installation on FreeBSD page)
 
(Content extracted from "Installing Lazarus" page)
Line 1: Line 1:
{{Warning|Placeholder - Work in Progress}}
+
= Installing Lazarus on FreeBSD =
 +
 
 +
{{Warning|Work in Progress - Updates to be made}}
 +
 
 +
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).
 +
 
 +
<syntaxhighlight lang="bash">[]# cd /usr/ports/editors/lazarus && make install clean clean-depends</syntaxhighlight>
 +
<syntaxhighlight lang="bash">[]# cd /usr/ports/editors/lazarus-qt4 && make install clean clean-depends</syntaxhighlight>
 +
<syntaxhighlight lang="bash">[]# cd /usr/ports/editors/lazarus-qt5 && make install clean clean-depends</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
 +
 
 +
==via pkg==
 +
 
 +
<syntaxhighlight lang="bash">[]# pkg install editors/lazarus</syntaxhighlight>
 +
<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:-
 +
 
 +
  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
 +
 
 +
<syntaxhighlight lang="bash">[]# pkg install lang/fpc-utils</syntaxhighlight>
 +
 
 +
==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
 +
 
  
 
[[Category:Install]]
 
[[Category:Install]]
 
[[Category:FreeBSD]]
 
[[Category:FreeBSD]]

Revision as of 03:49, 14 August 2019

Installing Lazarus on FreeBSD

Warning-icon.png

Warning: Work in Progress - Updates to be made

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