1 |
commit: 70132f237102800691e177705a3b55eda7cdad06 |
2 |
Author: Andreas Sturmlechner <andreas.sturmlechner <AT> gmail <DOT> com> |
3 |
AuthorDate: Sat Nov 26 13:27:35 2016 +0000 |
4 |
Commit: Michael Palimaka <kensington <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Nov 26 13:27:35 2016 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/kde.git/commit/?id=70132f23 |
7 |
|
8 |
kde-apps/libkface: Fix build with >=media-libs/opencv-3.1.0-r6 |
9 |
|
10 |
media-libs/opencv-3.1.0-r6 is using a contrib snapshot from git master |
11 |
breaking API. |
12 |
|
13 |
Gentoo-bug: 600238 |
14 |
|
15 |
Package-Manager: portage-2.3.0 |
16 |
|
17 |
.../libkface-16.11.80-opencv3.2-gentoo-3.1.patch | 58 ++++++++++++++++++++++ |
18 |
kde-apps/libkface/libkface-16.12.49.9999.ebuild | 5 +- |
19 |
kde-apps/libkface/libkface-9999.ebuild | 5 +- |
20 |
3 files changed, 66 insertions(+), 2 deletions(-) |
21 |
|
22 |
diff --git a/kde-apps/libkface/files/libkface-16.11.80-opencv3.2-gentoo-3.1.patch b/kde-apps/libkface/files/libkface-16.11.80-opencv3.2-gentoo-3.1.patch |
23 |
new file mode 100644 |
24 |
index 0000000..bd61e9c |
25 |
--- /dev/null |
26 |
+++ b/kde-apps/libkface/files/libkface-16.11.80-opencv3.2-gentoo-3.1.patch |
27 |
@@ -0,0 +1,58 @@ |
28 |
+--- a/src/recognition-opencv-lbph/facerec_borrowed.h 2016-11-26 14:19:01.492645170 +0100 |
29 |
++++ b/src/recognition-opencv-lbph/facerec_borrowed.h.new 2016-11-26 14:19:17.655835794 +0100 |
30 |
+@@ -141,7 +141,7 @@ |
31 |
+ /* |
32 |
+ * Predict |
33 |
+ */ |
34 |
+- void predict(cv::InputArray src, cv::Ptr<cv::face::PredictCollector> collector, const int state = 0) const override; |
35 |
++ void predict(cv::InputArray src, cv::Ptr<cv::face::PredictCollector> collector) const override; |
36 |
+ #endif |
37 |
+ |
38 |
+ /** |
39 |
+--- a/src/recognition-opencv-lbph/facerec_borrowed.cpp 2016-11-26 14:19:01.492645170 +0100 |
40 |
++++ b/src/recognition-opencv-lbph/facerec_borrowed.cpp.new 2016-11-26 14:19:29.184971765 +0100 |
41 |
+@@ -380,7 +380,7 @@ |
42 |
+ #if OPENCV_TEST_VERSION(3,1,0) |
43 |
+ void LBPHFaceRecognizer::predict(InputArray _src, int &minClass, double &minDist) const |
44 |
+ #else |
45 |
+-void LBPHFaceRecognizer::predict(cv::InputArray _src, cv::Ptr<cv::face::PredictCollector> collector, const int state) const |
46 |
++void LBPHFaceRecognizer::predict(cv::InputArray _src, cv::Ptr<cv::face::PredictCollector> collector) const |
47 |
+ #endif |
48 |
+ { |
49 |
+ if(m_histograms.empty()) |
50 |
+@@ -404,7 +404,7 @@ |
51 |
+ minDist = DBL_MAX; |
52 |
+ minClass = -1; |
53 |
+ #else |
54 |
+- collector->init((int)m_histograms.size(), state); |
55 |
++ collector->init((int)m_histograms.size()); |
56 |
+ #endif |
57 |
+ |
58 |
+ // This is the standard method |
59 |
+@@ -424,7 +424,7 @@ |
60 |
+ } |
61 |
+ #else |
62 |
+ int label = m_labels.at<int>((int) sampleIdx); |
63 |
+- if (!collector->emit(label, dist, state)) |
64 |
++ if (!collector->collect(label, dist)) |
65 |
+ { |
66 |
+ return; |
67 |
+ } |
68 |
+@@ -470,7 +470,7 @@ |
69 |
+ minClass = it->first; |
70 |
+ } |
71 |
+ #else |
72 |
+- if (!collector->emit(it->first, mean, state)) |
73 |
++ if (!collector->collect(it->first, mean)) |
74 |
+ { |
75 |
+ return; |
76 |
+ } |
77 |
+@@ -523,7 +523,7 @@ |
78 |
+ } |
79 |
+ #else |
80 |
+ // large is better thus it is -score. |
81 |
+- if (!collector->emit(it->first, -score, state)) |
82 |
++ if (!collector->collect(it->first, -score)) |
83 |
+ { |
84 |
+ return; |
85 |
+ } |
86 |
|
87 |
diff --git a/kde-apps/libkface/libkface-16.12.49.9999.ebuild b/kde-apps/libkface/libkface-16.12.49.9999.ebuild |
88 |
index 213af06..57cb029 100644 |
89 |
--- a/kde-apps/libkface/libkface-16.12.49.9999.ebuild |
90 |
+++ b/kde-apps/libkface/libkface-16.12.49.9999.ebuild |
91 |
@@ -19,10 +19,13 @@ DEPEND=" |
92 |
$(add_qt_dep qtsql) |
93 |
$(add_qt_dep qtwidgets) |
94 |
$(add_qt_dep qtxml) |
95 |
- media-libs/opencv:=[contrib(+)] |
96 |
+ media-libs/opencv:= |
97 |
+ || ( <media-libs/opencv-3.0.0 >=media-libs/opencv-3.1.0-r6[contrib] ) |
98 |
" |
99 |
RDEPEND="${DEPEND}" |
100 |
|
101 |
+PATCHES=( "${FILESDIR}/${PN}-16.11.80-opencv3.2-gentoo-3.1.patch" ) # not upstreamable like that |
102 |
+ |
103 |
src_configure() { |
104 |
local mycmakeargs=( |
105 |
-DENABLE_OPENCV3=$(has_version ">=media-libs/opencv-3" && echo yes || echo no) |
106 |
|
107 |
diff --git a/kde-apps/libkface/libkface-9999.ebuild b/kde-apps/libkface/libkface-9999.ebuild |
108 |
index 213af06..57cb029 100644 |
109 |
--- a/kde-apps/libkface/libkface-9999.ebuild |
110 |
+++ b/kde-apps/libkface/libkface-9999.ebuild |
111 |
@@ -19,10 +19,13 @@ DEPEND=" |
112 |
$(add_qt_dep qtsql) |
113 |
$(add_qt_dep qtwidgets) |
114 |
$(add_qt_dep qtxml) |
115 |
- media-libs/opencv:=[contrib(+)] |
116 |
+ media-libs/opencv:= |
117 |
+ || ( <media-libs/opencv-3.0.0 >=media-libs/opencv-3.1.0-r6[contrib] ) |
118 |
" |
119 |
RDEPEND="${DEPEND}" |
120 |
|
121 |
+PATCHES=( "${FILESDIR}/${PN}-16.11.80-opencv3.2-gentoo-3.1.patch" ) # not upstreamable like that |
122 |
+ |
123 |
src_configure() { |
124 |
local mycmakeargs=( |
125 |
-DENABLE_OPENCV3=$(has_version ">=media-libs/opencv-3" && echo yes || echo no) |