summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: cbe2dd7466bf7297d10654e5ea0401d77de76f1f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# Contributor: John Proctor <jproctor@prium.net>
# Contributor: Daniel White <daniel@whitehouse.id.au>
# Contributor: Juergen Hoetzel <juergen@archlinux.org>
# Contributor: Leslie Polzer (skypher)
# Maintainer: Tarn W. Burton <twburton@gmail.com>

pkgname=sbcl
epoch=2
pkgver=2.1.10
pkgrel=1
pkgdesc="Steel Bank Common Lisp"
url="http://www.sbcl.org/"
arch=('x86_64')
license=('custom')
depends=('zlib1g' 'libc6')
provides=('lisp-compiler')
makedepends=('sbcl' 'zlib1g-dev' 'texinfo')
source=("https://downloads.sourceforge.net/project/sbcl/sbcl/$pkgver/$pkgname-$pkgver-source.tar.bz2"
  "arch-fixes.lisp")
sha256sums=('8b210c5dd20a466ca438bc7f628812640d0b4acdfad20bec168a6a5dabc1cdef'
            'b88972294f831a7b2a9b6a5fd18838cd20ea7812c4336b59eb4a61c9431d782a')


build() {
  cd "$srcdir/$pkgname-$pkgver"
  export CFLAGS+=" -D_GNU_SOURCE -fno-omit-frame-pointer -DSBCL_HOME=/usr/lib/sbcl"
  export GNUMAKE="make"

  # build system uses LINKFLAGS and OS_LIBS to build LDFLAGS
  export LINKFLAGS="$LDFLAGS"
  unset LDFLAGS
  unset MAKEFLAGS
  sh make.sh sbcl --prefix=/usr --fancy
  make -C doc/manual info
}

package() {
  cd "$srcdir/$pkgname-$pkgver"

  # cannot have both SBCL_HOME and INSTALL_ROOT
  SBCL_HOME="" INSTALL_ROOT="$pkgdir/usr" sh install.sh

  src/runtime/sbcl --core output/sbcl.core --script "${srcdir}/arch-fixes.lisp"
  mv sbcl-new.core "${pkgdir}/usr/lib/sbcl/sbcl.core"

  # sources
  mkdir -p "$pkgdir/usr/share/sbcl-source"
  cp -R -t "$pkgdir/usr/share/sbcl-source" "$srcdir/$pkgname-$pkgver/"{src,contrib}

  # license
  install -D -m644 "$srcdir/$pkgname-$pkgver/COPYING" \
                   "$pkgdir/usr/share/licenses/$pkgname/license.txt"

  # drop unwanted files
  find "$pkgdir" \( -name Makefile -o -name .cvsignore \) -delete
  find "$pkgdir/usr/share/sbcl-source" -type f \
    \( -name \*.fasl -o -name \*.o -o -name \*.log -o -name \*.so -o -name a.out \) -delete

  rm "$pkgdir/usr/share/sbcl-source/src/runtime/sbcl"

}