1 # Maintainer: hauptmech # Contributor: figo.zhang, chubtuff, lubosz
3 # Matlab bindings are not built by default to reduce dependencies.
8 pkgdesc="FLANN is a library for performing fast approximate nearest neighbor searches in high dimensional spaces"
10 url='http://www.cs.ubc.ca/~mariusm/index.php/FLANN/FLANN'
12 makedepends=('cmake' 'python2')
13 optdepends=('hdf5' 'gtest' 'intel-tbb' 'cuda')
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'`"
19 cd "${srcdir}/flann-${pkgver}-src"
21 sed -i 's/lib64/lib/g' cmake/flann_utils.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
34 sed -i 's|#!/usr/bin/env python|#!/usr/bin/python2|' \
35 ../bin/download_checkmd5.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 \
46 sed -i 's|#!/usr/bin/python|#!/usr/bin/python2|' \
47 ../test/memusage_clustering.py \
48 ../test/memusage_nn.py
52 # cd "${srcdir}/flann-${pkgver}-src/build"
53 # # Warning: Downloads big data files.
58 cd "${srcdir}/flann-${pkgver}-src/build"
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:
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')