mirror of
https://github.com/IHaskell/IHaskell.git
synced 2025-04-19 12:56:08 +00:00
Fixes #412 by adding modes and cleaning up build.sh
This commit is contained in:
parent
eef1bd2a5c
commit
eac5b864a2
35
build.sh
35
build.sh
@ -1,15 +1,33 @@
|
||||
#!/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
|
||||
|
Loading…
x
Reference in New Issue
Block a user