opencv2: x11/kde-applications/libkface

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

opencv2: x11/kde-applications/libkface

Rafael Sadowski
Diff to use opencv2.

RS

Index: Makefile
===================================================================
RCS file: /cvs/ports/x11/kde-applications/libkface/Makefile,v
retrieving revision 1.5
diff -u -p -u -p -r1.5 Makefile
--- Makefile 18 Dec 2018 09:39:21 -0000 1.5
+++ Makefile 10 Mar 2019 18:06:00 -0000
@@ -2,7 +2,7 @@
 
 COMMENT = face detection library for KDE
 DISTNAME = libkface-${VERSION}
-REVISION = 2
+REVISION = 3
 
 SHARED_LIBS = kface 0.1
 
@@ -12,18 +12,28 @@ WANTLIB =  m pthread
 WANTLIB += ${COMPILER_LIBCXX}
 WANTLIB += QtDBus QtGui QtSql QtSvg QtXml
 WANTLIB += ${KDE4LIB}/kdeui
-WANTLIB += opencv_calib3d opencv_contrib opencv_core opencv_features2d
-WANTLIB += opencv_flann opencv_gpu opencv_highgui opencv_imgproc
-WANTLIB += opencv_legacy opencv_ml opencv_nonfree opencv_objdetect
-WANTLIB += opencv_ocl opencv_photo opencv_video
+WANTLIB += lib/opencv2/opencv_calib3d lib/opencv2/opencv_contrib
+WANTLIB += lib/opencv2/opencv_core lib/opencv2/opencv_features2d
+WANTLIB += lib/opencv2/opencv_flann lib/opencv2/opencv_gpu
+WANTLIB += lib/opencv2/opencv_highgui lib/opencv2/opencv_imgproc
+WANTLIB += lib/opencv2/opencv_legacy lib/opencv2/opencv_ml
+WANTLIB += lib/opencv2/opencv_nonfree lib/opencv2/opencv_objdetect
+WANTLIB += lib/opencv2/opencv_ocl lib/opencv2/opencv_photo
+WANTLIB += lib/opencv2/opencv_video
 
 MODULES += x11/kde-applications
 
-LIB_DEPENDS = graphics/opencv
+LIB_DEPENDS = graphics/opencv2
+
+OPENCV_LIBRARY_DIR = "${LOCALBASE}/lib/opencv2"
 
 MODKDE4_USE = libs
 
 KFACE_V = 3.5.0
-SUBST_VARS += KFACE_V
+SUBST_VARS += KFACE_V OPENCV_LIBRARY_DIR
+
+pre-configure:
+ ${SUBST_CMD} ${WRKSRC}/libkface/CMakeLists.txt \
+ ${WRKSRC}/tests/CMakeLists.txt
 
 .include <bsd.port.mk>
Index: patches/patch-libkface_CMakeLists_txt
===================================================================
RCS file: patches/patch-libkface_CMakeLists_txt
diff -N patches/patch-libkface_CMakeLists_txt
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-libkface_CMakeLists_txt 10 Mar 2019 18:06:00 -0000
@@ -0,0 +1,14 @@
+$OpenBSD$
+
+Index: libkface/CMakeLists.txt
+--- libkface/CMakeLists.txt.orig
++++ libkface/CMakeLists.txt
+@@ -42,7 +42,7 @@ set(kface_database_LIB_SRCS database/databaseaccess.cp
+                             database/sqlquery.cpp
+                             database/dbcontainers.cpp
+    )
+-
++link_directories("${OPENCV_LIBRARY_DIR}")
+ KDE4_ADD_LIBRARY(kface SHARED ${kface_LIB_SRCS} ${kface_database_LIB_SRCS})
+
+ target_link_libraries(kface ${KDE4_KDECORE_LIBS}
Index: patches/patch-tests_CMakeLists_txt
===================================================================
RCS file: patches/patch-tests_CMakeLists_txt
diff -N patches/patch-tests_CMakeLists_txt
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-tests_CMakeLists_txt 10 Mar 2019 18:06:00 -0000
@@ -0,0 +1,14 @@
+$OpenBSD$
+
+Index: tests/CMakeLists.txt
+--- tests/CMakeLists.txt.orig
++++ tests/CMakeLists.txt
+@@ -8,6 +8,8 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR}/../lib
+ include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../libkface)
+ include_directories(${CMAKE_CURRENT_SOURCE_DIR}/..)
+
++link_directories("${OPENCV_LIBRARY_DIR}")
++
+ set(detect_SRCS detect.cpp)
+ KDE4_ADD_EXECUTABLE(detect ${detect_SRCS})
+ target_link_libraries(detect kface ${KDE4_KDECORE_LIBS} ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} ${OpenCV_LIBRARIES})