archrelease: copy trunk to extra-x86_64
[arch-packages.git] / bullet / repos / extra-x86_64 / PKGBUILD
blob266a3012e70b4a06c4185ffe0adc1c550d62d45a
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.25
7 _pkgver=3.25
8 pkgrel=3
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=('7086e5fcf69635801bb311261173cb8d173b712ca1bd78be03df48fad884674e85512861190e45a1a62d5627aaad65cde08c175c44a3be9afa410d3dfd5358d4'
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   export CXXFLAGS+=" -ffat-lto-objects"
28   cd bullet3-${_pkgver}
29   cmake \
30       -Bbuild \
31       -GNinja \
32       -DCMAKE_INSTALL_PREFIX=/usr \
33       -DBUILD_SHARED_LIBS=1 \
34       -DINSTALL_LIBS=1 \
35       -DINSTALL_EXTRA_LIBS=1 \
36       -DBUILD_PYBULLET=ON \
37       -DBUILD_PYBULLET_NUMPY=ON \
38       -DBUILD_OPENGL3_DEMOS=ON \
39       -DCMAKE_BUILD_TYPE=Release \
40       -DBULLET2_MULTITHREADING=ON \
41       -DCMAKE_SKIP_RPATH=YES
42   ninja -C build
44   # For Python and docs it doesn't matter whether we build multithreaded or not.
45   python setup.py build
46   doxygen
48   cd ../bullet3-${_pkgver}-dp
49   cmake \
50       -Bbuild \
51       -GNinja \
52       -DCMAKE_INSTALL_PREFIX=/usr \
53       -DBUILD_SHARED_LIBS=1 \
54       -DINSTALL_LIBS=1 \
55       -DINSTALL_EXTRA_LIBS=1 \
56       -DBUILD_PYBULLET=ON \
57       -DBUILD_PYBULLET_NUMPY=ON \
58       -DBUILD_OPENGL3_DEMOS=ON \
59       -DCMAKE_BUILD_TYPE=Release \
60       -DBULLET2_MULTITHREADING=ON \
61       -DUSE_DOUBLE_PRECISION=ON \
62       -DCMAKE_SKIP_RPATH=YES
63   ninja -C build
66 _package() {
67   DESTDIR="${pkgdir}" ninja -C build install
69   cd build
71   install -Dm755 examples/ExampleBrowser/libBulletExampleBrowserLib.so.${pkgver} "${pkgdir}"/usr/lib/libBulletExampleBrowserLib.so.${pkgver}
72   install -Dm755 examples/OpenGLWindow/libOpenGLWindow.so "${pkgdir}"/usr/lib/libOpenGLWindow.so
73   install -Dm755 examples/ThirdPartyLibs/Gwen/libgwen.so "${pkgdir}"/usr/lib/libgwen.so
74   install -Dm755 examples/ThirdPartyLibs/BussIK/libBussIK.so "${pkgdir}"/usr/lib/libBussIK.so
75   install -Dm755 "${srcdir}"/bullet3_examplebrowser.sh "${pkgdir}"/usr/bin/bullet3_examplebrowser
76   install -Dm755 examples/ExampleBrowser/App_ExampleBrowser "${pkgdir}"/opt/bullet/App_ExampleBrowser
77   cp -r data "${pkgdir}"/opt/bullet/
79   install -Dm644 ../LICENSE.txt "${pkgdir}"/usr/share/licenses/${pkgname}/LICENSE
82 package_bullet() {
83   optdepends=('glu: for the example browser'
84               'python: python bindings'
85               'python-numpy: python bindings'
86               'bullet-docs: documentation')
88   cd bullet3-${_pkgver}
90   _package
93 package_bullet-dp() {
94   pkgdesc="A 3D Collision Detection and Rigid Body Dynamics Library for games and animation (double precision)"
95   conflicts=("bullet")
96   provides=("bullet")
97   optdepends=('glu: for the example browser'
98               'python: python bindings'
99               'python-numpy: python bindings'
100               'bullet-docs: documentation')
102   cd bullet3-${_pkgver}-dp
104   _package
107 package_python-pybullet() {
108   pkgdesc="Bullet Python bindings"
109   depends+=('bullet' 'gcc-libs')
111   cd bullet3-${_pkgver}
113   install -Dm755 build/examples/pybullet/libpybullet.so.${pkgver} "${pkgdir}"/usr/lib/libpybullet.so.${pkgver}
114   python setup.py install --prefix=/usr --root="${pkgdir}" --optimize=1 --skip-build
116   install -Dm644 LICENSE.txt "${pkgdir}"/usr/share/licenses/${pkgname}/LICENSE
119 package_bullet-docs() {
120   pkgdesc="Documentation for bullet"
122   cd bullet3-${_pkgver}
124   # install docs
125   install -Dm644 docs/GPU_rigidbody_using_OpenCL.pdf "${pkgdir}"/usr/share/doc/bullet/GPU_rigidbody_using_OpenCL.pdf
126   install -Dm644 docs/Bullet_User_Manual.pdf "${pkgdir}"/usr/share/doc/bullet/Bullet_User_Manual.pdf
127   install -Dm644 docs/BulletQuickstart.pdf "${pkgdir}"/usr/share/doc/bullet/BulletQuickstart.pdf
128   cp -r html "${pkgdir}"/usr/share/doc/bullet/html
130 # vim: sw=2 ts=2 et: