[packages/flann] fix lz4 flags in pc file; rel 3
atler
atler at pld-linux.org
Tue Feb 21 19:24:32 CET 2023
commit 0155d3e16cc5c163abe6094c234eb58fbdabd67d
Author: Jan Palus <atler at pld-linux.org>
Date: Tue Feb 21 19:23:54 2023 +0100
fix lz4 flags in pc file; rel 3
c9572a40574c18a79e50b6a8c0043a8cafed6e69.patch | 52 ++++++++++++++++++++++++++
flann.spec | 4 +-
pc-lz4-flags.patch | 21 +++++++++++
3 files changed, 76 insertions(+), 1 deletion(-)
---
diff --git a/flann.spec b/flann.spec
index 9f6ec62..121c847 100644
--- a/flann.spec
+++ b/flann.spec
@@ -7,7 +7,7 @@ Summary: FLANN - Fast Library for Approximate Nearest Neighbours
Summary(pl.UTF-8): FLANN - szybka biblioteka do przybliżonego wyszukiwania najbliższych sąsiadów
Name: flann
Version: 1.9.2
-Release: 2
+Release: 3
License: BSD
Group: Libraries
#Source0Download: https://github.com/flann-lib/flann/tags
@@ -16,6 +16,7 @@ Source0: https://github.com/flann-lib/flann/archive/%{version}/%{name}-%{version
Patch0: %{name}-python.patch
Patch1: %{name}-libdir.patch
Patch2: cmake.patch
+Patch3: pc-lz4-flags.patch
URL: https://github.com/flann-lib/flann
BuildRequires: cmake >= 2.6
%{?with_openmp:BuildRequires: gcc-c++ >= 6:4.2}
@@ -116,6 +117,7 @@ Dowiązania Pythona do biblioteki FLANN.
%patch0 -p1
%patch1 -p1
%patch2 -p1
+%patch3 -p1
%build
install -d build
diff --git a/c9572a40574c18a79e50b6a8c0043a8cafed6e69.patch b/c9572a40574c18a79e50b6a8c0043a8cafed6e69.patch
new file mode 100644
index 0000000..43e1142
--- /dev/null
+++ b/c9572a40574c18a79e50b6a8c0043a8cafed6e69.patch
@@ -0,0 +1,52 @@
+From c9572a40574c18a79e50b6a8c0043a8cafed6e69 Mon Sep 17 00:00:00 2001
+From: Maarten de Vries <maarten at de-vri.es>
+Date: Mon, 18 Oct 2021 10:56:42 +0200
+Subject: [PATCH] Ensure LZ4 is added to the interface link libraries of shared
+ libraries.
+
+---
+ src/cpp/CMakeLists.txt | 8 +++++---
+ 1 file changed, 5 insertions(+), 3 deletions(-)
+
+diff --git a/src/cpp/CMakeLists.txt b/src/cpp/CMakeLists.txt
+index 10135703..a75059f9 100644
+--- a/src/cpp/CMakeLists.txt
++++ b/src/cpp/CMakeLists.txt
+@@ -9,7 +9,7 @@ file(GLOB_RECURSE CPP_SOURCES flann_cpp.cpp)
+ file(GLOB_RECURSE CU_SOURCES *.cu)
+
+ add_library(flann_cpp_s STATIC ${CPP_SOURCES})
+-target_link_libraries(flann_cpp_s ${LZ4_LINK_LIBRARIES})
++target_link_libraries(flann_cpp_s PUBLIC ${LZ4_LINK_LIBRARIES})
+ if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_CLANG)
+ set_target_properties(flann_cpp_s PROPERTIES COMPILE_FLAGS -fPIC)
+ endif()
+@@ -33,6 +33,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Linux" AND CMAKE_COMPILER_IS_GNUCC)
+ add_library(flann_cpp SHARED dummy.c)
+ 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 PUBLIC ${LZ4_LINK_LIBRARIES})
+
+ if (BUILD_CUDA_LIB)
+ cuda_add_library(flann_cuda SHARED dummy.c)
+@@ -42,7 +43,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Linux" AND CMAKE_COMPILER_IS_GNUCC)
+ endif()
+ else()
+ add_library(flann_cpp SHARED ${CPP_SOURCES})
+- target_link_libraries(flann_cpp ${LZ4_LINK_LIBRARIES})
++ target_link_libraries(flann_cpp PUBLIC ${LZ4_LINK_LIBRARIES})
+ # export lz4 headers, so that MSVC to creates flann_cpp.lib
+ set_target_properties(flann_cpp PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS YES)
+ if (BUILD_CUDA_LIB)
+@@ -90,9 +91,10 @@ if (BUILD_C_BINDINGS)
+ add_library(flann SHARED dummy.c)
+ 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 PUBLIC ${LZ4_LINK_LIBRARIES})
+ else()
+ add_library(flann SHARED ${C_SOURCES})
+- target_link_libraries(flann ${LZ4_LINK_LIBRARIES})
++ target_link_libraries(flann PUBLIC ${LZ4_LINK_LIBRARIES})
+
+ if(MINGW AND OPENMP_FOUND)
+ target_link_libraries(flann gomp)
diff --git a/pc-lz4-flags.patch b/pc-lz4-flags.patch
new file mode 100644
index 0000000..4e1443f
--- /dev/null
+++ b/pc-lz4-flags.patch
@@ -0,0 +1,21 @@
+diff -ur flann-1.9.2.orig/cmake/CMakeLists.txt flann-1.9.2/cmake/CMakeLists.txt
+--- flann-1.9.2.orig/cmake/CMakeLists.txt 2021-04-12 09:15:28.000000000 +0200
++++ flann-1.9.2/cmake/CMakeLists.txt 2023-02-21 19:18:14.517326948 +0100
+@@ -1,5 +1,6 @@
+ set(PKG_DESC "Fast Library for Approximate Nearest Neighbors")
+ set(pkg_conf_file ${CMAKE_CURRENT_BINARY_DIR}/flann.pc)
++string(REPLACE ";" " " LZ4_STATIC_LDFLAGS_PC "${LZ4_STATIC_LDFLAGS}")
+ configure_file(flann.pc.in ${pkg_conf_file} @ONLY)
+ install(FILES ${pkg_conf_file}
+ DESTINATION ${FLANN_LIB_INSTALL_DIR}/pkgconfig/ COMPONENT pkgconfig)
+diff -ur flann-1.9.2.orig/cmake/flann.pc.in flann-1.9.2/cmake/flann.pc.in
+--- flann-1.9.2.orig/cmake/flann.pc.in 2021-04-12 09:15:28.000000000 +0200
++++ flann-1.9.2/cmake/flann.pc.in 2023-02-21 19:18:27.807406729 +0100
+@@ -8,6 +8,6 @@
+ Description: @PKG_DESC@
+ Version: @FLANN_VERSION@
+ Requires: @PKG_EXTERNAL_DEPS@
+-Libs: -L${libdir} @LZ4_STATIC_LDFLAGS@ -lflann -lflann_cpp
++Libs: -L${libdir} @LZ4_STATIC_LDFLAGS_PC@ -lflann -lflann_cpp
+ Cflags: -I${includedir}
+
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/flann.git/commitdiff/0155d3e16cc5c163abe6094c234eb58fbdabd67d
More information about the pld-cvs-commit
mailing list