Hash :
466a76dc
Author :
Thomas de Grivel
Date :
2022-11-04T15:57:18
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 49
#!/bin/sh
set -e
REPO_DIR=$HOME/common-lisp
REPO_DIR=/tmp/common-lisp
GITHUB='https://github.com/'
KMX='https://git.kmx.io/'
# detect gnu make
if which gmake; 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.manifest" ]; then
( cd "${REPO_DIR}" && ln -s kmx.io/repo/repo.manifest; )
fi
# Configure SBCL
{
echo "(load \"${REPO_DIR}/fare/asdf/build/asdf\")"
echo "(load \"${REPO_DIR}/kmx.io/repo/repo\")"
echo "(repo:boot)"
} >> ~/.sbclrc