Friday, January 2, 2015

Build libsdl2-dev deb package for Raspbian on Raspberry Pi

Some projects I want to experiment with require Simple DirectMedia Layer (SDL) version 2 for Raspbian on a Raspberry Pi.  Unfortunately, the debian package for libsdl2-dev is not currently included in Raspian Repository.  Jan Zumwalt described how to build libsdl in his post titled "How To Install & Use SDL2 on Raspbian PI".  I prefer to install software via package managers when possible so I decided to make a .deb for libsdl2-dev.

Install devscripts
sudo apt-get install devscripts

Download libsdl 2.0.  I used SDL2-2.0.3.tar.gz.  Then follow the IntroDebianPackaging guide.

rename the SDL2-2.0.3.tar.gz to SDL2_2.0.3.tar.gz
extract the tar.gz
All the necessary files for building a .deb are already in the debian folder

Run debuild
debuild -uc -us

Install missing build dependencies
sudo apt-get dh-autoreconf libpulse-dev libxcursor-dev libxi-dev libxinerama-dev libxrandr-dev libxss-dev libxt-dev libxxf86vm-dev

Run debuild again
debuild -uc -us

Install packages
sudo dpkg -i libsdl2_2.0.3_armhf.deb
sudo dpkg -i libsdl2-dev_2.0.3_armhf.deb