1 # Maintainer: Omar Botta <omarbotta@gnulinuxlibre.net>
2 # Contributor: Sven-Hendrik Haase <sh@lutzhaase.com>
3 # Contributor: Tiago Camargo <tcamargo@gmail.com>
4 # Contributor: Josh Taylor (deficite) <joshtaylor.mail@gmail.com>
5 # Contributor: Nick B <Shirakawasuna at gmail _dot_com>
6 pkgname=ogre-branch-1.6-free
9 pkgdesc="A scene-oriented, flexible 3D engine written in C++, nVidia CG Toolkit is not needed"
10 arch=('i686' 'x86_64')
11 url='http://www.ogre3d.org'
13 depends=('boost' 'freeimage' 'freetype2' 'libxaw' 'libxrandr' 'mesa' 'zziplib' 'ois' 'cegui')
14 conflicts=('ogre' 'ogre-branch-1.6')
15 provides=('ogre=1.6.5')
16 source=("http://downloads.sourceforge.net/ogre/ogre-v${pkgver//./-}.tar.bz2")
17 md5sums=('9e863029f3befe013adefa7f66dbb13c')
20 # First of all, I apologize to anyone attempting to read this PKGBUILD.
21 # I know it is ugly, horrible and hacky but please trust me when I say
22 # that this is 90% due to OGRE's horrible build system which has thankfully
23 # been replaced with CMake in Ogre 1.7.x. For now, we will have to cope
24 # with Ogre 1.6.x so please hang with me.
27 ./configure --prefix=/usr --enable-static --with-platform=GLX --enable-openexr --disable-cg || return 1
29 # This stuff is probably not needed anymore for compiling on x86_64.
30 # If you run into trouble, uncomment it and make the package again.
31 # [ "$CARCH" = "x86_64" ] && \
32 # sed -i s,"CFLAGS = -march","CFLAGS = -fpic -fvisibility=default -march",g Makefile && \
33 # sed -i s,"CXXFLAGS = ","CXXLAGS = -fpic -fivisibility=default ",g Makefile
35 make || return 1 # OGRE has a lot of source files. Make sure your makepkg.conf has the appropiate "-jN" option for your CPU type (-j3 for dualcore, -j5 for quadcore).
36 make DESTDIR=${pkgdir} install || return 1
39 install -dm755 ${pkgdir}/usr/share/doc
40 cp -r ${srcdir}/ogre/Docs ${pkgdir}/usr/share/doc/OGRE
42 # Lots of magic needed here because the stupid Makefile doesn't install the
43 # samples to the correct directory. In fact, it tries to make our life really
44 # hard by being inconsistent and generally just not nice.
45 _build_dir=`grep -m 1 -i abs_top_builddir ${srcdir}/ogre/Makefile| sed s/'abs_top_builddir = '//`
46 install -dm755 ${pkgdir}/usr/share/OGRE/
47 echo "Samples are in /opt/OGRE/Samples!" > ${pkgdir}/usr/share/OGRE/README_samples.txt
48 install -dm777 ${pkgdir}/opt/OGRE/Samples/ # This *needs* to be world writable, it is ugly, I know
49 cp -r ${_build_dir}/Samples/Common/bin ${pkgdir}/opt/OGRE/Samples/ || return 1
50 cp -r ${pkgdir}${_build_dir}/Samples/Common/bin/* ${pkgdir}/opt/OGRE/Samples/bin/Release/ || return 1
51 cd ${pkgdir}/opt/OGRE/Samples/bin/ && ls | grep -v Release | xargs rm -rf || return 1
52 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
53 sed s'/\.\.\///' < Release/resources.cfg > temp-ogre-resources.cfg && mv temp-ogre-resources.cfg Release/resources.cfg
54 sed s'/\.\.\///' < Release/quake3settings.cfg > temp-ogre-quake3settings.cfg && mv temp-ogre-quake3settings.cfg Release/quake3settings.cfg
55 cp -r ${srcdir}/ogre/Samples/Media ${pkgdir}/opt/OGRE/Samples/ || return 1
56 chmod -R 777 ${pkgdir}/opt/OGRE/Samples/bin
58 # Example framework stuff
59 install -Dm644 ${srcdir}/ogre/Samples/Common/include/ExampleApplication.h ${pkgdir}/usr/include/OGRE/Samples/ExampleApplication.h
60 install -Dm644 ${srcdir}/ogre/Samples/Common/include/ExampleFrameListener.h ${pkgdir}/usr/include/OGRE/Samples/ExampleFrameListener.h
61 install -Dm644 ${srcdir}/ogre/Samples/Common/include/ExampleLoadingBar.h ${pkgdir}/usr/include/OGRE/Samples/ExampleLoadingBar.h
63 # We need to clean up manually because somehow the install litters something
65 cd ${pkgdir} && ls | grep -v usr | grep -v opt | xargs rm -rf
68 # vim: ts=2 sw=2 et ft=sh