PKGBUILDs/community/tachyon/PKGBUILD
2022-03-06 21:44:51 +00:00

60 lines
1.9 KiB
Bash

# Maintainer: Antonio Rojas <arojas@archlinux.org>
# Contributor: Rémy Oudompheng <remy@archlinux.org>
# ALARM: Kevin Mihelich <kevin@archlinuxarm.org>
# - set ARM architectures to use linux-thr profile, AArch64 to linux-64-thr
# - sed to remove -m32 and -m64 from CFLAGS
pkgname=tachyon
pkgver=0.99.2
pkgrel=1
pkgdesc="Multithreaded ray tracing software"
arch=(x86_64)
url="http://jedi.ks.uiuc.edu/~johns/raytracer/"
license=(BSD)
depends=(libjpeg-turbo libpng)
makedepends=()
source=("http://jedi.ks.uiuc.edu/~johns/raytracer/files/$pkgver/$pkgname-$pkgver.tar.gz"
enable-jpeg-png.patch
tachyon-system-cflags.patch)
sha256sums=('d40a5752fe78b84c5ca913bf55e5707c310526f9eebd8269d1583359d8415798'
'fba8ac0aaa9dd6fe8b4737f5ae95d7795751e15d88bff3ec09ed665673d126b9'
'84108222d5daa60285111b69e9ee086aad3818f2fa8d706b4bd9811656682f2c')
case "$CARCH" in
arm*) _target=linux-thr ;;
"aarch64") _target=linux-64-thr ;;
"i686") _target=linux-thr ;;
"x86_64") _target=linux-64-thr ;;
esac
prepare(){
cd $pkgname
# enable JPEG and PNG support
patch -p0 -i ../enable-jpeg-png.patch
# use system build flags
patch -p1 -i ../tachyon-system-cflags.patch
sed -e 's|${CC} ${CFLAGS}|${CC} ${CFLAGS} ${LDFLAGS}|g' -i unix/Makefile
# remove -m32 and -m64 for ARM
sed -i 's/-m32//g' unix/Make-arch
sed -i 's/-m64//g' unix/Make-arch
}
build() {
cd $pkgname/unix
make $_target CC="gcc ${CFLAGS} ${LDFLAGS}"
}
package() {
cd $pkgname/compile/$_target
install -D -m 755 tachyon "$pkgdir"/usr/bin/tachyon
install -D -m 644 libtachyon.a "$pkgdir"/usr/lib/libtachyon.a
cd "$srcdir"/$pkgname/scenes
install -d "$pkgdir"/usr/share/tachyon/scenes/imaps
install -m 644 README *.dat *.cam *.ac "$pkgdir"/usr/share/tachyon/scenes
install -d "$pkgdir"/usr/share/licenses/tachyon
install "$srcdir"/$pkgname/Copyright "$pkgdir"/usr/share/licenses/tachyon
}