For Debian Jessie, including the Raspbian variant for the RPi 2, and MAME 0.170+:
apt-get install git build-essentials libsdl2-dev libsdl2-ttf-dev libfontconfig-dev qt5-default
This should also work on the ODROID U3 and XU4 running Debian. Do NOT attempt on the original Pi!
For instance, to build an Apple II-only MAME on the Pi 2:
make SOURCES=src/mame/drivers/apple2.cpp,src/mame/drivers/apple2e.cpp,src/mame/video/apple2.cpp REGENIE=1 -j5
The Pi 2 has 4 CPU cores, so -j5 will (slightly) help compilation speeds.
A fast harddisk or SSD connected to the Pi 2's USB ports will greatly outperform most microSD cards, so it's worthwhile to put the MAME source tree on such a drive.
Last edited by R. Belmont; 02/04/16 07:05 PM.