Here are the steps I took.
The book states you have to make the swap file bigger. On a pi with 1 GB of RAM that is a must but I have a 4GB and the swap space stays 0 so it is fine.
Download FPC from this site and install it.
https://www.freepascal.org/down/arm/linux-hungary.htmlfpc-3.0.4.arm-linux-eabihf-raspberry.tar
cd /home/pi/Downloads/fpc-3.0.4.arm-linux
tar xvf fpc-3.0.4.arm-linux-eabihf-raspberry.tar
cd ~/Downloads/fpc-3.0.4.arm-linux
sudo ./install.sh
Then you have to download the source of FPC 3.3.1 and compile it.
cd
mkdir source
Install subversion
sudo apt-get install -y subversion
cd ~/source
svn co http://svn.freepascal.org/svn/fpc/trunk fpc-3.3.1
Compile 3.3.1
cd ~/source/fpc-3.3.1
make all OPT=-dFPC_ARMHF
sudo make install OPT=-dFPC_ARMF PREFIX=/usr/local
sudo rm –f /usr/local/bin/ppcarm
sudo ln –sf /usr/local/lib/fpc/3.3.1/ppcarm /usr/local/bin/ppcarm
Then you have to install all the packages
sudo apt-get install -y libgtk2.0-dev
sudo apt-get install -y libcairo2-dev
sudo apt-get install -y libpango1.0-dev
sudo apt-get install -y libpangox-1.0-dev
sudo apt-get install -y libgdk-pixbuf2.0-dev
sudo apt-get install -y libx11-dev
sudo apt-get install -y gir1.2-coglpango-1.0
sudo apt-get install -y xorg-dev
Download Lazarus trunk
cd ~/source
svn co http://svn.freepascal.org/svn/lazarus/trunk lazarus
Compile Lazarus
cd ~/source/lazarus
make all OPT=-dFPC_ARMHF
sudo make install OPT=-dFPC_ARMHF PREFIX=/usr/local
Then you get a compiled Lazarus with broken components