Commit eac5b864 authored by Andrew Gibiansky's avatar Andrew Gibiansky

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

parent eef1bd2a
#!/bin/sh #!/bin/sh
set -e 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. # Verify that we're in the IHaskell directory.
if [ ! -e ihaskell.cabal ]; then if [ ! -e ihaskell.cabal ]; then
echo "Run build.sh from inside the IHaskell directory:" print_help;
echo " ./build.sh all # Install IHaskell and deps (use if first install)" exit 1
echo " ./build.sh # Install only IHaskell, no deps" fi
echo " ./build.sh display # Install IHaskell and display libraries"
if [ $# -lt 1 ]; then
print_help;
exit 1 exit 1
fi fi
if [ ! $1 = "all" ] || [ ! $1 = "ihaskell" ] || [ ! $1 = "display" ] || [ ! $1 = "quick" ]; then
print_help;
exit 1;
fi
# What to install. # What to install.
INSTALLS="" INSTALLS=""
...@@ -18,17 +36,17 @@ rm -rf ~/.ipython/kernels/haskell ...@@ -18,17 +36,17 @@ rm -rf ~/.ipython/kernels/haskell
# Compile dependencies. # Compile dependencies.
if [ $# -gt 0 ]; then if [ $# -gt 0 ]; then
if [ $1 = "all" ]; then if [ $1 = "all" ] || [ $1 = "ihaskell" ]; then
INSTALLS="$INSTALLS ghc-parser ipython-kernel" INSTALLS="$INSTALLS ghc-parser ipython-kernel"
fi fi
fi fi
# Make ihaskell itself # Always make ihaskell itself
INSTALLS="$INSTALLS ." INSTALLS="$INSTALLS ."
# Install ihaskell-display packages. # Install ihaskell-display packages.
if [ $# -gt 0 ]; then if [ $# -gt 0 ]; then
if [ $1 = "display" ]; then if [ $1 = "display" ] || [ $1 = "all" ]; then
# Install all the display libraries # Install all the display libraries
# However, install ihaskell-diagrams separately... # However, install ihaskell-diagrams separately...
cd ihaskell-display cd ihaskell-display
...@@ -60,7 +78,8 @@ fi ...@@ -60,7 +78,8 @@ fi
# Finish installing ihaskell-diagrams. # Finish installing ihaskell-diagrams.
if [ $# -gt 0 ]; then 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.*" cabal install -j ihaskell-display/ihaskell-diagrams --force-reinstalls --constraint "arithmoi==0.4.*"
fi fi
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