-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Gabe Knuth
committed
Jun 22, 2015
1 parent
8a5dce4
commit c39a3d4
Showing
11 changed files
with
354 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
******************************************** | ||
** Unified Debian MPF Installer Version 1 ** | ||
** 12/10/2014 ** | ||
******************************************** | ||
|
||
This is the Debian installer for the Mission Pinball Framework for use with the | ||
P-ROC, P3, and FAST pinball controllers. It will not work for non-Debian distros | ||
or any other pinball controller hardware (but we'll have installers for those, | ||
too). Please note that this DOES NOT INCLUDE pyprocgame, since that is the part | ||
that MPF replaces. It does, however, include all the components to connect MPF | ||
to the P-ROC, P3, and FAST controllers, which includes libpinproc (the C | ||
drivers) and pypinproc (the C code that exposes the libpinproc methods to | ||
python) or, in the case of FAST, libfastpinball. | ||
|
||
1. Some packages never seemed to install properly when pulled using apt-get. | ||
These packages have been included with this kit and are compiled / installed by | ||
the script. | ||
|
||
2. Rather than include libpinproc, pypinproc, libfastpinball and MPF in the kit, | ||
they are downloaded automatically from git (the coders call this "cloning"). | ||
When you start the script, you'll be prompted to choose dev or master. This | ||
applies to all clone operations, so if you want to mix and match, you'll need to | ||
edit the commands in the script, replacing the $BRANCH variable in the line with | ||
the branch you want. | ||
|
||
3, If you're using the PD-LED driver board for P-ROC or P3, you should use the | ||
dev branch. Otherwise, it shouldn't matter too much. dev is pretty stable, so | ||
you could probably just get away with that. | ||
|
||
4. Certain components, like libfastpinball and MPF are only in one branch, so | ||
you don't get the choice. The script has been hardcoded to get the proper bits. | ||
|
||
5. This script is for Debian and Debian derivatives (Ubuntu, Xubuntu, Kubuntu, | ||
etc...) only, but has been tested on traditional i386, x86_64, and ODROID & | ||
Raspberry Pi builds (arm_hf), including different OS versions. | ||
|
||
// USAGE // | ||
|
||
./install | ||
|
||
Unlike the original, this script requires a reboot. There is a permissions rule | ||
that must be read at boot to allow non-root users access to the ftdi driver. | ||
Additionally, there are environment variables that are defined during the | ||
install that are needed afterwards. Without running 'source ~/.bashrc' or | ||
rebooting, these environment variables won't be loaded. Rebooting kills two | ||
birds with one stone. | ||
|
||
It is not necessary (or advised) to run this as root, though you will be | ||
prompted to enter a root password right away. Running this script as a normal | ||
user ensures that environment variables are created in the proper location. | ||
Environment variables are set only for the user that is running the script. | ||
If for some reason your machine is going to run the pinball code under a | ||
different username, you will need to copy the "export" lines from ~/.bashrc to | ||
the .bashrc file for that user. too. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
##!/bin/bash | ||
|
||
# This script should be used to cleanup the install directory | ||
# and start again. It should be run as root. | ||
# e.g. sudo ./cleanup | ||
|
||
rm -r libftdi1-1.1 | ||
rm -r libpinproc | ||
rm -r libusb-1.0.18 | ||
rm -r libusbx-1.0.18 | ||
rm -r pypinproc | ||
rm -r PyYAML-3.11 | ||
rm -r yaml-cpp-0.2.5 | ||
rm -r pyOSC-0.3.5b-5294 | ||
rm -r libfastpinball |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,285 @@ | ||
##!/bin/bash | ||
|
||
echo " ##############################################" | ||
echo " # IT IS NOT A GOOD IDEA TO RUN THIS AS ROOT! #" | ||
echo " # ENVIRONMENT VARIABLES WILL NOT BUILD. #" | ||
echo " # #" | ||
echo " # IF YOU RAN THIS WITH SUDO, PRESS CTRL-C #" | ||
echo " # NOW AND RUN AS A NORMAL USER. #" | ||
echo "##############################################" | ||
|
||
### Choose the pinball controller hardware that you will be using | ||
echo "Which hardware will you be using? If you know, but don't have it," | ||
echo "choose it anyway." | ||
echo "" | ||
echo "(Enter 1 for FAST, 2 for P3 or P-ROC, 3 for none, or CTRL-C to quit)" | ||
read REPLY | ||
case $REPLY in | ||
1) PLATFORM="FAST";; | ||
2) PLATFORM="PROC";; | ||
3) PLATFORM="NONE";; | ||
esac | ||
|
||
#echo $PLATFORM | ||
|
||
|
||
if [ $PLATFORM != "FAST" ] && [ $PLATFORM != "PROC" ] && [ $PLATFORM != "NONE" ] | ||
then | ||
echo | ||
echo "########################" | ||
echo "Please enter 1, 2, or 3" | ||
exit | ||
fi | ||
|
||
clear | ||
|
||
### Choose the build you want to deploy, dev or master | ||
### MPF requires the DEV branch of pypinproc, so we'll get that automatically | ||
|
||
echo "Last Question: Choose which build of MPF you would like to deploy:" | ||
echo "" | ||
echo "If you don't know, choose 2 for master. You can easily switch later." | ||
echo "" | ||
echo "(Enter 1 for dev, 2 for master, or CTRL-C to quit)" | ||
read REPLY | ||
case $REPLY in | ||
1) BRANCH="dev";; | ||
2) BRANCH="master";; | ||
esac | ||
|
||
if [ $BRANCH != "dev" ] && [ $BRANCH != "master" ] | ||
then | ||
echo | ||
echo "###################" | ||
echo "Please enter 1 or 2" | ||
echo "If you want to get down and dirty, you'll have to edit this script." | ||
exit | ||
fi | ||
|
||
clear | ||
|
||
echo | ||
echo "Installing prerequsites via apt-get" | ||
|
||
sudo apt-get update | ||
sudo apt-get -y install unzip cmake gcc g++ build-essential git-core libmpg123-0 | ||
sudo apt-get -y install python2.7 python-dev python-setuptools libyaml-dev mplayer | ||
sudo apt-get -y install python-pygame libsdl1.2-dev | ||
|
||
echo "[PyYAML] Installing PyYAML 3.11" | ||
|
||
tar -zxpvf PyYAML-3.11.tar.gz | ||
cd PyYAML-3.11 | ||
sudo python setup.py install | ||
|
||
if [ $? -ne 0 ]; then | ||
echo "PyYAML installation failed" | ||
exit 1 | ||
fi | ||
|
||
echo "Backing out to main directory..." | ||
|
||
cd .. | ||
|
||
########################################## | ||
## P-ROC and P3 Support ## | ||
########################################## | ||
echo $PLATFORM | ||
if [ $PLATFORM = "PROC" ] | ||
then | ||
echo "[PROC PREREQS] Installing PROC prerequisites via apt-get" | ||
sudo apt-get -y install zlib1g-dev libudev-dev libusb-dev | ||
|
||
echo "[LIBUSB1] Installing libusb1" | ||
|
||
tar -jxvpf libusb-1.0.18.tar.bz2 | ||
cd libusb-1.0.18 | ||
./configure | ||
make | ||
sudo make install | ||
|
||
if [ $? -ne 0 ]; then | ||
echo "libusb1 install failed." | ||
exit 1 | ||
fi | ||
|
||
echo "Backing out to main directory..." | ||
|
||
cd ../ | ||
|
||
echo "[LIBUSBX] Installing libusbx" | ||
|
||
tar -jxvpf libusbx-1.0.18.tar.bz2 | ||
cd libusbx-1.0.18 | ||
./configure | ||
make | ||
sudo make install | ||
|
||
if [ $? -ne 0 ]; then | ||
echo "libusbx install failed." | ||
exit 1 | ||
fi | ||
|
||
echo "Backing out to main directory..." | ||
|
||
cd ../ | ||
|
||
echo "[LIBFTDI1] Installing libftdi1" | ||
|
||
tar -jxpvf libftdi1-1.1.tar.bz2 | ||
cd libftdi1-1.1 | ||
mkdir bin | ||
cd bin | ||
cmake .. | ||
make | ||
sudo make install | ||
|
||
if [ $? -ne 0 ]; then | ||
echo "LIBFTDI1 install failed." | ||
exit 1 | ||
fi | ||
|
||
echo "Backing out to main directory..." | ||
cd ../.. | ||
|
||
echo "[YAML-CPP] Installing YAML-CPP" | ||
|
||
tar -zxpvf yaml-cpp-0.2.5.tar.gz | ||
cd yaml-cpp-0.2.5/ | ||
mkdir bin | ||
cd bin | ||
cmake .. | ||
make | ||
sudo make install | ||
|
||
if [ $? -ne 0 ]; then | ||
echo "YAML-CPP install failed." | ||
exit 1 | ||
fi | ||
|
||
echo "Backing out to main directory..." | ||
cd ../.. | ||
|
||
echo "Setting up environment variables..." | ||
|
||
export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH | ||
export C_INCLUDE_PATH_TEMP=$(find /usr/ -name ftdi.h -printf '%h\072') | ||
export CPLUS_INCLUDE_PATH_TEMP=$(find /usr/ -name ftdi.h -printf '%h\072') | ||
export C_INCLUDE_PATH=$(find /usr/ -name ftdi.h -printf '%h\072') | ||
export CPLUS_INCLUDE_PATH=$(find /usr/ -name ftdi.h -printf '%h\072') | ||
|
||
|
||
echo "Stuff should be exported now" | ||
|
||
echo "export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH" >> ~/.bashrc | ||
echo "export C_INCLUDE_PATH="$C_INCLUDE_PATH_TEMP":$C_INCLUDE_PATH" >> ~/.bashrc | ||
echo "export CPLUS_INCLUDE_PATH="$CPLUS_INCLUDE_PATH_TEMP":$CPLUS_INCLUDE_PATH" >> ~/.bashrc | ||
|
||
source ~/.bashrc | ||
|
||
echo "[LIBPINPROC] Installing libpinproc" | ||
|
||
git clone --branch master https://github.com/preble/libpinproc.git libpinproc | ||
cd libpinproc | ||
|
||
mkdir bin | ||
cd bin | ||
|
||
cmake -DBUILD_SHARED_LIBS=ON .. | ||
make | ||
sudo make install | ||
|
||
if [ $? -ne 0 ]; then | ||
echo "libpinproc installation failed." | ||
exit 1 | ||
fi | ||
|
||
echo "Backing out to main directory..." | ||
|
||
cd ../.. | ||
|
||
echo "[PyPINPROC] Installing pypinproc" | ||
|
||
git clone --branch dev http://github.com/preble/pypinproc.git pypinproc | ||
cd pypinproc | ||
sudo python setup.py install | ||
|
||
if [ $? -ne 0 ]; then | ||
echo "PyPinproc installation failed" | ||
exit 1 | ||
fi | ||
|
||
echo "Backing out to main directory..." | ||
|
||
cd .. | ||
|
||
fi | ||
|
||
echo "[OSC] Installing OSC" | ||
|
||
tar -zxvpf pyOSC-0.3.5b-5294.tar.gz | ||
cd pyOSC-0.3.5b-5294 | ||
sudo python setup.py install | ||
|
||
if [ $? -ne 0 ]; then | ||
echo "OSC install failed." | ||
exit 1 | ||
fi | ||
|
||
echo "Backing out to main directory..." | ||
|
||
cd ../ | ||
|
||
echo "Setting up mplayer for audio testing" #might not be needed later | ||
echo "afm=mp3lib" >> ~/.mplayer/config | ||
|
||
|
||
echo "[MPF] Installing MPF" | ||
mkdir ~/pinball | ||
cd ~/pinball | ||
git clone --branch dev https://github.com/missionpinball/mpf.git mpf | ||
|
||
########################################## | ||
# This creates a mpf folder in ~/pinball # | ||
# so it's not in the toolkit folder # | ||
########################################## | ||
|
||
cd - | ||
echo "" | ||
echo "" | ||
echo "" | ||
clear | ||
|
||
if [ $PLATFORM = "PROC" ]; then | ||
echo " Installation finished." | ||
echo "============================================================" | ||
echo "!!! You need to restart to complete installation! !!!" | ||
echo " (It's complicated. Check the script to see why)" | ||
echo "" | ||
else | ||
echo " Installation finished." | ||
echo "============================================================" | ||
echo " You shouldn't have to reboot, but what the heck, right? " | ||
echo "" | ||
fi | ||
|
||
echo " When you are done, check your home folder for a" | ||
echo " 'pinball' folder. In there is the 'mpf' folder" | ||
echo " and you'll be able to get started." | ||
echo " ( ~/pinball/mpf )" | ||
echo "" | ||
echo " Happy pinballing!" | ||
echo "" | ||
read -p "Do you want to reboot now? (y or n)" -n 1 -r | ||
echo # (optional) move to a new line | ||
if [[ $REPLY = "y" ]]; then | ||
read -p "Are you sure you want to reboot? (y or n)" -n 1 -r | ||
echo # (optional) move to a new line | ||
if [[ $REPLY = "y" ]]; then | ||
sudo shutdown -r now | ||
else | ||
echo "REMEMBER TO REBOOT BEFORE YOU TRY TO USE THE GAME" | ||
fi | ||
else | ||
echo "REMEMBER TO REBOOT BEFORE YOU TRY TO USE THE GAME" | ||
fi |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.