IHaskell/build.sh

68 lines
1.5 KiB
Bash
Raw Normal View History

#!/bin/bash
set -e
2014-02-28 21:16:15 -08:00
# Verify that we're in the IHaskell directory.
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=""
# Make the profile
cd profile
2014-01-06 11:55:37 -05:00
rm -f profile.tar
tar -cvf profile.tar *
cd ..
2014-02-28 21:16:15 -08:00
# Remove my profile
rm -rf ~/.ipython/profile_haskell
# Compile dependencies.
if [ $# -gt 0 ]; then
if [ $1 = "all" ]; then
2014-02-28 21:16:15 -08:00
INSTALLS="$INSTALLS ipython-kernel ghc-parser ghci-lib"
fi
fi
# Make ihaskell itself
2014-02-28 21:16:15 -08:00
INSTALLS="$INSTALLS ."
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