archrelease: copy trunk to extra-x86_64
[arch-packages.git] / bullet / trunk / PKGBUILD
blob85ff70600b4adb3be7980faeb268ac28cb4cf0d0
1 # Maintainer: Sven-Hendrik Haase <svenstaro@archlinux.org>
2 # Contributor: Christoph Zeiler <archNOSPAM_at_moonblade.dot.org>
4 pkgbase=bullet
5 pkgname=('bullet' 'bullet-dp' 'bullet-docs' 'python-pybullet')
6 pkgver=3.24
7 _pkgver=3.24
8 pkgrel=2
9 pkgdesc="A 3D Collision Detection and Rigid Body Dynamics Library for games and animation"
10 arch=('x86_64')
11 url="http://www.bulletphysics.com/Bullet/"
12 license=('custom:zlib')
13 makedepends=('cmake' 'doxygen' 'graphviz' 'ttf-dejavu' 'mesa' 'glu' 'python' 'python-numpy' 'python-setuptools' 'ninja')
14 source=("$pkgname-$pkgver.tar.gz::https://github.com/bulletphysics/bullet3/archive/refs/tags/${_pkgver}.tar.gz"
15         bullet3_examplebrowser.sh)
16 sha512sums=('0f8cf009e50853b2ff461414893f09f752774dac3fb51ba158ef670865b61140a13567cadbf7b19d643d24d6207a23f825773edb86234591f83bd19e3fb3d054'
17             '8741ad94b6c46c226d89aebc8ab06d8a11bac3c04d3f0a2bf7a7524792a3375aa7bf7d295410b16fbeb4c348a31057b4570acdebe9bbaea251f44daca8d9fe81')
19 prepare() {
20   cd bullet3-${_pkgver}
21   sed -i '/SET_TARGET_PROPERTIES(pybullet PROPERTIES PREFIX/d' examples/pybullet/CMakeLists.txt
24 build() {
25   cp -r bullet3-${_pkgver} bullet3-${_pkgver}-dp
27   cd bullet3-${_pkgver}
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       -DBULLET2_MULTITHREADING=ON \
40       -DCMAKE_SKIP_RPATH=YES
41   ninja -C build
43   # For Python and docs it doesn't matter whether we build multithreaded or not.
44   python setup.py build
45   doxygen
47   cd ../bullet3-${_pkgver}-dp
48   cmake \
49       -Bbuild \
50       -GNinja \
51       -DCMAKE_INSTALL_PREFIX=/usr \
52       -DBUILD_SHARED_LIBS=1 \
53       -DINSTALL_LIBS=1 \
54       -DINSTALL_EXTRA_LIBS=1 \
55       -DBUILD_PYBULLET=ON \
56       -DBUILD_PYBULLET_NUMPY=ON \
57       -DBUILD_OPENGL3_DEMOS=ON \
58       -DCMAKE_BUILD_TYPE=Release \
59       -DBULLET2_MULTITHREADING=ON \
60       -DUSE_DOUBLE_PRECISION=ON \
61       -DCMAKE_SKIP_RPATH=YES
62   ninja -C build
65 _package() {
66   DESTDIR="${pkgdir}" ninja -C build install
68   cd build
70   install -Dm755 examples/ExampleBrowser/libBulletExampleBrowserLib.so.${pkgver} "${pkgdir}"/usr/lib/libBulletExampleBrowserLib.so.${pkgver}
71   install -Dm755 examples/OpenGLWindow/libOpenGLWindow.so "${pkgdir}"/usr/lib/libOpenGLWindow.so
72   install -Dm755 examples/ThirdPartyLibs/Gwen/libgwen.so "${pkgdir}"/usr/lib/libgwen.so
73   install -Dm755 examples/ThirdPartyLibs/BussIK/libBussIK.so "${pkgdir}"/usr/lib/libBussIK.so
74   install -Dm755 "${srcdir}"/bullet3_examplebrowser.sh "${pkgdir}"/usr/bin/bullet3_examplebrowser
75   install -Dm755 examples/ExampleBrowser/App_ExampleBrowser "${pkgdir}"/opt/bullet/App_ExampleBrowser
76   cp -r data "${pkgdir}"/opt/bullet/
78   install -Dm644 ../LICENSE.txt "${pkgdir}"/usr/share/licenses/${pkgname}/LICENSE
81 package_bullet() {
82   optdepends=('glu: for the example browser'
83               'python: python bindings'
84               'python-numpy: python bindings'
85               'bullet-docs: documentation')
87   cd bullet3-${_pkgver}
89   _package
92 package_bullet-dp() {
93   pkgdesc="A 3D Collision Detection and Rigid Body Dynamics Library for games and animation (double precision)"
94   conflicts=("bullet")
95   provides=("bullet")
96   optdepends=('glu: for the example browser'
97               'python: python bindings'
98               'python-numpy: python bindings'
99               'bullet-docs: documentation')
101   cd bullet3-${_pkgver}-dp
103   _package
106 package_python-pybullet() {
107   pkgdesc="Bullet Python bindings"
108   depends+=('bullet' 'gcc-libs')
110   cd bullet3-${_pkgver}
112   install -Dm755 build/examples/pybullet/libpybullet.so.${pkgver} "${pkgdir}"/usr/lib/libpybullet.so.${pkgver}
113   python setup.py install --prefix=/usr --root="${pkgdir}" --optimize=1 --skip-build
115   install -Dm644 LICENSE.txt "${pkgdir}"/usr/share/licenses/${pkgname}/LICENSE
118 package_bullet-docs() {
119   pkgdesc="Documentation for bullet"
121   cd bullet3-${_pkgver}
123   # install docs
124   install -Dm644 docs/GPU_rigidbody_using_OpenCL.pdf "${pkgdir}"/usr/share/doc/bullet/GPU_rigidbody_using_OpenCL.pdf
125   install -Dm644 docs/Bullet_User_Manual.pdf "${pkgdir}"/usr/share/doc/bullet/Bullet_User_Manual.pdf
126   install -Dm644 docs/BulletQuickstart.pdf "${pkgdir}"/usr/share/doc/bullet/BulletQuickstart.pdf
127   cp -r html "${pkgdir}"/usr/share/doc/bullet/html
129 # vim: sw=2 ts=2 et: