summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 8f1ed2be5efbbe6ebfc9523083fa5de7adfc950c (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
63
# Maintainer: Stefan Husmann <stefan-husmann@t-online.de>
# Contributor: Rogof <rogof /at/ gmx /dot/ com>

pkgname=ccl-svn
pkgver=1.12.r16812
pkgrel=1
pkgdesc="The Clozure Common Lisp implementation"
url="http://ccl.clozure.com/"
license=('LGPL')
arch=('i686' 'x86_64')
depends=('bash')
optdepends=('java-environment: for using emaple file jfli.jar')
makedepends=('svn')
provides=('common-lisp' 'cl-asdf' 'ccl')
conflicts=('ccl-bin')
source=("svn+http://svn.clozure.com/publicsvn/openmcl/trunk/linuxx86/ccl")
sha1sums=('SKIP')

_arch=''
[ "${CARCH}" = 'x86_64' ] && _arch=64

pkgver() {
  cd "$SRCDEST"/ccl
  # get version from version.lisp file & the svn revision
  local ver_prog="(format t \"~a.~a_r~a\" ccl::*openmcl-major-version* ccl::*openmcl-minor-version* $(svnversion))"
  # use head to remove trailing NIL
  echo -n $ver_prog | ./lx86cl$_arch -n -Q -b -l level-1/version.lisp |head -1|tr _ .
}

build() {
  cd "$srcdir"/ccl
  echo '(ccl:rebuild-ccl :full t)' | ./lx86cl$_arch -n -Q -b
}

package() {
  cd "$srcdir"/ccl
  
  # install data
 install -d "$pkgdir/usr/lib/$pkgname"
  cp -a {compiler,contrib,level-*,lib*,lisp-kernel,objc-bridge,tools,x86-headers$_arch,xdump,lx86cl$_arch*} \
     "$pkgdir/usr/lib/$pkgname"
  
  # install examples
  install -d "$pkgdir/usr/share/$pkgname"
  cp -a examples "$pkgdir/usr/share/$pkgname"
  
  # install documentation
  install -d "$pkgdir/usr/share/doc/$pkgname"
  cp -a doc/* "$pkgdir/usr/share/doc/$pkgname"
  
  # remove unwanted files
  find "$pkgdir/usr/" -type d -name .svn -exec rm -rf '{}' +
  find "$pkgdir/usr/lib/$pkgname" -name '*.o' -exec rm -f '{}' +
  find "$pkgdir/usr/lib/$pkgname" -name '*.*fsl' -exec rm -f '{}' +

  # install frontend script
  mkdir -p "$pkgdir/usr/bin"
  cat > "$pkgdir/usr/bin/ccl" <<EOF
#!/bin/sh
exec /usr/lib/$pkgname/lx86cl$_arch "\$@"
EOF
  chmod +x "$pkgdir/usr/bin/ccl"
}