updated on Wed Jan 11 12:00:27 UTC 2012
[aur-mirror.git] / libflann / PKGBUILD
blob562fffee6172c870b07fd1c1bde0e5db5790ef4f
1 # Maintainer: hauptmech # Contributor: figo.zhang, chubtuff, lubosz
3 # Matlab bindings are not built by default to reduce dependencies.
5 pkgname=libflann
6 pkgver=1.7.1
7 pkgrel=2
8 pkgdesc="FLANN is a library for performing fast approximate nearest neighbor searches in high dimensional spaces"
9 arch=('any')
10 url='http://www.cs.ubc.ca/~mariusm/index.php/FLANN/FLANN'
11 license=('BSD')
12 makedepends=('cmake' 'python2')
13 optdepends=('hdf5' 'gtest' 'intel-tbb' 'cuda')
14 conflicts=('flann')
15 source=("https://people.cs.ubc.ca/~mariusm/uploads/FLANN/flann-${pkgver}-src.zip")
16 _python2libpath="`python2 -c "from distutils.sysconfig import get_python_lib; print get_python_lib()" | tr -d '\n'`"
18 build() {
19   cd "${srcdir}/flann-${pkgver}-src"
21   sed -i 's/lib64/lib/g' cmake/flann_utils.cmake
23   mkdir build
24   cd build
26   cmake .. \
27     -DCMAKE_BUILD_TYPE=Release \
28     -DCMAKE_INSTALL_PREFIX=/usr \
29     -DBUILD_MATLAB_BINDINGS=OFF \
30     -DBUILD_PYTHON_BINDINGS=ON \
31     -DPYTHON_EXECUTABLE=/usr/bin/python2
32   make
34   sed -i 's|#!/usr/bin/env python|#!/usr/bin/python2|' \
35   ../bin/download_checkmd5.py \
36   ../bin/run_test.py \
37   ../build/src/python/setup.py \
38   ../src/python/setup.py \
39   ../src/python/setup.py.tpl \
40   ../test/test_clustering.py \
41   ../test/test_index_save.py \
42   ../test/test_nn_autotune.py \
43   ../test/test_nn_index.py \
44   ../test/test_nn.py
46   sed -i 's|#!/usr/bin/python|#!/usr/bin/python2|' \
47   ../test/memusage_clustering.py \
48   ../test/memusage_nn.py
51 #check() {
52 #  cd "${srcdir}/flann-${pkgver}-src/build"
53 #  # Warning: Downloads big data files.
54 #  make -k test
57 package() {
58   cd "${srcdir}/flann-${pkgver}-src/build"
60   #install license file
61   install -D -m644 ../COPYING "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
63   make DESTDIR="$pkgdir/" install
65   # FIXME: awful hack, but I got this error without the fix:
66   # running install_lib
67   # copying build/lib/pyflann/exceptions.py -> /usr/lib/python2.7/site-packages/pyflann
68   # error: /usr/lib/python2.7/site-packages/pyflann/exceptions.py: Permission denied
69   mkdir -p "${pkgdir}${_python2libpath}"
70   cp -pr "${pkgdir}/usr/share/flann/python/pyflann" "${pkgdir}${_python2libpath}/pyflann"
73 md5sums=('d780795f523eabda7c7ea09c6f5cf235')
74 sha256sums=('eafb8c07cf59ff050be149b15d620ca3dd162e3fce9cb6748cde5d92e0dac775')
75 sha512sums=('a94f6acb6a23603c8f7e5347b317d15d50de134707389f27f22896ec99f4a0ae576fbeb56203cd1bff57707d4353f7fb98c85f1a2e976810734506049068efb0')