Commit eac5b864 authored by Andrew Gibiansky's avatar Andrew Gibiansky

Fixes #412 by adding modes and cleaning up build.sh

parent eef1bd2a
#!/bin/sh
set -e
set -x
function print_help {
echo "Run build.sh from inside the IHaskell directory to install packages in this repository:"
echo " ./build.sh ihaskell # Install IHaskell and its dependencies"
echo " ./build.sh quick # Install IHaskell, but not its dependencies"
echo " ./build.sh all # Install IHaskell, dependencies, and all display packages"
echo " ./build.sh display # Install IHaskell and display libraries"
echo
echo "If this is your first time installing IHaskell, run './build.sh ihaskell'."
}
# 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"
print_help;
exit 1
fi
if [ $# -lt 1 ]; then
print_help;
exit 1
fi
if [ ! $1 = "all" ] || [ ! $1 = "ihaskell" ] || [ ! $1 = "display" ] || [ ! $1 = "quick" ]; then
print_help;
exit 1;
fi
# What to install.
INSTALLS=""
......@@ -18,17 +36,17 @@ rm -rf ~/.ipython/kernels/haskell
# Compile dependencies.
if [ $# -gt 0 ]; then
if [ $1 = "all" ]; then
if [ $1 = "all" ] || [ $1 = "ihaskell" ]; then
INSTALLS="$INSTALLS ghc-parser ipython-kernel"
fi
fi
# Make ihaskell itself
# Always make ihaskell itself
INSTALLS="$INSTALLS ."
# Install ihaskell-display packages.
if [ $# -gt 0 ]; then
if [ $1 = "display" ]; then
if [ $1 = "display" ] || [ $1 = "all" ]; then
# Install all the display libraries
# However, install ihaskell-diagrams separately...
cd ihaskell-display
......@@ -60,7 +78,8 @@ fi
# Finish installing ihaskell-diagrams.
if [ $# -gt 0 ]; then
if [ $1 = "display" ]; then
if [ $1 = "display" ] || [ $1 = "all" ]; then
echo 'Installing IHaskell diagrams support.'
cabal install -j ihaskell-display/ihaskell-diagrams --force-reinstalls --constraint "arithmoi==0.4.*"
fi
fi
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment