Skip to content

Instantly share code, notes, and snippets.

@robertely
Created June 19, 2015 17:53
Show Gist options
  • Save robertely/e58feaca8bf07520be08 to your computer and use it in GitHub Desktop.
Save robertely/e58feaca8bf07520be08 to your computer and use it in GitHub Desktop.
#!/bin/bash
# STRAP IN THIS TAKES ABOUT 3 HOURS ON A PI 1
##
# Build deps
##
sudo apt-get install -y git ruby-dev libudev-dev libasound2-dev libdbus-1-dev libraspberrypi0 libraspberrypi-bin libraspberrypi-dev libboost-system-dev libboost-filesystem-dev libboost-date-time-dev libboost-locale-dev libfreeimage-dev libfreetype6-dev libeigen3-dev libcurl4-openssl-dev libasound2-dev cmake g++-4.7
sudo gem install fpm --no-ri --no-rdoc
rm -rf ~/workingdir
mkdir ~/workingdir
##
# SDL2
##
cd workingdir
# download and compile SDL2
wget http://libsdl.org/release/SDL2-2.0.1.tar.gz
tar xvfz SDL2-2.0.1.tar.gz
rm SDL2-2.0.1.tar.gz
cd SDL2-2.0.1/
./configure --disable-video-opengl --host=arm-raspberry-linux-gnueabihf
make install DESTDIR=`pwd`/BUILDROOT
## Build package
fpm -t deb \
-s dir \
-C BUILDROOT \
--name sdl2 \
--version 2.0.1 \
--architecture native \
--maintainer '[email protected]' \
--url 'https://www.libsdl.org' \
--license 'zlib license' \
--description 'Simple DirectMedia Layer is a cross-platform development library designed to provide low level access to audio, keyboard, mouse, joystick, and graphics hardware via OpenGL and Direct3D.'
mv *.deb ~/workingdir/
## Install SDL2
sudo dpkg -i ~/workingdir/sdl2_2.0.1_*.deb
##
# Emulationstation
##
cd ~/workingdir
## Download and compile emulationstation
git clone https://github.com/Aloshi/EmulationStation
cd EmulationStation
cmake -DCMAKE_CXX_COMPILER=/usr/bin/g++-4.7 -DFREETYPE_INCLUDE_DIRS=/usr/include/freetype2/ .
make install DESTDIR=BUILDROOT
## Download and merge simple theme
mkdir -p BUILDROOT/etc/emulationstation/themes
wget http://www.emulationstation.org/downloads/themes/simple_latest.zip
unzip simple_latest.zip -d BUILDROOT/etc/emulationstation/themes/
## Download and merge copyright
mkdir -p BUILDROOT/usr/share/doc/emulationstation/
wget https://raw.githubusercontent.com/Aloshi/EmulationStation/646bede3d9ec0acf0ae378415edac136774a66c5/LICENSE.md -O BUILDROOT/usr/share/doc/emulationstation/copyright
## Build package
fpm -t deb \
-s dir \
-C BUILDROOT \
--name emulationstation \
--version 2.0.1a \
--architecture native \
--depends 'sdl2' \
--depends 'libfreeimage3' \
--depends 'libboost-system1.49.0' \
--depends 'libboost-filesystem1.49.0' \
--depends 'libboost-date-time1.49.0' \
--depends 'libboost-locale1.49.0' \
--maintainer '[email protected]' \
--url 'https://www.emulationstation.org' \
--license 'CC BY-SA 4.0' \
--description 'A graphical and themeable emulator front-end that allows you to access all your favorite games in one place, even without a keyboard!'
mv *.deb ~/workingdir/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment