Installing Lazarus on macOS
Overview
Unfortunately, there is no native Aqua-version of Lazarus for Mac OS X.
Required software
- Install Apple´s X11, available on your Mac OS X Installation Disk.
For Mac OS X 10.2.x you can download X11 on source forge at the X11 on Mac OS X Project.
For Mac OS X 10.3.x (but not for any other Mac OS X version!) also at Apple.
For Mac OS X 10.4 Tiger you must install X11 from your tiger DVD. This is for OS X to be able to display X11 programs. Tip: Drag the X11-Icon from /Applications/Utilities/X11 into the Dock for convenient starting.
- Install Apple´s XCode, available on your Mac OS X Installation Disk or at Apple Developer Connection (requires creation of account, but the free online program is enough). This installs the XCode IDE and all the developer stuff.
- Install fink, available at Sourceforge. This is an OS X 'apt-get'esque package system.
- Check if installation was successful, open a Terminal and type:
echo $PATH
This should give you:
/sw/sbin:/bin:/sbin:/usr/bin:/usr/sbin
- After successfull installation of the above, open a Terminal and type:
sudo apt-get update sudo apt-get install glib glib-shlibs gtk+-shlibs gdk-pixbuf gdk-pixbuf-shlibs
This installs GTK.
- Install fpc and Lazarus as .dmg for Mac OS X. Now your´re ready to run.
If you decide not to use Fink or if your Fink installation is customized |
---|
If you install gdk-pixbuf, gtk, and glib libraries not using Fink, or if your Fink installation is customized to install under other than /sw directory, then make sure that the environment variable DYLD_LIBRARY_PATH point to where the libraries are. For instance, it you use MacPorts, the command below should do the trick: export DYLD_LIBRARY_PATH="/opt/local/lib:$DYLD_LIBRARY_PATH" The environment variable should be setup every time before running lazarus, or should be run from shell startup script. |
How to get going
- Start X11.
- You get your XTerm. Focus it and type
cd /usr/local/share/lazarus/ ./lazarus
Lazarus as Icon
You can drag and drop the X11 app onto your dock to have a one-click way of starting X11.
To simplify starting Lazarus, in X11, choose Applications | Customize Menu, then click Add. Under Menu Name enter Lazarus, under Command enter the following:
/usr/local/share/lazarus/lazarus
Click Done to close. Now you can start Lazarus from X11 simply by choosing Applications | Lazarus.
BEWARE: if you use the below svn, then use
open -a /Users/yourname/pascal/lazarus/lazarus
How to update fpc and Lazarus to the newest version
- Install SVN for Mac OS X: A good package is provided by Martin Ott.
- Then follow Installing_Lazarus#Downloading_Lazarus_SVN