From 2b1552364b45691077e281974662d19b24570004bd4017f82339aed493c1e9b7 Mon Sep 17 00:00:00 2001 From: Stephan Kulow Date: Mon, 2 Dec 2013 06:25:53 +0000 Subject: [PATCH] Accepting request 209071 from KDE:Extra Added opencv-pkgconfig.patch: make sure to provide link flags in OpenCV pc file (bnc#853036) OBS-URL: https://build.opensuse.org/request/show/209071 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/opencv?expand=0&rev=47 --- opencv-pkgconfig.patch | 35 +++++++++++++++++++++++++++++++++++ opencv.changes | 6 ++++++ opencv.spec | 4 ++++ 3 files changed, 45 insertions(+) create mode 100644 opencv-pkgconfig.patch diff --git a/opencv-pkgconfig.patch b/opencv-pkgconfig.patch new file mode 100644 index 0000000..47a2d93 --- /dev/null +++ b/opencv-pkgconfig.patch @@ -0,0 +1,35 @@ +diff -baur opencv-2.4.7.orig/cmake/OpenCVGenPkgconfig.cmake opencv-2.4.7/cmake/OpenCVGenPkgconfig.cmake +--- opencv-2.4.7.orig/cmake/OpenCVGenPkgconfig.cmake 2013-11-12 20:31:27.253763202 +0000 ++++ opencv-2.4.7/cmake/OpenCVGenPkgconfig.cmake 2013-11-12 20:41:48.936262732 +0000 +@@ -10,7 +10,7 @@ + # ------------------------------------------------------------------------------------------- + set(prefix "${CMAKE_INSTALL_PREFIX}") + set(exec_prefix "\${prefix}") +-set(libdir "") #TODO: need link paths for OpenCV_EXTRA_COMPONENTS ++set(libdir "\${prefix}/${OPENCV_LIB_INSTALL_PATH}") + set(includedir "\${prefix}/${OPENCV_INCLUDE_INSTALL_PATH}") + + if(CMAKE_BUILD_TYPE MATCHES "Release") +@@ -35,10 +35,11 @@ + ocv_list_reverse(OpenCV_EXTRA_COMPONENTS) + + #build the list of components +-set(OpenCV_LIB_COMPONENTS_ "") ++set(OpenCV_LIB_COMPONENTS_ "-L\${libdir}") + foreach(CVLib ${OpenCV_LIB_COMPONENTS}) + get_target_property(libpath ${CVLib} LOCATION_${CMAKE_BUILD_TYPE}) + get_filename_component(libname "${libpath}" NAME) ++ get_filename_component(lname "${libpath}" NAME_WE) + + if(INSTALL_TO_MANGLED_PATHS) + set(libname "${libname}.${OPENCV_VERSION}") +@@ -51,7 +52,8 @@ + set(installDir "${OPENCV_LIB_INSTALL_PATH}") + endif() + +- set(OpenCV_LIB_COMPONENTS_ "${OpenCV_LIB_COMPONENTS_} \${exec_prefix}/${installDir}/${libname}") ++ string(REPLACE "libopencv" "-lopencv" lname "${lname}") ++ set(OpenCV_LIB_COMPONENTS_ "${OpenCV_LIB_COMPONENTS_} ${lname}") + endforeach() + + # add extra dependencies required for OpenCV diff --git a/opencv.changes b/opencv.changes index 0c7cc93..f39ebf2 100644 --- a/opencv.changes +++ b/opencv.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Sun Dec 1 17:37:36 UTC 2013 - hrvoje.senjan@gmail.com + +- Added opencv-pkgconfig.patch: make sure to provide link flags in + OpenCV pc file (bnc#853036) + ------------------------------------------------------------------- Tue Nov 12 23:07:23 UTC 2013 - hrvoje.senjan@gmail.com diff --git a/opencv.spec b/opencv.spec index a380912..e6682e5 100644 --- a/opencv.spec +++ b/opencv.spec @@ -35,6 +35,9 @@ Patch1: %{name}-samples.patch Patch2: %{name}-underlinking.patch # PATCH-FIX-OPENSUSE improve-sphinx-search.diff -- properly find sphinx with alphabetic chars in version Patch3: improve-sphinx-search.diff +# PATCH-FIX-UPSTREAM opencv-pkgconfig.patch -- Make sure to provide link flags in OpenCV pc file (bnc#853036). Issue is exposed when e.g. a project relies on +# getting opencv vars via pc (first), and then via CMake, as is the case with nomacs +Patch4: opencv-pkgconfig.patch BuildRequires: cmake BuildRequires: fdupes BuildRequires: gstreamer-0_10-plugins-base-devel @@ -120,6 +123,7 @@ This package contains the documentation and examples for the OpenCV library. %patch1 -p1 %patch2 -p1 %patch3 -p0 +%patch4 -p1 # Remove Windows specific files rm -f doc/packaging.txt