2014-01-08 23:54:52 -05:00
|
|
|
#!/bin/bash
|
|
|
|
set -e
|
2014-01-08 19:22:51 -05:00
|
|
|
|
2014-02-28 21:16:15 -08:00
|
|
|
# Verify that we're in the IHaskell directory.
|
2014-03-09 12:10:37 -07:00
|
|
|
if [ ! -e ihaskell.cabal ]; then
|
|
|
|
echo "Run build.sh from inside the IHaskell directory:"
|
|
|
|
echo " ./build.sh all # Install IHaskell and deps (use if first install)"
|
|
|
|
echo " ./build.sh # Install only IHaskell, no deps"
|
|
|
|
echo " ./build.sh display # Install IHaskell and display libraries"
|
|
|
|
exit 1
|
|
|
|
fi
|
2014-02-28 21:16:15 -08:00
|
|
|
|
|
|
|
# What to install.
|
|
|
|
INSTALLS=""
|
2014-01-08 19:22:51 -05:00
|
|
|
|
|
|
|
# Make the profile
|
2014-01-05 14:08:06 -05:00
|
|
|
cd profile
|
2014-01-06 11:55:37 -05:00
|
|
|
rm -f profile.tar
|
2014-01-05 14:08:06 -05:00
|
|
|
tar -cvf profile.tar *
|
|
|
|
cd ..
|
2014-01-08 19:22:51 -05:00
|
|
|
|
2014-02-28 21:16:15 -08:00
|
|
|
# Remove my profile
|
|
|
|
rm -rf ~/.ipython/profile_haskell
|
|
|
|
|
|
|
|
# Compile dependencies.
|
2014-02-06 22:34:39 -08:00
|
|
|
if [ $# -gt 0 ]; then
|
|
|
|
if [ $1 = "all" ]; then
|
2014-02-28 21:16:15 -08:00
|
|
|
INSTALLS="$INSTALLS ipython-kernel ghc-parser ghci-lib"
|
2014-02-06 22:34:39 -08:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2014-01-08 19:22:51 -05:00
|
|
|
# Make ihaskell itself
|
2014-02-28 21:16:15 -08:00
|
|
|
INSTALLS="$INSTALLS ."
|
2014-01-06 13:26:32 -05:00
|
|
|
|
2014-02-28 21:16:15 -08:00
|
|
|
# Install ihaskell-display packages.
|
2014-01-11 22:33:42 -07:00
|
|
|
if [ $# -gt 0 ]; then
|
2014-02-15 17:43:40 -08:00
|
|
|
if [ $1 = "display" ]; then
|
2014-01-11 22:33:42 -07:00
|
|
|
# Install all the display libraries
|
2014-03-16 16:37:32 -07:00
|
|
|
# However, install ihaskell-diagrams separately...
|
2014-01-11 22:33:42 -07:00
|
|
|
cd ihaskell-display
|
2014-03-16 16:37:32 -07:00
|
|
|
for dir in `ls | grep -v diagrams`
|
2014-01-11 22:33:42 -07:00
|
|
|
do
|
2014-02-28 21:16:15 -08:00
|
|
|
INSTALLS="$INSTALLS ihaskell-display/$dir"
|
2014-01-11 22:33:42 -07:00
|
|
|
done
|
2014-02-28 21:16:15 -08:00
|
|
|
cd ..
|
2014-01-11 22:33:42 -07:00
|
|
|
fi
|
|
|
|
fi
|
2014-02-28 21:16:15 -08:00
|
|
|
|
|
|
|
# Clean all required directories, just in case.
|
|
|
|
TOP=`pwd`
|
|
|
|
for pkg in $INSTALLS
|
|
|
|
do
|
|
|
|
cd ./$pkg
|
|
|
|
cabal clean
|
|
|
|
cd $TOP
|
|
|
|
done
|
|
|
|
|
|
|
|
# Stick a "./" before everything.
|
|
|
|
INSTALL_DIRS=`echo $INSTALLS | tr ' ' '\n' | sed 's#^#./#' | tr ' ' '\n'`
|
2014-03-02 13:21:02 -08:00
|
|
|
cabal install -j $INSTALL_DIRS --force-reinstalls
|
2014-03-16 16:37:32 -07:00
|
|
|
|
|
|
|
# Finish installing ihaskell-diagrams.
|
|
|
|
if [ $# -gt 0 ]; then
|
|
|
|
if [ $1 = "display" ]; then
|
|
|
|
cabal install -j ihaskell-display/ihaskell-diagrams --force-reinstalls
|
|
|
|
fi
|
|
|
|
fi
|