if [ -z "$SAGE_LOCAL" ]; then
    echo >&2 "Error: SAGE_LOCAL undefined - exiting..."
    echo >&2 "Maybe run 'sage -sh'?"
    exit 1
fi

cd src

# Check that Graphviz is installed by running dot2tex from the source
# directory.
sage-python23 -c "import sys; from dot2tex.dotparsing import find_graphviz; sys.exit(0 if find_graphviz() else 1)"
if [ $? -ne 0 ]; then
    echo >&2 "Error: dot2tex requires Graphviz but Graphviz is not installed. You can download Graphviz at http://www.graphviz.org/Download..php"
    exit 1
fi

sdh_pip_install .

if [ $? -ne 0 ]; then
    exit 1
fi

