Skip to content

Instantly share code, notes, and snippets.

/PKGBUILD Secret

Created Dec 18, 2011
Embed
What would you like to do?
PKGBUILD for flann to make python bindings work
pkgname=flann
pkgver=1.6.11
pkgrel=1
pkgdesc="FLANN is a library for performing fast approximate nearest neighbor searches in high dimensional spaces"
arch=('any')
url='http://www.cs.ubc.ca/~mariusm/index.php/FLANN/FLANN'
license=('GPL' 'LGPL')
makedepends=('python2' 'cmake' 'pkgconfig')
source=("http://people.cs.ubc.ca/~mariusm/uploads/FLANN/flann-${pkgver}-src.zip")
md5sums=('5fd889b9f3777aa6e0d05b2546d25eb5')
_python2libpath="`python2 -c "from distutils.sysconfig import get_python_lib; print get_python_lib()" | tr -d '\n'`"
build() {
cd "${srcdir}/flann-${pkgver}-src"
sed -i 's/lib64/lib/g' cmake/flann_utils.cmake
mkdir build
cd build
cmake .. \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr \
-DPYTHON_EXECUTABLE=/usr/bin/python2
make
}
package() {
cd "${srcdir}/flann-${pkgver}-src/build"
make DESTDIR="$pkgdir/" install
# FIXME: awful hack, but I got this error without the fix:
# running install_lib
# copying build/lib/pyflann/exceptions.py -> /usr/lib/python2.7/site-packages/pyflann
# error: /usr/lib/python2.7/site-packages/pyflann/exceptions.py: Permission denied
mkdir -p "${pkgdir}${_python2libpath}"
cp -pr "${pkgdir}/usr/share/flann/python/pyflann" "${pkgdir}${_python2libpath}/pyflann"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment