2014-01-20 13:12:02 +00:00
#!/bin/bash
2014-01-21 00:08:17 +00:00
#hack until saucy has 2.0.1 instead of 2.0.0
2014-01-22 14:28:29 +00:00
if [ " $1 " != "ni" ]
then
sudo apt-get install dialog
dialog --yesno "Install libSDL2.0.1 from ubuntu trusty?\nCurrently needed for saucy as they only serve 2.0.0 in the repos\n\nThe script will try to download the trusty-packages and resolve dependencies via gdebi" 20 75
install = ${ ? }
else
install = 0
fi
2014-01-21 00:08:17 +00:00
if [ [ $install -eq 0 ] ]
then
2014-01-21 01:15:43 +00:00
sudo apt-get install gdebi
2014-01-21 00:08:17 +00:00
echo "installing libsdl2.0.1"
if [ ! -f "libsdl2-2.0-0_2.0.1+dfsg1-1ubuntu1_amd64.deb" ]
then
wget http://de.archive.ubuntu.com/ubuntu/pool/universe/libs/libsdl2/libsdl2-2.0-0_2.0.1+dfsg1-1ubuntu1_amd64.deb
2014-01-22 14:28:29 +00:00
sudo gdebi --n libsdl2-2.0-0_2.0.1+dfsg1-1ubuntu1_amd64.deb
2014-01-21 00:08:17 +00:00
fi
if [ ! -f "libsdl2-dev_2.0.1+dfsg1-1ubuntu1_amd64.deb" ]
then
wget http://de.archive.ubuntu.com/ubuntu/pool/universe/libs/libsdl2/libsdl2-dev_2.0.1+dfsg1-1ubuntu1_amd64.deb
2014-01-22 14:28:29 +00:00
sudo gdebi --n libsdl2-dev_2.0.1+dfsg1-1ubuntu1_amd64.deb
2014-01-21 01:15:43 +00:00
fi
if [ ! -f "libsdl2-dbg_2.0.1+dfsg1-1ubuntu1_amd64.deb" ]
then
wget http://de.archive.ubuntu.com/ubuntu/pool/universe/libs/libsdl2/libsdl2-dbg_2.0.1+dfsg1-1ubuntu1_amd64.deb
2014-01-22 14:28:29 +00:00
sudo gdebi --n libsdl2-dbg_2.0.1+dfsg1-1ubuntu1_amd64.deb
2014-01-21 00:08:17 +00:00
fi
2014-01-21 15:18:48 +00:00
if [ ! -f "libsdl2-ttf-2.0-0_2.0.12+dfsg1-2_amd64.deb" ]
then
wget http://de.archive.ubuntu.com/ubuntu/pool/universe/libs/libsdl2-ttf/libsdl2-ttf-2.0-0_2.0.12+dfsg1-2_amd64.deb
2014-01-22 14:28:29 +00:00
sudo gdebi --n libsdl2-ttf-2.0-0_2.0.12+dfsg1-2_amd64.deb
2014-01-21 15:18:48 +00:00
fi
if [ ! -f "libsdl2-ttf-dev_2.0.12+dfsg1-2_amd64.deb" ]
then
wget http://de.archive.ubuntu.com/ubuntu/pool/universe/libs/libsdl2-ttf/libsdl2-ttf-dev_2.0.12+dfsg1-2_amd64.deb
2014-01-22 14:28:29 +00:00
sudo gdebi --n libsdl2-ttf-dev_2.0.12+dfsg1-2_amd64.deb
2014-01-21 15:18:48 +00:00
fi
if [ ! -f "libsdl2-image-2.0-0_2.0.0+dfsg-3_amd64.deb" ]
then
wget http://de.archive.ubuntu.com/ubuntu/pool/universe/libs/libsdl2-image/libsdl2-image-2.0-0_2.0.0+dfsg-3_amd64.deb
2014-01-22 14:28:29 +00:00
sudo gdebi --n libsdl2-image-2.0-0_2.0.0+dfsg-3_amd64.deb
2014-01-21 15:18:48 +00:00
fi
if [ ! -f "libsdl2-image-dev_2.0.0+dfsg-3_amd64.deb" ]
then
wget http://de.archive.ubuntu.com/ubuntu/pool/universe/libs/libsdl2-image/libsdl2-image-dev_2.0.0+dfsg-3_amd64.deb
2014-01-22 14:28:29 +00:00
sudo gdebi --n libsdl2-image-dev_2.0.0+dfsg-3_amd64.deb
2014-01-21 15:18:48 +00:00
fi
2014-01-21 00:08:17 +00:00
fi
## hack end
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
echo "trying to build"
2014-01-21 15:18:48 +00:00
cabal install haddock
2014-01-20 13:12:02 +00:00
for d in ` find . -maxdepth 1 -type d`
do
if [ " $d " = = "." ]
then
continue
else
echo " building: $d ... "
cd " $d "
2014-01-21 00:08:17 +00:00
cabal clean
2014-01-20 13:12:02 +00:00
cabal configure
cabal build
2014-01-20 13:31:17 +00:00
cabal haddock --hyperlink-source
cabal install
2014-01-20 13:12:02 +00:00
cd ..
fi
done