2014-01-20 13:12:02 +00:00
#!/bin/bash
2014-01-22 14:28:29 +00:00
if [ " $1 " != "ni" ]
then
2014-05-02 14:51:27 +00:00
if [ ! -f /usr/bin/dialog ]
then
sudo apt-get install dialog
fi
dialog --yesno "Install libSDL2 from ubuntu trusty repositories?\n\nSAUCY IS NOT SUPPORTED! You NEED Ubuntu 14.04+\n\nThe script will try to install the trusty-packages." 20 75
2014-01-22 14:28:29 +00:00
install = ${ ? }
else
install = 0
fi
2014-01-21 00:08:17 +00:00
if [ [ $install -eq 0 ] ]
then
2014-05-02 14:51:27 +00:00
sudo apt-get install libsdl2-dev libsdl2-ttf-dev
2014-01-21 00:08:17 +00:00
fi
2014-05-02 14:51:27 +00:00
2014-01-21 00:08:17 +00:00
2014-01-20 13:12:02 +00:00
echo "cloning repositories"
if [ ! -d "hsSDL2" ]
then
git clone https://github.com/Lemmih/hsSDL2 hsSDL2
else
cd hsSDL2
git pull
cd ..
fi
2014-02-05 15:33:32 +00:00
if [ ! -d "hsSDL2-ttf" ]
then
git clone https://github.com/osa1/hsSDL2-ttf hsSDL2-ttf
else
cd hsSDL2-ttf
git pull
cd ..
fi
2014-01-20 13:12:02 +00:00
echo "trying to build"
2014-01-21 15:18:48 +00:00
cabal install haddock
2014-05-02 14:51:27 +00:00
echo "building hsSDL2.."
cd hsSDL2
cabal sandbox init
cabal install --only-dependencies
cabal build
cd ..
for t in "hsSDL2-ttf"
2014-01-20 13:12:02 +00:00
do
2014-05-02 14:51:27 +00:00
echo " building ${ t } .. "
cd " ${ t } "
cabal sandbox add-source ../hsSDL2
cabal install --only-dependencies
cabal build
cd ..
2014-01-20 13:12:02 +00:00
done