archrelease: copy trunk to extra-x86_64
[arch-packages.git] / bullet / trunk / PKGBUILD
blobf584eccc51e5b025f310b6b55ade6688f30c6ce6
1 # Maintainer: Sven-Hendrik Haase <svenstaro@archlinux.org>
2 # Contributor: Christoph Zeiler <archNOSPAM_at_moonblade.dot.org>
4 pkgbase=bullet
5 pkgname=('bullet' 'bullet-docs' 'python-pybullet')
6 pkgver=3.21
7 # Upstream botched the tag so we're using the actual real commit for this release.
8 _commit=6a59241074720e9df119f2f86bc01765917feb1e
9 pkgrel=2
10 pkgdesc="A 3D Collision Detection and Rigid Body Dynamics Library for games and animation"
11 arch=('x86_64')
12 url="http://www.bulletphysics.com/Bullet/"
13 license=('custom:zlib')
14 makedepends=('cmake' 'doxygen' 'graphviz' 'ttf-dejavu' 'mesa' 'glu' 'python' 'python-numpy' 'python-setuptools' 'ninja')
15 source=("$pkgname-$pkgver.tar.gz::https://github.com/bulletphysics/bullet3/archive/${_commit}.tar.gz"
16         bullet3_examplebrowser.sh)
17 sha512sums=('f262c1c517f17f641d0a991611ca8a0776e34165af438a8a8d2d62a960e6ce3885198718ed7d1f4e9c4c42a497a3b1d7143c526010fd202bcc9efda19fa0e33b'
18             '8741ad94b6c46c226d89aebc8ab06d8a11bac3c04d3f0a2bf7a7524792a3375aa7bf7d295410b16fbeb4c348a31057b4570acdebe9bbaea251f44daca8d9fe81')
20 prepare() {
21   cd bullet3-${_commit}
22   sed -i '/SET_TARGET_PROPERTIES(pybullet PROPERTIES PREFIX/d' examples/pybullet/CMakeLists.txt
25 build() {
26   cd bullet3-${_commit}
28   cmake \
29       -Bbuild \
30       -GNinja \
31       -DCMAKE_INSTALL_PREFIX=/usr \
32       -DBUILD_SHARED_LIBS=1 \
33       -DINSTALL_LIBS=1 \
34       -DINSTALL_EXTRA_LIBS=1 \
35       -DBUILD_PYBULLET=ON \
36       -DBUILD_PYBULLET_NUMPY=ON \
37       -DBUILD_OPENGL3_DEMOS=ON \
38       -DCMAKE_BUILD_TYPE=Release \
39       -DCMAKE_SKIP_RPATH=YES
41   ninja -C build
43   python setup.py build
44   doxygen
47 package_bullet() {
48   optdepends=('glu: for the example browser'
49               'python: python bindings'
50               'python-numpy: python bindings'
51               'bullet-docs: documentation')
53   cd bullet3-${_commit}
55   DESTDIR="${pkgdir}" ninja -C build install
57   cd build
59   install -Dm755 examples/ExampleBrowser/libBulletExampleBrowserLib.so.${pkgver} "${pkgdir}"/usr/lib/libBulletExampleBrowserLib.so.${pkgver}
60   install -Dm755 examples/OpenGLWindow/libOpenGLWindow.so "${pkgdir}"/usr/lib/libOpenGLWindow.so
61   install -Dm755 examples/ThirdPartyLibs/Gwen/libgwen.so "${pkgdir}"/usr/lib/libgwen.so
62   install -Dm755 examples/ThirdPartyLibs/BussIK/libBussIK.so "${pkgdir}"/usr/lib/libBussIK.so
63   install -Dm755 "${srcdir}"/bullet3_examplebrowser.sh "${pkgdir}"/usr/bin/bullet3_examplebrowser
64   install -Dm755 examples/ExampleBrowser/App_ExampleBrowser "${pkgdir}"/opt/bullet/App_ExampleBrowser
65   cp -r data "${pkgdir}"/opt/bullet/
67   install -Dm644 ../LICENSE.txt "${pkgdir}"/usr/share/licenses/${pkgbase}/LICENSE
70 package_python-pybullet() {
71   pkgdesc="Bullet Python bindings"
72   depends+=('bullet' 'gcc-libs')
74   cd bullet3-${_commit}
76   install -Dm755 build/examples/pybullet/libpybullet.so.${pkgver} "${pkgdir}"/usr/lib/libpybullet.so.${pkgver}
77   python setup.py install --prefix=/usr --root="${pkgdir}" --optimize=1 --skip-build
79   install -Dm644 LICENSE.txt "${pkgdir}"/usr/share/licenses/${pkgname}/LICENSE
82 package_bullet-docs() {
83   pkgdesc="Documentation for bullet"
85   cd bullet3-${_commit}
87   # install docs
88   install -Dm644 docs/GPU_rigidbody_using_OpenCL.pdf "${pkgdir}"/usr/share/doc/bullet/GPU_rigidbody_using_OpenCL.pdf
89   install -Dm644 docs/Bullet_User_Manual.pdf "${pkgdir}"/usr/share/doc/bullet/Bullet_User_Manual.pdf
90   install -Dm644 docs/BulletQuickstart.pdf "${pkgdir}"/usr/share/doc/bullet/BulletQuickstart.pdf
91   cp -r html "${pkgdir}"/usr/share/doc/bullet/html
93 # vim: sw=2 ts=2 et: