updated on Thu Jan 26 00:18:00 UTC 2012
[aur-mirror.git] / cl-javascript-git / cl-javascript.install
blob0d66f9cb2dc68c691183f04132a684ecf41bbe38
1 # arg 1:  the new package version
3 _pkgname=cl-js
4 _compile_log=n
5 _lisp=()
7 if pacman -Qq clisp-new-clx &>/dev/null ||
8    pacman -Qq clisp-gtk2 &>/dev/null ||
9    pacman -Qq clisp-new-clx &>/dev/null; then
10     _lisp=(${_lisp[@]} 'clisp')
12 if pacman -Qq sbcl &>/dev/null; then
13     _lisp=(${_lisp[@]} 'sbcl')
15 if pacman -Qq cmucl &> /dev/null; then
16     _lisp=(${_lisp[@]} 'cmucl')
19 _compile_sbcl() {
20     sbcl --noinform --no-sysinit --no-userinit \
21         --eval "(require :asdf)" \
22         --eval "(pushnew #p\"/usr/share/common-lisp/systems/\" asdf:*central-registry* :test #'equal)" \
23         --eval "(asdf:operate 'asdf:compile-op '${_pkgname})" \
24         --eval "(quit)" &> ${_compile_log_file} || return 1
26 _compile_clisp() {
27     clisp --silent -norc -x \
28         "(load #p\"/usr/share/common-lisp/source/asdf/asdf\")
29         (pushnew #p\"/usr/share/common-lisp/systems/\" asdf:*central-registry* :test #'equal)
30         (asdf:operate 'asdf:compile-op '${_pkgname})
31         (quit)" &> ${_compile_log_file} || return 1
33 _compile_cmucl() {
34     cmucl -quiet -nositeinit -noinit -eval \
35         "(load #p\"/usr/share/common-lisp/source/asdf/asdf\")
36         (pushnew #p\"/usr/share/common-lisp/systems/\" asdf:*central-registry* :test #'equal)
37         (asdf:operate 'asdf:compile-op '${_pkgname})
38         (quit)" &> ${_compile_log_file} || return 1
41 post_install() {
42     for _lispiter in ${_lisp[@]}; do
43         echo "---> Compiling lisp files using ${_lispiter} <---"
44         if [ $_compile_log = 'y' ]; then
45             _compile_log_file=/tmp/${_pkgname}_${_lispiter}.log
46         else
47             _compile_log_file=/dev/null
48         fi
49         _compile_${_lispiter}
50         echo "---> Done compiling lisp files (using ${_lispiter}) <---"
51     done
53     cat << EOM
55     To load this library, load asdf and then run the following lines
56     (or their equivalent for your lisp of choice):
58     (push #p"/usr/share/common-lisp/systems/" asdf:*central-registry*)
59     (asdf:operate 'asdf:load-op '${_pkgname})
60 EOM
63 post_upgrade() {
64     post_install $1
67 pre_remove() {
68     rm -f /usr/share/common-lisp/source/$_pkgname/{*.fas,*.fasl,*.lib,*.x86f}
71 op=$1
72 shift
74 $op $*
76 # End of file