-
Notifications
You must be signed in to change notification settings - Fork 0
/
quick_quicklisp.sh.in
136 lines (115 loc) · 4.88 KB
/
quick_quicklisp.sh.in
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
#! @BASH@
# fulci: a program to organize your movies collection
# Copyright (C) 2018 cage
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
QUICKLISP_INSTALL_DIR=$HOME/quicklisp/
QUICKLISP_URL="https://beta.quicklisp.org/quicklisp.lisp"
QUICKLISP_SIG_URL="https://beta.quicklisp.org/quicklisp.lisp.asc"
QUICKLISP_KEY_URL="https://beta.quicklisp.org/release-key.txt"
QUICKLISP="quicklisp.lisp"
QUICKLISP_SIG="quicklisp.lisp.asc"
QUICKLISP_KEY="release-key"
QUICKLISP_SIGNATURE="D7A3 +489D +DEFE +32B7 +D0E7 +CC61 +3079 +65AB +028B +5FF7";
LISP_SOURCE_REGISTRY_DIR="$HOME/.config/common-lisp/"
LISP_SOURCE_REGISTRY_FILE="$LISP_SOURCE_REGISTRY_DIR/source-registry.conf"
BOLD_TEXT="\033[1m"
NORMAL_TEXT="\033[0m"
VERIFY_OK_RES=2
echo_bold () {
echo -e "${BOLD_TEXT}${1}${NORMAL_TEXT}";
}
check_quicklisp () {
if [ -d "$QUICKLISP_INSTALL_DIR" ]; then
echo 0;
else
echo 1;
fi
}
check_quicklisp_signature () {
chk1_prog='BEGIN {res=0} /Good signature.*[email protected]/ {res++; print res}'
chk2_prog="BEGIN {res=0} /${QUICKLISP_SIGNATURE}/ {res++; print res}"
res1=$(LC_MESSAGES="C" @GPG@ --verify quicklisp.lisp.asc quicklisp.lisp 2> >(@GAWK@ -- "${chk1_prog}"))
res2=$(@GPG@ --verify quicklisp.lisp.asc quicklisp.lisp 2> >(@GAWK@ -- "${chk2_prog}"))
res=$(expr $res1 + $res2)
echo -n "$res"
}
install_quicklisp () {
echo_bold "Downloading quicklisp...";
@CURL@ "$QUICKLISP_URL" > $QUICKLISP;
@CURL@ "$QUICKLISP_SIG_URL" > $QUICKLISP_SIG;
@CURL@ "$QUICKLISP_KEY_URL" > $QUICKLISP_KEY;
echo_bold "Importing gpg key.";
@GPG@ --import $QUICKLISP_KEY;
echo_bold "Verifing key";
signature_verified=$(check_quicklisp_signature);
if [ "$signature_verified" -ne $VERIFY_OK_RES ]; then
echo_bold "Key verification failed!"
exit 1;
else
echo_bold "Key sucessfully verified.";
@LISP_COMPILER@ --load $QUICKLISP \
--eval "(quicklisp-quickstart:install)" \
--eval "(ql:add-to-init-file)" \
--eval "(sb-ext:quit)";
@MKDIR_P@ -p $LISP_SOURCE_REGISTRY_DIR;
PAR_PWD="${PWD%/*}";
echo "(:source-registry" > $LISP_SOURCE_REGISTRY_FILE;
echo " (:tree \"$PAR_PWD\")" >> $LISP_SOURCE_REGISTRY_FILE;
echo ":inherit-configuration)" >> $LISP_SOURCE_REGISTRY_FILE;
echo "quicklisp installed";
fi
}
install_dependency () {
# add here the lisp dependency
# e.g.
# @LISP_COMPILER@ \ <- note the '\'
# --eval "(ql:quickload \"swank\")" \ <- note the '\'
# --eval "(sb-ext:quit)"; <- keep this line as latest
@LISP_COMPILER@ \
--eval "(ql:quickload \"alexandria\")" \
--eval "(ql:quickload \"access\")" \
--eval "(ql:quickload \"cl-ppcre\")" \
--eval "(ql:quickload \"cl-syntax\")" \
--eval "(ql:quickload \"lquery\")" \
--eval "(ql:quickload \"osicat\")" \
--eval "(ql:quickload \"local-time\")" \
--eval "(ql:quickload \"cl-csv\")" \
--eval "(ql:quickload \"cl-lex\")" \
--eval "(ql:quickload \"yacc\")" \
--eval "(ql:quickload \"parse-number\")" \
--eval "(ql:quickload \"sqlite\")" \
--eval "(ql:quickload \"sxql\")" \
--eval "(ql:quickload \"nodgui\")" \
--eval "(ql:quickload \"drakma\")" \
--eval "(ql:quickload \"log4cl\")" \
--eval "(ql:quickload \"clunit2\")" \
--eval "(ql:quickload \"cl-colors2\")" \
--eval "(ql:quickload \"cl-i18n\")" \
--eval "(ql:quickload \"cl-jpeg\")" \
--eval "(ql:quickload \"cl-json\")" \
--eval "(ql:quickload \"osicat\")" \
--eval "(ql:quickload \"babel\")" \
--eval "(ql:quickload \"nodgui\")" \
--eval "(ql:quickload \"marshal\")" \
--eval "(ql:quickload \"cl-pslib\")" \
--eval "(ql:quickload \"cl-pslib-barcode\")" \
--eval "(sb-ext:quit)";
}
quicklisp_installed_p=$(check_quicklisp);
if [ $quicklisp_installed_p -eq 0 ]; then
echo_bold "Quicklisp already installed; fetching libraries...";
install_dependency;
else
install_quicklisp;
install_dependency;
fi
echo_bold "Finished."