diff options
Diffstat (limited to 'pcr/clx-git')
-rw-r--r-- | pcr/clx-git/PKGBUILD | 71 | ||||
-rw-r--r-- | pcr/clx-git/README.licensing | 4 | ||||
-rw-r--r-- | pcr/clx-git/clx.install | 76 |
3 files changed, 151 insertions, 0 deletions
diff --git a/pcr/clx-git/PKGBUILD b/pcr/clx-git/PKGBUILD new file mode 100644 index 000000000..6e2a3369b --- /dev/null +++ b/pcr/clx-git/PKGBUILD @@ -0,0 +1,71 @@ +#Contributor: Akshay Srinivasan <akshaysrinivasan at gmail.com> +pkgname=clx-git +_clname=clx +pkgver=20120421 +pkgrel=1 +pkgdesc="Xlib for common lisp systems" +arch=('i686' 'x86_64') +url="http://www.cliki.net/CLX" +license=('custom') +depends=('x-server' 'sbcl') +makedepends=('texinfo') +install=clx.install +source=(README.licensing) +md5sums=('74858379015567928f1eee186d9db1a4') + +conflicts=('clx') +provides=('clx') + +makedepends=('git') + +_gitroot="git://github.com/sharplispers/clx.git" +_gitname="clx" + + +build() { + + cat << EOM + + WARNING! + + You are building a package using a snapshot from a repository. The + resulting package may be unusable or pose a security risk, since + the install script does not check source file hashes. Do not continue + if this is undesirable. + +EOM + + install -d ${pkgdir}/usr/share/common-lisp/systems + install -d ${pkgdir}/usr/share/common-lisp/source/${_clname}/{debug,demo,test} + install -d ${pkgdir}/usr/share/licenses/${_clname} + install -d ${pkgdir}/usr/share/info + + ### Git checkout + cd "$srcdir" + msg "Connecting to GIT server...." + + if [ -d $_gitname ] ; then + cd $_gitname && git pull origin + msg "The local files are updated." + else + git clone $_gitroot $_gitname + fi + + cd ${pkgdir}/usr/share/common-lisp/source/${_clname} + + install -m 644 -t . ${srcdir}/${_gitname}/*.lisp + install -m 644 -t debug ${srcdir}/${_gitname}/debug/*.lisp + install -m 644 -t demo ${srcdir}/${_gitname}/demo/*.lisp + install -m 644 -t test ${srcdir}/${_gitname}/test/*.lisp + + install -m 644 -t . ${srcdir}/${_gitname}/${_clname}.asd + cd ${pkgdir}/usr/share/common-lisp/systems + ln -s ../source/${_clname}/${_clname}.asd . + + cd ${srcdir}/${_gitname}/manual + makeinfo ${_clname}.texinfo + install -m 644 ${_clname}.info ${pkgdir}/usr/share/info + + install -m 644 ${srcdir}/README.licensing ${pkgdir}/usr/share/licenses/${_clname} + +} diff --git a/pcr/clx-git/README.licensing b/pcr/clx-git/README.licensing new file mode 100644 index 000000000..669083222 --- /dev/null +++ b/pcr/clx-git/README.licensing @@ -0,0 +1,4 @@ +This packages uses several licenses. + +To see a given source file's license, please check its header. The +lisp files are installed in /usr/share/common-lisp/source/clx. diff --git a/pcr/clx-git/clx.install b/pcr/clx-git/clx.install new file mode 100644 index 000000000..7344518a4 --- /dev/null +++ b/pcr/clx-git/clx.install @@ -0,0 +1,76 @@ +# arg 1: the new package version + +_pkgname=clx +_compile_log=n +_lisp=() + +if pacman -Qq clisp-new-clx &>/dev/null || + pacman -Qq clisp-gtk2 &>/dev/null || + pacman -Qq clisp-new-clx &>/dev/null; then + _lisp=(${_lisp[@]} 'clisp') +fi +if pacman -Qq sbcl &>/dev/null; then + _lisp=(${_lisp[@]} 'sbcl') +fi +if pacman -Qq cmucl &> /dev/null; then + _lisp=(${_lisp[@]} 'cmucl') +fi + +_compile_sbcl() { + sbcl --noinform --no-sysinit --no-userinit \ + --eval "(require :asdf)" \ + --eval "(pushnew #p\"/usr/share/common-lisp/systems/\" asdf:*central-registry* :test #'equal)" \ + --eval "(asdf:operate 'asdf:compile-op '${_pkgname})" \ + --eval "(quit)" &> ${_compile_log_file} || return 1 +} +_compile_clisp() { + clisp --silent -norc -x \ + "(load #p\"/usr/share/common-lisp/source/asdf/asdf\") + (pushnew #p\"/usr/share/common-lisp/systems/\" asdf:*central-registry* :test #'equal) + (asdf:operate 'asdf:compile-op '${_pkgname}) + (quit)" &> ${_compile_log_file} || return 1 +} +_compile_cmucl() { + cmucl -quiet -nositeinit -noinit -eval \ + "(load #p\"/usr/share/common-lisp/source/asdf/asdf\") + (pushnew #p\"/usr/share/common-lisp/systems/\" asdf:*central-registry* :test #'equal) + (asdf:operate 'asdf:compile-op '${_pkgname}) + (quit)" &> ${_compile_log_file} || return 1 +} + +post_install() { + for _lispiter in ${_lisp[@]}; do + echo "---> Compiling lisp files using ${_lispiter} <---" + if [ $_compile_log = 'y' ]; then + _compile_log_file=/tmp/${_pkgname}_${_lispiter}.log + else + _compile_log_file=/dev/null + fi + _compile_${_lispiter} + echo "---> Done compiling lisp files (using ${_lispiter}) <---" + done + + cat << EOM + + To load this library, load asdf and then run the following lines + (or their equivalent for your lisp of choice): + + (push #p"/usr/share/common-lisp/systems/" asdf:*central-registry*) + (asdf:operate 'asdf:load-op '${_pkgname}) +EOM +} + +post_upgrade() { + post_install $1 +} + +pre_remove() { + rm -f /usr/share/common-lisp/source/$_pkgname/{*.fas,*.fasl,*.lib,*.x86f} +} + +op=$1 +shift + +$op $* + +# End of file
\ No newline at end of file |