Difference between revisions of "Installing Lazarus on macOS"

From Free Pascal wiki
Jump to navigationJump to search
Line 8: Line 8:
  
 
== Install Packages / Released version ==
 
== Install Packages / Released version ==
 +
 +
=== Installation from disk images ===
  
 
Download and install the three packages FPC, FPCSrc and Lazarus in this order: https://sourceforge.net/project/showfiles.php?group_id=89339
 
Download and install the three packages FPC, FPCSrc and Lazarus in this order: https://sourceforge.net/project/showfiles.php?group_id=89339
Line 13: Line 15:
 
This is the easiest way to install Lazarus on Mac OS X.  
 
This is the easiest way to install Lazarus on Mac OS X.  
  
Alternatively, you can install lazarus using [http://finkproject.org/ fink], a package manager for Mac OS X. It offers easy installation of a huge number of additional open source libraries as well as the clean removal of packages. At the moment, the choice is between an Aqua and a gtk2 look of lazarus:
+
=== Installation using fink ===
 +
 
 +
Installing lazarus using [http://finkproject.org/ fink], a package manager for Mac OS X, offers easy installation of a huge number of additional open source libraries as well as the clean removal of packages. At the moment, the choice is between an Aqua and a gtk2 look of lazarus:
  
 
  $ fink install lazarus-aqua
 
  $ fink install lazarus-aqua
Line 32: Line 36:
  
 
On IntelMacs the following additional  widgetsets are supported: carbon for powerpc, win32 and wince.
 
On IntelMacs the following additional  widgetsets are supported: carbon for powerpc, win32 and wince.
 +
 +
=== Installation using SVN ===
  
 
To get the current development version see below.
 
To get the current development version see below.

Revision as of 15:23, 13 January 2010

Template:Installing Lazarus on MacOS X

Installation

Apple Developer Tools

You need the Apple Developer tools. They can be installed from the original OSX installation CDs or downloaded from the Apple Developer Connection (ADC), which requires free registration: http://developer.apple.com/.

Install Packages / Released version

Installation from disk images

Download and install the three packages FPC, FPCSrc and Lazarus in this order: https://sourceforge.net/project/showfiles.php?group_id=89339

This is the easiest way to install Lazarus on Mac OS X.

Installation using fink

Installing lazarus using fink, a package manager for Mac OS X, offers easy installation of a huge number of additional open source libraries as well as the clean removal of packages. At the moment, the choice is between an Aqua and a gtk2 look of lazarus:

$ fink install lazarus-aqua

or

$ fink install lazarus-gtk2

When asked to install some required packages, such as fpc, simply answer with RETURN or yes.

After installation, Lazarus can then be started from the folder /Applications/Fink/

With both looks, the following widgetsets for your program are supported:

carbon, gtk2, nogui

After the additional installation of the lazarus-common-gtk1 package, gtk1 legacy projects are also supported, but only on 10.4 and 10.5. On 10.6 gtk1 is deprecated.

On IntelMacs the following additional widgetsets are supported: carbon for powerpc, win32 and wince.

Installation using SVN

To get the current development version see below.

Install from Source / Development version

You need the latest stable released FPC installed in order to compile the development version.

Download and install a compiler

Download and install the FPC package: https://sourceforge.net/project/showfiles.php?group_id=89339

There are two development versions of the compiler: 2.2.x is stable version without new features - only bug fixes. And the unstable 2.5.x with lots of new features and bugs. The 2.2.0 version has a bug and can not be used to compile the 2.2.4 nor 2.5.1. Best is to download and install fpc 2.2.4. Some daily snapshots can be found here. Keep in mind that these are daily snapshots and that you can have bad luck and get a buggy version. The probability is about 1:30. So if the version is buggy try another day or use the released packages instead.

Download the sources via svn

The sources are kept in a version control system called subversion or short svn:

  • 10.5 already installs svn. Users of earlier versions must install SVN for Mac OS X: A good package is provided by Martin Ott. You can also use fink. SVN clients with GUI (graphical user interface) are available from Versiontracker. A quite handy client, which integrates in Finder, is SCPlugin.

Create a directory, where you would like to put the sources. You don't need to be root to do this. Any normal user can do this. First create a directory for fpc

(e.g. /Users/username/freepascal)

then open a terminal and do the following:

[]$ svn co http://svn.freepascal.org/svn/fpc/trunk fpc

This will create a directory called 'fpc', which can be later used in the IDE. Hint: To download/update the latest changes you can simply do

[]$ cd /Users/username/freepascal/fpc
[]$ svn up

Building fpc

[]$ make clean all
[]$ sudo make install

Then download lazarus

[]$ svn co http://svn.freepascal.org/svn/lazarus/trunk lazarus

This will create a directories called 'fpc', which can be later used in the IDE. Hint: To download/update the latest changes you can simply do

[]$ cd /Users/username/freepascal/lazarus
[]$ svn up

Building lazarus

[]$ make clean all

Then start lazarus either via command line or by double click in the finder:

 ./lazarus.app/Contents/MacOS/lazarus

First Steps

The carbon interface has matured and is probably preferred over the gtk2 interface by most users of lazarus:

  • The carbon IDE looks somewhat nicer, although the autosizing does not work yet correctly and so some dialogs looks pretty bad until you enlarge them manually.
  • There is no optimal set of IDE shortcuts for the Mac yet, and so many features like help, identifier completion, toggle form/unit, compile, run, jump back do not work, because OS X itself uses those shortcuts. You must change the shortcuts in the editor options / keymappings. Beware, some key combos are not yet recognized and can give errors. At the moment it's recommended to only use Cmd-letter and Cmd-Shift-letter combinations.
  • The Alt key sometimes cease to functions. Just restart the IDE. It starts quite fast.
  • The blinking cursor vanish after popup menus and modal forms. Just switch to another page and back. Again: The normal page switching short cuts don't work, you may want to define some in the keymappings.

See Also

Other Interfaces

Platform specific Tips

Interfaces Development Articles