updated on Mon Jan 23 12:00:23 UTC 2012
[aur-mirror.git] / factor / PKGBUILD
blob6f46010d6e7604749f81e719042e78339fa91bf1
1 # Maintainer: Leonidas <marek@xivilization.net>
2 pkgname=factor
3 pkgver=0.94
4 pkgrel=2
5 pkgdesc="Factor is a general purpose, dynamically typed, stack-based programming language."
6 arch=(i686 x86_64)
7 url="http://factorcode.org"
8 license=(BSD)
9 provides=(factor)
10 conflicts=(factor-git)
11 depends=(pango cairo glib2 freetype2 mesa libgl)
12 options=(!strip)
13 source=(http://downloads.factorcode.org/releases/$pkgver/$pkgname-src-$pkgver.zip
14         factor.desktop
15         factor.png
16         fuel-factor-vm.patch)
17 md5sums=('6c89c27ed3127f9b0f308f3b3dba34a2'
18          '59242ddb19a9be927915e489e2bfca27'
19          '74512251d922434c3a973f06800d6181'
20          '9d297a5b9dd60ec51d91068e82939474')
22 build() {
23     # thanks to qx from #concatenative for the proper SSE settings:
24     # i686: no SSE, x87 floating point => _sseversion=0
25     # x86_64: SSE2 => _sseversion=20
26     _bootimg="boot.unix-x86.32.image"
27     # unfortunately, factor 0.94 needs SSE2 to run, so this needs to be
28     # set (temporarily?) to SSE2
29     _sseversion=20
30     [ $CARCH = x86_64 ] && _bootimg="boot.unix-x86.64.image" && _sseversion=20
32     cd $srcdir/$pkgname
33     # apply patches
34     patch -p1 < $srcdir/fuel-factor-vm.patch
36     # build the VM
37     make || return 1
38     # bootstrap factor with the minimum supported SSE
39     ./factor -i=$_bootimg -sse-version=$_sseversion
41     mkdir -p $pkgdir/usr/bin
42     mkdir -p $pkgdir/usr/lib/factor
43     mkdir -p $pkgdir/usr/share/licenses/$pkgname/
45     # copy over the stdlib
46     cp -a misc extra core basis factor.image $pkgdir/usr/lib/factor/
47     # make folders r+x and files r
48     chmod -R 0755 $pkgdir/usr/lib/factor
49     find $pkgdir/usr/lib/factor -type f -exec chmod -x {} \;
51     # copy over the actual binary and create a symlink called factor-vm
52     # (otherwise it conflicts with factor from the GNU coreutils)
53     cp -a factor $pkgdir/usr/lib/factor/factor
54     cd $pkgdir/usr/bin
55     ln -s ../lib/factor/factor factor-vm
56     cd -
58     # copy over the license (as defined in Arch Packaging Standards)
59     chmod -x license.txt
60     cp license.txt $pkgdir/usr/share/licenses/$pkgname/COPYING
62     # add the desktop entry
63     install -D "$srcdir/factor.desktop" "$pkgdir/usr/share/applications/factor.desktop"
64     install -D "$srcdir/factor.png" "$pkgdir/usr/share/pixmaps/factor.png"