Skip to content

Instantly share code, notes, and snippets.

/PKGBUILD Secret

Created December 18, 2011 09:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/6537bd55d716d5c7fdbf to your computer and use it in GitHub Desktop.
Save anonymous/6537bd55d716d5c7fdbf to your computer and use it in GitHub Desktop.
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