diff options
author | Peter Mukhachev | 2015-07-19 03:36:14 +0300 |
---|---|---|
committer | Peter Mukhachev | 2015-07-19 03:36:14 +0300 |
commit | a3ab8b47871d532920ae21bfd9a03324158e8ef9 (patch) | |
tree | 8f21686394b31122dde0f3830a01d306042317d2 | |
download | aur-a3ab8b47871d532920ae21bfd9a03324158e8ef9.tar.gz |
Initial commit
-rw-r--r-- | .SRCINFO | 16 | ||||
-rw-r--r-- | PKGBUILD | 72 | ||||
-rw-r--r-- | cl-alexandria.install | 76 |
3 files changed, 164 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..89cf4fcb244a --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,16 @@ +pkgbase = cl-alexandria-git + pkgdesc = Common Lisp portability library + pkgver = r194.b1c6ee0 + pkgrel = 1 + url = http://common-lisp.net/project/alexandria/ + install = cl-alexandria.install + arch = i686 + arch = x86_64 + license = custom + depends = common-lisp + provides = cl-alexandria + conflicts = cl-alexandria-darcs + options = docs + +pkgname = cl-alexandria-git + diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..f078b215de59 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,72 @@ +# Maintainer: mrshpot <mrshpot at gmail dot com> +#Contributor: Peter Mukhachev <rolling[dot]robot [shift-two] gmail [dot] com> + +# 'alexandria' is taken by another app +pkgname=cl-alexandria-git +pkgver=r194.b1c6ee0 +pkgrel=1 +pkgdesc="Common Lisp portability library" +arch=('i686' 'x86_64') +url="http://common-lisp.net/project/alexandria/" +license=('custom') # Public Domain +provides=('cl-alexandria') +conflicts=('cl-alexandria-darcs') +depends=('common-lisp') +install=cl-alexandria.install +source=() +md5sums=() +options=(docs) + +_clname=alexandria + +_gitroot="https://github.com/keithj/alexandria.git" +_gitname="alexandria" + +pkgver() { + cd $srcdir/${_gitname} + printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)" + } + +build() { + 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 + + msg "GIT checkout done or server timeout" + msg "Starting build..." + +} +package() { + + cat << EOM + + WARNING! + + You are about to build a pre-release 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/source/${_clname} + install -d ${pkgdir}/usr/share/common-lisp/systems + install -d ${pkgdir}/usr/share/licenses/${_clname} + + install -m 644 -t ${pkgdir}/usr/share/common-lisp/source/${_clname} \ + ${srcdir}/${_clname}/*.lisp + install -m 644 -t ${pkgdir}/usr/share/common-lisp/source/${_clname} \ + ${srcdir}/${_clname}/*.asd + install -m 644 -t ${pkgdir}/usr/share/licenses/${_clname} \ + ${srcdir}/${_clname}/LICENCE + + cd ${pkgdir}/usr/share/common-lisp/systems + ln -s ../source/${_clname}/alexandria.asd . + ln -s ../source/${_clname}/alexandria-tests.asd . +} diff --git a/cl-alexandria.install b/cl-alexandria.install new file mode 100644 index 000000000000..6e4abb69e54b --- /dev/null +++ b/cl-alexandria.install @@ -0,0 +1,76 @@ +# arg 1: the new package version + +_pkgname=alexandria +_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/$_pkgname/{*.fas,*.fasl,*.lib,*.x86f} +} + +op=$1 +shift + +$op $* + +# End of file |