Open robertely opened 9 years ago
Spent the night fiddling and i'm about 80% there. This snip-it will build packages for sdl2 and emulationstation sans theme and config:
#!/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
mkdir ~/workingdir
cd workingdir
##
# SDL2
##
wget http://libsdl.org/release/SDL2-2.0.1.tar.gz
tar xvfz 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
fpm -t deb \
-s dir \
-C BUILDROOT \
--name sdl2 \
--version 2.0.1 \
--architecture native \
--maintainer 'robert@pizzaarcade.co' \
--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/
##
# Emulationstation
##
cd ~/workingdir
git clone https://github.com/Aloshi/EmulationStation
cd EmulationStation
cmake -DCMAKE_CXX_COMPILER=g++-4.7 -DFREETYPE_INCLUDE_DIRS=/usr/include/freetype2/ .
cmake -DCMAKE_CXX_COMPILER=g++-4.7 -DFREETYPE_INCLUDE_DIRS=/usr/include/freetype2/ .
make install DESTDIR=BUILDROOT
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 'robert@pizzaarcade.co' \
--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/
I won't go much further with out the blessing of the devs, but this does work. I installed the packages on fresh (arm6) Raspbian build like so:
sudo apt-get install -y libboost-system1.49.0 libboost-filesystem1.49.0 libboost-date-time1.49.0 libboost-locale1.49.0 libfreeimage3
sudo dpkg -i sdl2_2.0.1_armhf.deb
sudo dpkg -i emulationstation_2.0.1a_armhf.deb
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/lib"
emulationstation
Well I lied about not going much further. Now it's about 90% there.
The emulationstation package this build script generates are functionally identical to the AMD64 version. The only difference is it writes the binary to /usr/local/bin instead of /usr/bin. This is a best practice thing that I can change later if it really bothers someone.
BUILD SCRIPT:
#!/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 'robert@pizzaarcade.co' \
--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 'robert@pizzaarcade.co' \
--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/
Generates sdl2 and emulationstation debs. Note it installs sdl2 after building the deb. You need this to compile EmulationStation
Hey guys, If your interested I would like to help get some packaging setup to help Pi users get setup with out complex (but admittedly impressive) bash scripts and/or compiling. I'm testing builds of SDL2 and EmulationStation built with FPM now. If you like I could also host them in a public debian repo.
On a similar note i'm building a set of Chef cookbooks that I hope can one day replace the Retro Pi build script. I think It would be a cleaner more reliable install process. That's debatable, but at very least the packages would be useful.
https://github.com/jordansissel/fpm https://docs.chef.io/chef_solo.html