1 # Maintainer: M Rawash <mrawash@gmail.com>
2 # Contributor: olvar <beren dot olvar (at) gmail dot com>
3 # Contributor: Andrew Antle <andrew dot antle at gmail dot com>
4 # Contributor: joyfulgirl <joyfulgirl (at) archlinux.us>
5 # Contributor: Jonathan Friedman <jonf@gojon.com>
10 pkgdesc="A tiling, keyboard-driven window manager written in common lisp"
11 arch=('i686' 'x86_64')
12 url="http://www.nongnu.org/stumpwm/"
16 if pacman -Qq sbcl &>/dev/null; then
17 depends=('sbcl' 'clx' 'cl-ppcre')
19 elif pacman -Qq clisp-new-clx &>/dev/null; then
20 # If somebody compiled this specially, chances are they want to use it
21 depends=('clisp-new-clx' 'cl-ppcre' 'cl-asdf')
23 source=(http://common-lisp.net/project/asdf/asdf.lisp)
24 md5sums=('0f172cc814e11054c37c29fa2acfbfae')
26 # No, this isn't redundant.
27 depends=('sbcl' 'clx' 'cl-ppcre')
31 makedepends=('git' 'texinfo' 'autoconf')
32 optdepends=('emacs: Edit and eval stumpwm code with M-x stumpwm-mode'
33 'alsa-utils: Use contrib/amixer.lisp to control audio volume'
34 'aumix: Use contrib/aumix.lisp to control audio volume'
35 'mpd: Use contrib/mpd.lisp to control the mpd'
36 'surfraw: Use contrib/surfraw.lisp to surf the Internet')
37 install=stumpwm.install
38 options=(!strip) # Thanks to sidereus for pointing this out
40 _gitroot="git://git.savannah.nongnu.org/stumpwm.git"
44 msg "Connecting to ${_gitroot}..."
46 if [ -d ${srcdir}/${_gitname} ] ; then
47 cd ${srcdir}/${_gitname} && git pull origin master
52 msg "GIT checkout done or server timeout"
53 msg "Starting make..."
55 rm -rf ${srcdir}/${_gitname}-build
56 cp -a ${srcdir}/${_gitname} ${srcdir}/${_gitname}-build
57 cd ${srcdir}/${_gitname}-build
60 if [ "$_lisp" = "sbcl" ]; then
62 ./configure --prefix=/usr \
64 --with-ppcre=/usr/share/common-lisp/source/cl-ppcre
66 # this is necesary since the AUR packages do not modify the asdf's registry by default
67 _sbcl_bopt="sbcl_BUILDOPTS=--eval \"(require :asdf)\" \
68 --eval \"(pushnew #p\\\"/usr/share/common-lisp/systems/\\\" asdf:*central-registry* :test #'equal)\" \
69 --eval \"(asdf:operate 'asdf:load-op 'clx)\" \
70 --load ./make-image.lisp"
71 _sbcl_iopt="sbcl_INFOOPTS=--eval \"(require 'asdf)\" \
72 --eval \"(pushnew #p\\\"/usr/share/common-lisp/systems/\\\" asdf:*central-registry* :test #'equal)\" \
73 --eval \"(asdf:operate 'asdf:load-op 'clx)\" \
74 --eval \"(require 'stumpwm)\" \
75 --load ./manual.lisp \
76 --eval \"(progn (stumpwm::generate-manual) (sb-ext:quit))\""
78 make "$_sbcl_bopt" "$_sbcl_iopt"
80 elif [ "$_lisp" = "clisp" ]; then
81 _lisp_source=/usr/share/common-lisp/source/
82 _ppcre_source=${_lisp_source}cl-ppcre/
84 # Sometimes there are no compiled versions of ppcre.
85 # in this case we need to compile and use our own, and then we install them
86 if [ ! -f ${_ppcre_source}/api.fas ]; then
90 mkdir ${srcdir}/cl-ppcre_temp
91 mkdir ${srcdir}/cl-ppcre_temp/systems
92 mkdir ${srcdir}/cl-ppcre_temp/source
94 export ASDF_OUTPUT_TRANSLATIONS="/usr/share/common-lisp/source/:${srcdir}/cl-ppcre_temp/source/"
95 # for compiling we use the asdf source we donwloaded
96 clisp -norc -K full -on-error exit \
97 -x "(require 'asdf '(\"${srcdir}/asdf.lisp\"))" \
98 -x "(pushnew #p\"/usr/share/common-lisp/systems/\" asdf:*central-registry* :test #'equal)" \
99 -x "(asdf:operate 'asdf:compile-op 'cl-ppcre)"
101 # once we have cl-ppcre compiled we copy the necesary files to
102 # this new location, and set the necessary options for make
103 cp $_ppcre_source/cl-ppcre.asd ${srcdir}/cl-ppcre_temp/source/cl-ppcre/
104 cp $_ppcre_source/*.lisp ${srcdir}/cl-ppcre_temp/source/cl-ppcre/
105 _ppcre_source=${srcdir}/cl-ppcre_temp/source/cl-ppcre/
107 _clisp_bopt="clisp_BUILDOPTS=-K full -on-error exit \
108 -x \"(require 'asdf '(\\\"asdf.lisp\\\"))\" \
109 -x \"(pushnew \\\"${srcdir}/cl-ppcre_temp/systems/\\\" \
110 asdf:*central-registry* \
112 -x \"(load \\\"./make-image.lisp\\\")\""
115 ./configure --prefix=/usr \
117 --with-ppcre=$_ppcre_source
119 if [ -z "$_clisp_bopt" ]; then
126 make destdir=$pkgdir install
128 rm -f ${pkgdir}/usr/share/info/dir
130 # Installation of stumpish, the contributed lisp,
131 # and the emacs stumpwm mode.
132 install -m 755 ${srcdir}/${_gitname}-build/contrib/stumpish ${pkgdir}/usr/bin
134 install -Dm 644 sample-stumpwmrc.lisp ${pkgdir}/etc/stumpwmrc.sample
135 install -d ${pkgdir}/usr/share/${_gitname}
136 install -m 644 ${srcdir}/${_gitname}-build/contrib/*.lisp ${pkgdir}/usr/share/${_gitname}
138 install -Dm 644 ${srcdir}/${_gitname}-build/contrib/stumpwm-mode.el \
139 ${pkgdir}/usr/share/emacs/site-lisp/stumpwm-mode.el
142 # if we had to compile our own fas files, then we need to install them too.
143 if [ "x$_own_fas" = "x1" ]; then
144 install -d ${pkgdir}/usr/share/common-lisp/source/cl-ppcre
145 install -m 644 ${srcdir}/cl-ppcre_temp/source/cl-ppcre/*.fas \
146 ${pkgdir}/usr/share/common-lisp/source/cl-ppcre/
150 # vim:sw=2 ts=2 et si: