1 |
commit: feeb7a004035ddf5a3c45b19399165cff76c6f82 |
2 |
Author: Amy Liffey <amynka <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Jan 24 08:54:25 2019 +0000 |
4 |
Commit: Amy Liffey <amynka <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Jan 24 09:24:08 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=feeb7a00 |
7 |
|
8 |
media-libs/opencv: fix popcnt detection |
9 |
|
10 |
Closes: https://bugs.gentoo.org/633900 |
11 |
Submitted-by: Branko Grubic <bitlord0xff <AT> gmail.com> |
12 |
Signed-off-by: Amy Liffey <amynka <AT> gentoo.org> |
13 |
Package-Manager: Portage-2.3.49, Repoman-2.3.11 |
14 |
|
15 |
media-libs/opencv/files/opencv-3.4.1-popcnt.patch | 30 +++++++++++++++++++++++ |
16 |
media-libs/opencv/opencv-3.4.1-r5.ebuild | 1 + |
17 |
2 files changed, 31 insertions(+) |
18 |
|
19 |
diff --git a/media-libs/opencv/files/opencv-3.4.1-popcnt.patch b/media-libs/opencv/files/opencv-3.4.1-popcnt.patch |
20 |
new file mode 100644 |
21 |
index 00000000000..51a6d554a25 |
22 |
--- /dev/null |
23 |
+++ b/media-libs/opencv/files/opencv-3.4.1-popcnt.patch |
24 |
@@ -0,0 +1,30 @@ |
25 |
+From a2d6fc7ac040c6ef94a36515f9ea24428f8f1ecc Mon Sep 17 00:00:00 2001 |
26 |
+From: Alexander Alekhin <alexander.alekhin@×××××.com> |
27 |
+Date: Tue, 24 Apr 2018 12:40:25 +0300 |
28 |
+Subject: [PATCH] cmake: fix popcnt detection |
29 |
+ |
30 |
+via GCC/Clang __POPCNT__ define |
31 |
+--- |
32 |
+ cmake/checks/cpu_popcnt.cpp | 4 +++- |
33 |
+ 1 file changed, 3 insertions(+), 1 deletion(-) |
34 |
+ |
35 |
+diff --git a/cmake/checks/cpu_popcnt.cpp b/cmake/checks/cpu_popcnt.cpp |
36 |
+index 16e5575108b..44c7deda053 100644 |
37 |
+--- a/cmake/checks/cpu_popcnt.cpp |
38 |
++++ b/cmake/checks/cpu_popcnt.cpp |
39 |
+@@ -4,12 +4,14 @@ |
40 |
+ # define CV_POPCNT_U64 _mm_popcnt_u64 |
41 |
+ # endif |
42 |
+ # define CV_POPCNT_U32 _mm_popcnt_u32 |
43 |
+-#else |
44 |
++#elif defined(__POPCNT__) |
45 |
+ # include <popcntintrin.h> |
46 |
+ # if defined(__x86_64__) |
47 |
+ # define CV_POPCNT_U64 __builtin_popcountll |
48 |
+ # endif |
49 |
+ # define CV_POPCNT_U32 __builtin_popcount |
50 |
++#else |
51 |
++# error "__POPCNT__ is not defined by compiler" |
52 |
+ #endif |
53 |
+ |
54 |
+ int main() |
55 |
|
56 |
diff --git a/media-libs/opencv/opencv-3.4.1-r5.ebuild b/media-libs/opencv/opencv-3.4.1-r5.ebuild |
57 |
index 45086698e73..c8bf140695b 100644 |
58 |
--- a/media-libs/opencv/opencv-3.4.1-r5.ebuild |
59 |
+++ b/media-libs/opencv/opencv-3.4.1-r5.ebuild |
60 |
@@ -233,6 +233,7 @@ PATCHES=( |
61 |
"${FILESDIR}/${P}-cuda-add-relaxed-constexpr.patch" |
62 |
"${FILESDIR}/${P}-remove-git-autodetect.patch" |
63 |
"${FILESDIR}/${P}-fix-build-with-va.patch" # bug https://bugs.gentoo.org/656576 |
64 |
+ "${FILESDIR}/${P}-popcnt.patch" # https://bugs.gentoo.org/633900 |
65 |
) |
66 |
|
67 |
pkg_pretend() { |