Skip to content

Commit

Permalink
Added a shell script to help get started on a fresh Ubuntu machine
Browse files Browse the repository at this point in the history
  • Loading branch information
Lego3 committed Jan 3, 2015
1 parent 94e666c commit c214333
Showing 1 changed file with 61 additions and 0 deletions.
61 changes: 61 additions & 0 deletions run_to_initialize_on_ubuntu.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
#!/bin/bash

MOVIES="-D WITH_MOVIES=OFF"
echo "Do you want to run CorsixTH with movies enabled? This will require ffmpeg, acquired from a specific PPA."
select yn in "Yes" "No"; do
case $yn in
Yes )
MOVIES="-D WITH_MOVIES=ON"
if ! grep -q "jon-severinsson/ffmpeg" /etc/apt/sources.list /etc/apt/sources.list.d/*; then
sudo add-apt-repository ppa:jon-severinsson/ffmpeg
sudo apt-get update
else
echo "Jon Severinsson's PPA has already been added on this machine."
fi
sudo apt-get install ffmpeg libavcodec-dev libavformat-dev libavresample-dev libavdevice-dev libavutil-dev libavfilter-dev libswscale-dev libpostproc-dev libswresample-dev -y
break;;
No ) break;;
esac
done

sudo apt-get install build-essential cmake libsdl1.2-dev libsdl-mixer1.2-dev timidity libfreetype6-dev libluajit-5.1-dev lua-socket -y
# Try to fix bug in luasocket 3.0-rc1
sudo sed -i 's/ PROXY/ _M.PROXY/g' /usr/share/lua/5.1/socket/http.lua

MAPEDITOR="-D BUILD_MAPEDITOR=OFF"
echo "Do you wish to compile the Map Editor?"
select yn in "Yes" "No"; do
case $yn in
Yes )
MAPEDITOR="-D BUILD_MAPEDITOR=ON"
sudo apt-get install libwxgtk3.0-dev -y
break;;
No ) break;;
esac
done

cmake $MAPEDITOR $MOVIES .
cd CorsixTH
make

if [[ $MAPEDITOR == *"ON" ]]; then
cd ../MapEdit
make
fi

echo "Do you wish to compile the Level Editor?"
select yn in "Yes" "No"; do
case $yn in
Yes )
sudo apt-get install default-jdk -y
cd ../LevelEdit
mkdir -p bin
cp src/icon* ./bin/
javac -d bin -sourcepath src src/com/corsixth/leveledit/Main.java
echo "#!/bin/bash" > LevelEdit
echo "java -cp bin com.corsixth.leveledit.Main" >> LevelEdit
chmod 755 LevelEdit
break;;
No ) break;;
esac
done

0 comments on commit c214333

Please sign in to comment.