updated on Tue Jan 17 12:00:36 UTC 2012
[aur-mirror.git] / ogre-branch-1.6 / PKGBUILD
blob914ceca25da22f06d3e3e78567e9803405a2b63f
1 # Maintainer: Sven-Hendrik Haase <sh@lutzhaase.com>
2 # Contributor: Tiago Camargo <tcamargo@gmail.com>
3 # Contributor: Josh Taylor (deficite) <joshtaylor.mail@gmail.com>
4 # Contributor: Nick B <Shirakawasuna at gmail _dot_com>
5 pkgname=ogre-branch-1.6
6 pkgver=1.6.5
7 pkgrel=3
8 pkgdesc="A scene-oriented, flexible 3D engine written in C++"
9 arch=('i686' 'x86_64')
10 url='http://www.ogre3d.org'
11 license=('LGPL')
12 depends=('boost' 'freeimage' 'freetype2' 'libxaw' 'libxrandr' 'nvidia-cg-toolkit' 'mesa' 'zziplib' 'ois' 'cegui-0.6' 'libtool')
13 conflicts=('ogre')
14 provides=('ogre=1.6.5')
15 source=("http://downloads.sourceforge.net/ogre/ogre-v${pkgver//./-}.tar.bz2")
16 md5sums=('9e863029f3befe013adefa7f66dbb13c')
18 build() {
19   # First of all, I apologize to anyone attempting to read this PKGBUILD. 
20   # I know it is ugly, horrible and hacky but please trust me when I say
21   # that this is 90% due to OGRE's horrible build system which has thankfully
22   # been replaced with CMake in Ogre 1.7.x. For now, we will have to cope
23   # with Ogre 1.6.x so please hang with me.
25   cd ${srcdir}/ogre
27   # Fix up Cg not being recognised
28   sed -i s/ac_cv_lib_Cg_cgCreateProgram=no/ac_cv_lib_Cg_cgCreateProgram=yes/g configure
29   ./configure --prefix=/usr --enable-static --with-platform=GLX --enable-openexr || return 1
30   echo "#include <cstddef>" > ./OgreMain/include/OgreOptimisedUtil.h.tmp
31   cat ./OgreMain/include/OgreOptimisedUtil.h >> ./OgreMain/include/OgreOptimisedUtil.h.tmp
32   mv ./OgreMain/include/OgreOptimisedUtil.h.tmp ./OgreMain/include/OgreOptimisedUtil.h
33   echo "#include <cstddef>" > ./Tools/XMLConverter/include/OgreXMLMeshSerializer.h.tmp
34   cat ./Tools/XMLConverter/include/OgreXMLMeshSerializer.h >> ./Tools/XMLConverter/include/OgreXMLMeshSerializer.h.tmp
35   mv ./Tools/XMLConverter/include/OgreXMLMeshSerializer.h.tmp ./Tools/XMLConverter/include/OgreXMLMeshSerializer.h
36   make || return 1 
37   make DESTDIR=${pkgdir} install || return 1
39   # Copy docs
40   install -dm755 ${pkgdir}/usr/share/doc
41   cp -r ${srcdir}/ogre/Docs ${pkgdir}/usr/share/doc/OGRE
43   # Lots of magic needed here because the stupid Makefile doesn't install the
44   # samples to the correct directory. In fact, it tries to make our life really
45   # hard by being inconsistent and generally just not nice.
46   _build_dir=`grep -m 1 -i abs_top_builddir ${srcdir}/ogre/Makefile| sed s/'abs_top_builddir = '//`
47   install -dm755 ${pkgdir}/usr/share/OGRE/
48   echo "Samples are in /opt/OGRE/Samples!" > ${pkgdir}/usr/share/OGRE/README_samples.txt
49   install -dm777 ${pkgdir}/opt/OGRE/Samples/ # This *needs* to be world writable, it is ugly, I know
50   cp -r ${_build_dir}/Samples/Common/bin ${pkgdir}/opt/OGRE/Samples/ || return 1
51   cp -r ${pkgdir}${_build_dir}/Samples/Common/bin/* ${pkgdir}/opt/OGRE/Samples/bin/Release/ || return 1
52   cd ${pkgdir}/opt/OGRE/Samples/bin/ && ls | grep -v Release | xargs rm -rf || return 1
53   sed -e s/PluginFolder.*/"PluginFolder=\/usr\/lib\/OGRE"/ -e s'/Plugin=RenderSystem_Direct3D9//' -e s'/\.dll//' -e s'/Plugin_PCZSceneManager/libPlugin_PCZSceneManager/' < ${pkgdir}/opt/OGRE/Samples/bin/Release/Plugins.cfg > ${pkgdir}/opt/OGRE/Samples/bin/Release/plugins.cfg 
54   sed s'/\.\.\///' < Release/resources.cfg > temp-ogre-resources.cfg && mv temp-ogre-resources.cfg Release/resources.cfg
55   sed s'/\.\.\///' < Release/quake3settings.cfg > temp-ogre-quake3settings.cfg && mv temp-ogre-quake3settings.cfg Release/quake3settings.cfg
56   cp -r ${srcdir}/ogre/Samples/Media ${pkgdir}/opt/OGRE/Samples/ || return 1
57   chmod -R 777 ${pkgdir}/opt/OGRE/Samples/bin
59   # Example framework stuff
60   install -Dm644 ${srcdir}/ogre/Samples/Common/include/ExampleApplication.h ${pkgdir}/usr/include/OGRE/Samples/ExampleApplication.h
61   install -Dm644 ${srcdir}/ogre/Samples/Common/include/ExampleFrameListener.h ${pkgdir}/usr/include/OGRE/Samples/ExampleFrameListener.h
62   install -Dm644 ${srcdir}/ogre/Samples/Common/include/ExampleLoadingBar.h ${pkgdir}/usr/include/OGRE/Samples/ExampleLoadingBar.h
64   # We need to clean up manually because somehow the install litters something
65   # into here
66   cd ${pkgdir} && ls | grep -v usr | grep -v opt | xargs rm -rf
69 # vim: ts=2 sw=2 et ft=sh