core/sbcl/PKGBUILD
2010-09-27 18:12:29 +00:00

76 lines
2.3 KiB
Bash

#
# Platform Packages for Chakra, part of chakra-project.org
#
# maintainer (i686): Phil Miller <philm[at]chakra-project[dog]org>
# maintainer (x86_64): Manuel Tortosa <manutortosa[at]chakra-project[dot]org>
# include global config
source ../_buildscripts/${current_repo}-${_arch}-cfg.conf
pkgname=sbcl
pkgver=1.0.42
pkgrel=1
pkgdesc="Steel Bank Common Lisp"
arch=('i686' 'x86_64')
license=('custom')
depends=('glibc')
provides=('common-lisp' 'cl-asdf')
makedepends=('sbcl' 'texinfo')
source=("http://downloads.sourceforge.net/project/sbcl/sbcl/$pkgver/$pkgname-$pkgver-source.tar.bz2" "chakra-fixes.lisp")
md5sums=('09cc54b3afc84fe2ce1d5c2af98ea2a2' '7ac0c1936547f4278198b8bf7725204d')
url="http://www.sbcl.org/"
install=sbcl.install
build() {
export CFLAGS="${CFLAGS} -DSBCL_HOME=\\\"/usr/lib/sbcl\\\""
export GNUMAKE="make -e"
# build system uses LINKFLAGS and OS_LIBS to build LDFLAGS
export LINKFLAGS="$LD_FLAGS"
unset LDFLAGS
cd ${startdir}/src/${pkgname}-${pkgver}
# Make a multi-threaded SBCL, disable LARGEFILE
cat >customize-target-features.lisp <<EOF
(lambda (features)
(flet ((enable (x) (pushnew x features))
(disable (x) (setf features (remove x features))))
(enable :sb-thread)
(disable :largefile)))
EOF
sh make.sh sbcl
mkdir -p ${startdir}/pkg/usr
pushd doc/manual
make info || return 1
popd
INSTALL_ROOT=${startdir}/pkg/usr sh install.sh
src/runtime/sbcl --core output/sbcl.core --script ${startdir}/src/chakra-fixes.lisp
mv sbcl-new.core ${startdir}/pkg/usr/lib/sbcl/sbcl.core
# sources
mkdir -p ${startdir}/pkg/usr/share/sbcl-source
cp -R -t ${startdir}/pkg/usr/share/sbcl-source \
${startdir}/src/${pkgname}-${pkgver}/{src,contrib}
# drop unwanted files
find ${startdir}/pkg/usr/share/sbcl-source -type f \
-name \*.fasl -or \
-name \*.o -or \
-name \*.log -or \
-name \*.so -or \
-name a.out -delete
rm ${startdir}/pkg/usr/share/sbcl-source/src/runtime/sbcl
rm ${startdir}/pkg/usr/share/sbcl-source/src/runtime/sbcl.nm
find ${startdir}/pkg \( -name Makefile -o -name .cvsignore \) -delete
rm $startdir/pkg/usr/share/info/dir
gzip -9nf $startdir/pkg/usr/share/info/*
# license
install -D -m644 ${startdir}/src/${pkgname}-${pkgver}/COPYING \
${startdir}/pkg/usr/share/licenses/${pkgname}/license.txt
}