desktop/irrlicht/PKGBUILD
2010-12-24 00:20:06 +00:00

88 lines
2.5 KiB
Bash

#
# Games Packages for Chakra, part of chakra-project.org
#
# Maintainer: Adrián Chaves Fernández (Gallaecio) <adriyetichaves gmail.com>
# include global config
source ../_buildscripts/${current_repo}-${_arch}-cfg.conf
pkgname=irrlicht
pkgver=1.7.2
pkgrel=1
pkgdesc="High performance realtime 3D graphics engine."
arch=('i686' 'x86_64')
url="http://irrlicht.sourceforge.net/"
license=('ZLIB')
depends=('libgl' 'libjpeg' 'bzip2')
changelog=ChangeLog
source=("http://downloads.sourceforge.net/$pkgname/$pkgname-$pkgver.zip")
md5sums=('eb627d4c432bf73f12bc6d9ddc700b07')
build() {
cd $srcdir/$pkgname-$pkgver
sed -i -e '/^#.*NON_SYSTEM_ZLIB/d' \
-e '/^#.*NON_SYSTEM_JPEG/d' \
-e '/^#.*NON_SYSTEM_BZLIB/d' \
include/IrrCompileConfig.h || return 1
cd source/Irrlicht
sed -i -e '/^CXXFLAGS/s:-g.*::' \
-e '/^CXXFLAGS/s:-Wall::' \
-e '/^CFLAGS/s/:= -O3 -fexpensive-optimizations/+=/' \
-e '/^CXXINCS/s:-Izlib -Ijpeglib::' \
-e '/^ZLIBOBJ/d' \
-e '/^JPEGLIBOBJ/d' \
-e '/^BZIP2OBJ/d' \
-e '/.o=.d/d' \
-e '/^sharedlib: LDFLAGS/s:+=:+= -lGL -lXxf86vm -ljpeg -lbz2 -lz:' \
-e "/^INSTALL_DIR/s:=.*:=$pkgdir/usr/lib:" \
-e 's/0-SVN/1/' \
-e 's/.$(VERSION_MINOR) -o/ -o/' \
Makefile || return 1
make sharedlib || return 1
make
}
package() {
cd $srcdir/$pkgname-$pkgver/source/Irrlicht
install -d $pkgdir/usr/lib \
$pkgdir/usr/share/licenses/$pkgname \
$pkgdir/usr/share/$pkgname/examples/bin \
$pkgdir/usr/share/doc/$pkgname
make install || return 1
cd $srcdir/$pkgname-$pkgver/
install -m644 readme.txt $pkgdir/usr/share/licenses/$pkgname
# Install static library and fix headers permissions
install -m644 lib/Linux/libIrrlicht.a $pkgdir/usr/lib
chmod 644 $pkgdir/usr/include/$pkgname/*
# Install media files for examples
cp -r media $pkgdir/usr/share/$pkgname
# Install documentation
cp -r doc/* $pkgdir/usr/share/doc/$pkgname
rm -f $pkgdir/usr/share/doc/$pkgname/*.txt
cd $pkgdir/usr/lib
ln -s libIrrlicht.so.$pkgver libIrrlicht.so.1
# Just a helper for examples compilation
ln -s libIrrlicht.so.$pkgver $srcdir/$pkgname-$pkgver/lib/Linux/libIrrlicht.so
# Edit, build and install the examples
cd $srcdir/$pkgname-$pkgver/examples
sed -i '/define USE_IRRKLANG/s:.*://&:' ./Demo/CDemo.h || return 1
sed -i '/^CXXFLAGS/d' $(grep -Rl "^CXXFLAGS =" *)
make
install -m755 ../bin/Linux/* /$pkgdir/usr/share/$pkgname/examples/bin/
}