Hash :
57a0d674
Author :
Thomas de Grivel
Date :
2022-12-04T03:20:19
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
#!/bin/sh
set -e
REPO_DIR=$HOME/common-lisp
GITHUB='https://github.com/'
KMX='https://git.kmx.io/'
# detect gnu make
if which gmake > /dev/null; then
MAKE=gmake
else
MAKE=make
fi
# clone git repo
maybe_clone() {
HOST="$1"
OWNER="$2"
NAME="$3"
if ! [ -d "${REPO_DIR}/${OWNER}/${NAME}" ]; then
echo "Installing ${HOST}${OWNER}/${NAME} into ${REPO_DIR}/${OWNER}/${NAME}"
mkdir -p "${REPO_DIR}/${OWNER}"
git -C "${REPO_DIR}/${OWNER}" clone "${HOST}${OWNER}/${NAME}"
fi
}
# Install ASDF from Github
maybe_clone "${GITHUB}" 'fare' 'asdf'
"${MAKE}" -C "${REPO_DIR}/fare/asdf"
# Install Repo from Github
maybe_clone "${KMX}" 'kmx.io' 'repo'
if ! [ -f "${REPO_DIR}/repo-index.lisp" ]; then
( cd "${REPO_DIR}" && ln -s kmx.io/repo/repo-index.lisp; )
fi
# Configure SBCL
{
echo "(load \"${REPO_DIR}/fare/asdf/build/asdf\")"
echo "(load \"${REPO_DIR}/kmx.io/repo/repo\")"
echo "(repo:boot)"
} >> ~/.sbclrc