updated on Thu Jan 19 04:14:35 UTC 2012
[aur-mirror.git] / cl-ppcre / cl-ppcre.install
blob9ad84d1e14b3d20e79f15445d3a7661672464b93
1 _pkgname=cl-ppcre
2 _compile_log=n
3 _lisp=()
5 if pacman -Qq clisp &>/dev/null ||
6    pacman -Qq clisp-gtk2 &>/dev/null ||
7    pacman -Qq clisp-new-clx &>/dev/null; then
8     _lisp=(${_lisp[@]} 'clisp')
9 fi
10 if pacman -Qq sbcl &>/dev/null; then
11     _lisp=(${_lisp[@]} 'sbcl')
13 if pacman -Qq cmucl &> /dev/null; then
14     _lisp=(${_lisp[@]} 'cmucl')
17 _compile_sbcl() {
18     sbcl --noinform --no-sysinit --no-userinit \
19         --eval "(require :asdf)" \
20         --eval "(pushnew #p\"/usr/share/common-lisp/systems/\" asdf:*central-registry* :test #'equal)" \
21         --eval "(asdf:operate 'asdf:compile-op '${_pkgname})" \
22         --eval "(quit)" &> ${_compile_log_file} || return 1
24 _compile_clisp() {
25     clisp --silent -norc -x \
26         "(load #p\"/usr/share/common-lisp/source/asdf/asdf.lisp\")
27         (pushnew #p\"/usr/share/common-lisp/systems/\" asdf:*central-registry* :test #'equal)
28         (asdf:operate 'asdf:compile-op '${_pkgname})
29         (quit)" &> ${_compile_log_file} || return 1
31 _compile_cmucl() {
32     cmucl -quiet -nositeinit -noinit -eval \
33         "(load #p\"/usr/share/common-lisp/source/asdf/asdf.lisp\")
34         (pushnew #p\"/usr/share/common-lisp/systems/\" asdf:*central-registry* :test #'equal)
35         (asdf:operate 'asdf:compile-op '${_pkgname})
36         (quit)" &> ${_compile_log_file} || return 1
39 post_install() {
40     for _lispiter in ${_lisp[@]}; do
41         echo "---> Compiling lisp files using ${_lispiter} <---"
42         if [ $_compile_log = 'y' ]; then
43             _compile_log_file=/tmp/${_pkgname}_${_lispiter}.log
44         else
45             _compile_log_file=/dev/null
46         fi
47         _compile_${_lispiter}
48         echo "---> Done compiling lisp files (using ${_lispiter}) <---"
49     done
51     cat << EOM
53     To load this library, load asdf and then run the following lines
54     (or their equivalent for your lisp of choice):
56     (push #p"/usr/share/common-lisp/systems/" asdf:*central-registry*)
57     (asdf:operate 'asdf:load-op '${_pkgname})
58 EOM
61 post_upgrade() {
62     post_install
65 pre_remove() {
66     rm -f /usr/share/common-lisp/source/${_pkgname}/{*.fas,*.fasl,*.lib,*.x86f}
69 pre_upgrade() {
70     pre_remove
73 # End of file