1 # Contributor: scj <scj archlinux us>
5 pkgdesc="A tiny, fast and cross-platform Forth interpreter/compiler"
7 url="http://ronware.org/reva/"
8 license=('Public Domain')
9 if [[ $CARCH == "i686" ]]; then
11 makedepends=('nasm' 'gcc')
13 depends=('lib32-sqlite3')
14 makedepends=('nasm' 'gcc-multilib' 'gcc-libs-multilib' 'binutils-multilib' 'libtool-multilib')
18 source=(http://ronware.org/${pkgname}${pkgver//./}.zip)
19 md5sums=('ed3cac1624d3a78745b6b444a8c652f9')
23 mkdir -p $pkgdir/usr/{lib/reva,share/reva}
26 find lib examples contrib -type f -exec chmod 644 '{}' \;
29 sed -i -e 's|func: libiconv|func: iconv|' -e 's|libiconv.so|libc.so|' lib/string/iconv || return 1
30 sed -i -e 's|\(libncurses.so\)"|\1.5"|' lib/os/console || return 1
32 # first stage of compilation (to build the help.db correctly)
35 make bootstrap || return 1
36 bin/lin/reva tools/build.f || return 1
37 bin/lin/build help || return 1
38 install -Dm644 bin/help.db $pkgdir/usr/share/doc/reva/help.db || return 1
42 mv bin/lin/{core,reva,build} backup || return 1
44 # second stage of compilation (to make {lib,help}dir point to the right place)
45 sed -i -e '/: libdir/,/;/c: libdir " /usr/lib/reva/" \n;' \
46 -e '/: helpdir/c: helpdir " /usr/share/doc/reva/" ;' src/reva.f || return 1
48 REVAUSERLIB=$PWD/lib/ make bootstrap || return 1
49 REVAUSERLIB=$PWD/lib/ bin/lin/reva tools/build.f || return 1
51 install -Dm755 bin/lin/reva $pkgdir/usr/bin/reva || return 1
52 install -Dm755 bin/lin/librevagui.so $pkgdir/usr/lib || return 1
54 # move the helper db to /usr/share/doc/reva/help.db
55 sed -i -e '/" help.db"/s|\(.*\)|\t" /usr/share/doc/reva/help.db"|' \
56 -e '/to helpdb/s|.*\(sql_open to helpdb\).*|\t\1|' lib/helper || return 1
57 cp -r lib/* $pkgdir/usr/lib/reva || return 1
58 cp -r contrib examples $pkgdir/usr/share/reva || return 1
60 mv backup/* bin || return 1
61 rmdir backup || return 1
65 # vim:set ts=2 sw=2 et: