Source

sage-mode / spkg-install

Full commit
ncalexan ccd3417 

ncalexan ef90f8c 


ncalexan ccd3417 



ncalexan e9a7039 
ncalexan ccd3417 





ncalexan e9a7039 
ncalexan ccd3417 

ncalexan e9a7039 

ncalexan ef90f8c 
ncalexan e9a7039 
ncalexan c9a9fce 
ncalexan e9a7039 
Ivan Andrus 3798a70 





Ivan Andrus 75d1b36 
Ivan Andrus 3798a70 












Ivan Andrus 5d9ae43 

Ivan Andrus 3798a70 
#!/bin/sh

CUR=`pwd`

# Build and install Python support files
cd src/
python setup.py build

if [ $? -ne 0 ]; then
    echo "Failure to build sage-mode Python support files"
    exit 1
fi

python setup.py install

if [ $? -ne 0 ]; then
    echo "Failure to install sage-mode Python support files"
    exit 1
fi

# Copy emacs lisp to SAGE_DATA, and print helpful instructions
cd "$CUR"
rm -rf $SAGE_DATA/emacs
cp -r emacs $SAGE_DATA/emacs

# Remove old elc files if any.
# Then, even if byte compiling fails, they won't taint the setup.
rm -f $SAGE_DATA/emacs/*.elc

# Byte compile -- this can fail since we don't require emacs for Sage
EMACS=${EMACS-emacs}
$EMACS -batch 2> /dev/null > /dev/null
if [ $? -ne 0 ]; then
    echo
    echo WARNING: Could not find emacs at "'$EMACS'"
    echo "Set the EMACS environment variable or ignore this if you don't have emacs installed"

else

    echo Byte compiling sage-mode with "'$EMACS'"
    echo Set the EMACS environment variable to compile with a different emacs.
    $EMACS -batch -L $SAGE_DATA/emacs/ -f batch-byte-compile $SAGE_DATA/emacs/*.el

    # Trick the shell into expanding $SAGE_DATA and $SAGE_ROOT
    sh -c "cat <<EOF
$(perl -ne 'print if (/Start .emacs/../End .emacs/)' SPKG.txt)
EOF"

fi