summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO6
-rw-r--r--PKGBUILD44
-rw-r--r--system_lz4.patch73
3 files changed, 94 insertions, 29 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 229e889fe12..fd7c20a4fac 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,5 +1,5 @@
# Generated by mksrcinfo v8
-# Fri Jan 5 14:35:30 UTC 2018
+# Wed Jan 10 21:34:52 UTC 2018
pkgbase = flann
pkgdesc = FLANN is a library for performing fast approximate nearest neighbor searches in high dimensional spaces
pkgver = 1.9.1
@@ -10,11 +10,15 @@ pkgbase = flann
license = BSD
makedepends = cmake
makedepends = python2
+ makedepends = texlive-bin
+ depends = lz4
depends = hdf5
optdepends = python2: python bindings
optdepends = cuda: cuda support
source = https://github.com/mariusmuja/flann/archive/1.9.1.tar.gz
+ source = system_lz4.patch
md5sums = 73adef1c7bf8e8b978987e7860926ea6
+ md5sums = 67aef022b455bbbd5a08920f70eb589d
pkgname = flann
diff --git a/PKGBUILD b/PKGBUILD
index 92548487cef..05bbe1cf487 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -11,34 +11,27 @@ pkgdesc="FLANN is a library for performing fast approximate nearest neighbor sea
arch=('i686' 'x86_64')
url='http://www.cs.ubc.ca/~mariusm/index.php/FLANN/FLANN'
license=('BSD')
-depends=('hdf5')
-makedepends=('cmake' 'python2')
+depends=('lz4' 'hdf5')
+makedepends=('cmake' 'python2' 'texlive-bin')
optdepends=('python2: python bindings'
'cuda: cuda support')
-source=("https://github.com/mariusmuja/flann/archive/${pkgver}.tar.gz")
-md5sums=('73adef1c7bf8e8b978987e7860926ea6')
+source=("https://github.com/mariusmuja/flann/archive/${pkgver}.tar.gz" "system_lz4.patch")
+md5sums=('73adef1c7bf8e8b978987e7860926ea6'
+ '67aef022b455bbbd5a08920f70eb589d')
-build() {
+prepare() {
cd "$srcdir/flann-${pkgver}"
- sed -i 's|#!/usr/bin/env python|#!/usr/bin/python2|' \
- bin/download_checkmd5.py \
- bin/run_test.py \
- src/python/setup.py.tpl \
- test/test_clustering.py \
- test/test_index_save.py \
- test/test_nn_autotune.py \
- test/test_nn_index.py \
- test/test_nn.py
-
- sed -i 's|#!/usr/bin/python|#!/usr/bin/python2|' \
- test/memusage_clustering.py \
- test/memusage_nn.py
+ patch -Np2 -i "${srcdir}/system_lz4.patch"
sed -i "s|setup\.py install|setup.py install --root=$pkgdir --optimize=1|" src/python/CMakeLists.txt
+}
- [[ -d build ]] && rm -r build
- mkdir build && cd build
+build() {
+ cd "$srcdir/flann-${pkgver}"
+
+ #[[ -d build ]] && rm -r build
+ mkdir -p build && cd build
cmake .. \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr \
@@ -48,6 +41,7 @@ build() {
-DBUILD_TESTS=OFF \
-DBUILD_EXAMPLES=OFF
make
+ make doc
}
package() {
@@ -59,13 +53,7 @@ package() {
#install license file
install -D -m644 ../COPYING "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
- # 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
- _python2libpath="`python2 -c "from distutils.sysconfig import get_python_lib; print get_python_lib()" | tr -d '\n'`"
- mkdir -p "${pkgdir}${_python2libpath}"
- cp -pr "${pkgdir}/usr/share/flann/python/pyflann" "${pkgdir}${_python2libpath}/pyflann"
-
+ # remove lz4 because we use the one supplied by the system
+ rm -r "${pkgdir}/usr/include/flann/ext"
}
diff --git a/system_lz4.patch b/system_lz4.patch
new file mode 100644
index 00000000000..33eed02923f
--- /dev/null
+++ b/system_lz4.patch
@@ -0,0 +1,73 @@
+diff -ura original/flann-1.9.1/src/cpp/CMakeLists.txt patched/flann-1.9.1/src/cpp/CMakeLists.txt
+--- original/flann-1.9.1/src/cpp/CMakeLists.txt 2016-08-05 01:20:50.000000000 +0200
++++ patched/flann-1.9.1/src/cpp/CMakeLists.txt 2018-01-10 21:04:55.071840885 +0100
+@@ -4,8 +4,8 @@
+
+ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/flann/config.h.in ${CMAKE_CURRENT_SOURCE_DIR}/flann/config.h)
+
+-file(GLOB_RECURSE C_SOURCES flann.cpp lz4.c lz4hc.c)
+-file(GLOB_RECURSE CPP_SOURCES flann_cpp.cpp lz4.c lz4hc.c)
++file(GLOB_RECURSE C_SOURCES flann.cpp)
++file(GLOB_RECURSE CPP_SOURCES flann_cpp.cpp)
+ file(GLOB_RECURSE CU_SOURCES *.cu)
+
+ add_library(flann_cpp_s STATIC ${CPP_SOURCES})
+@@ -31,7 +31,12 @@
+ if(CMAKE_SYSTEM_NAME STREQUAL "Linux" AND CMAKE_COMPILER_IS_GNUCC)
+ add_library(flann_cpp SHARED "")
+ set_target_properties(flann_cpp PROPERTIES LINKER_LANGUAGE CXX)
+- target_link_libraries(flann_cpp -Wl,-whole-archive flann_cpp_s -Wl,-no-whole-archive)
++ target_link_libraries(flann_cpp
++ lz4
++ -Wl,-whole-archive
++ flann_cpp_s
++ -Wl,-no-whole-archive
++ )
+
+ if (BUILD_CUDA_LIB)
+ cuda_add_library(flann_cuda SHARED "")
+@@ -85,7 +90,11 @@
+ if(CMAKE_SYSTEM_NAME STREQUAL "Linux" AND CMAKE_COMPILER_IS_GNUCC)
+ add_library(flann SHARED "")
+ set_target_properties(flann PROPERTIES LINKER_LANGUAGE CXX)
+- target_link_libraries(flann -Wl,-whole-archive flann_s -Wl,-no-whole-archive)
++ target_link_libraries(flann
++ lz4
++ -Wl,-whole-archive
++ flann_s
++ -Wl,-no-whole-archive)
+ else()
+ add_library(flann SHARED ${C_SOURCES})
+
+@@ -112,7 +121,7 @@
+
+
+ install (
+- TARGETS flann_cpp flann_cpp_s
++ TARGETS flann_cpp
+ RUNTIME DESTINATION bin
+ LIBRARY DESTINATION ${FLANN_LIB_INSTALL_DIR}
+ ARCHIVE DESTINATION ${FLANN_LIB_INSTALL_DIR}
+@@ -129,7 +138,7 @@
+
+ if (BUILD_C_BINDINGS)
+ install (
+- TARGETS flann flann_s
++ TARGETS flann
+ RUNTIME DESTINATION bin
+ LIBRARY DESTINATION ${FLANN_LIB_INSTALL_DIR}
+ ARCHIVE DESTINATION ${FLANN_LIB_INSTALL_DIR}
+diff -ura original/flann-1.9.1/src/cpp/flann/util/serialization.h patched/flann-1.9.1/src/cpp/flann/util/serialization.h
+--- original/flann-1.9.1/src/cpp/flann/util/serialization.h 2016-08-05 01:20:50.000000000 +0200
++++ patched/flann-1.9.1/src/cpp/flann/util/serialization.h 2018-01-10 20:33:19.220139992 +0100
+@@ -6,8 +6,8 @@
+ #include <cstdlib>
+ #include <cstring>
+ #include <stdio.h>
+-#include "flann/ext/lz4.h"
+-#include "flann/ext/lz4hc.h"
++#include <lz4.h>
++#include <lz4hc.h>
+
+
+ namespace flann