Note: Dependencies - you probably want to build the GTK2 version of Lazarus, most distros will have gtk2 preinstalled but you may need to install its dev libraries. So, install gdb, libx11-dev and libgtk2.0-dev, that will bring gtk2 itself along if necessary. If building a QT5 version, you will need libqt5pas-dev. If you are going to work with GTK3, you will need to install libgtk-3-dev
at least 3.2.0, 3.2.2 and 3.2.3 (ie fixes).