updated on Fri Jan 13 04:01:25 UTC 2012
[aur-mirror.git] / cl-gtk2 / cl-gtk2.install
blob3c4f5265f504dd247a522d147ee97f09f225a7ff
1 # arg 1:  the new package version
3 _pkgname_base=cl-gtk2
4 _subsystems='glib pango gdk gtk gtkglext cairo'
5 _compile_log=n
6 _lisp=()
8 if pacman -Qq clisp-new-clx &>/dev/null ||
9    pacman -Qq clisp-gtk2 &>/dev/null ||
10    pacman -Qq clisp-new-clx &>/dev/null; then
11     _lisp=(${_lisp[@]} 'clisp')
13 if pacman -Qq sbcl &>/dev/null; then
14     _lisp=(${_lisp[@]} 'sbcl')
16 if pacman -Qq cmucl &> /dev/null; then
17     _lisp=(${_lisp[@]} 'cmucl')
20 _compile_sbcl() {
21     sbcl --noinform --no-sysinit --no-userinit \
22         --eval "(require :asdf)" \
23         --eval "(pushnew #p\"/usr/share/common-lisp/systems/\" asdf:*central-registry* :test #'equal)" \
24         --eval "(asdf:operate 'asdf:compile-op '${_pkgname})" \
25         --eval "(quit)" &> ${_compile_log_file} || return 1
27 _compile_clisp() {
28     clisp --silent -norc -x \
29         "(load #p\"/usr/share/common-lisp/source/asdf/asdf\")
30         (pushnew #p\"/usr/share/common-lisp/systems/\" asdf:*central-registry* :test #'equal)
31         (asdf:operate 'asdf:compile-op '${_pkgname})
32         (quit)" &> ${_compile_log_file} || return 1
34 _compile_cmucl() {
35     cmucl -quiet -nositeinit -noinit -eval \
36         "(load #p\"/usr/share/common-lisp/source/asdf/asdf\")
37         (pushnew #p\"/usr/share/common-lisp/systems/\" asdf:*central-registry* :test #'equal)
38         (asdf:operate 'asdf:compile-op '${_pkgname})
39         (quit)" &> ${_compile_log_file} || return 1
42 post_install() {
43     for _lispiter in ${_lisp[@]}; do
44         echo "---> Compiling lisp files using ${_lispiter} <---"
45         for _subsystem in ${_subsystems}; do
46             _pkgname=${_pkgname_base}-${_subsystem}
47             echo "---> Compiling ${_pkgname} <---"
48             if [ $_compile_log = 'y' ]; then
49                 _compile_log_file=/tmp/${_pkgname}_${_lispiter}.log
50             else
51                 _compile_log_file=/dev/null
52             fi
53             _compile_${_lispiter}
54         done
55         echo "---> Done compiling lisp files (using ${_lispiter}) <---"
56     done
58     cat << EOM
60     To load this library, load asdf and then run the following lines
61     (or their equivalent for your lisp of choice):
63     (push #p"/usr/share/common-lisp/systems/" asdf:*central-registry*)
64     (asdf:operate 'asdf:load-op '${_pkgname})
65 EOM
68 post_upgrade() {
69     post_install $1
72 pre_remove() {
73     rm -f /usr/share/common-lisp/source/${_pkgname}/{*.fas,*.fasl,*.lib,*.x86f}
76 op=$1
77 shift
79 $op $*
81 # End of file