public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Amy Liffey" <amynka@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: media-libs/opencv/files/, media-libs/opencv/
Date: Thu, 31 May 2018 17:24:57 +0000 (UTC)	[thread overview]
Message-ID: <1527787472.fbadf5fc3cdc26df32995e2e1cad1ed47f40efad.amynka@gentoo> (raw)

commit:     fbadf5fc3cdc26df32995e2e1cad1ed47f40efad
Author:     Amy Liffey <amynka <AT> gentoo <DOT> org>
AuthorDate: Thu May 31 17:15:58 2018 +0000
Commit:     Amy Liffey <amynka <AT> gentoo <DOT> org>
CommitDate: Thu May 31 17:24:32 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fbadf5fc

media-libs/opencv: workaround C compilation mode

- Add nvcc flags to fix compilation with cuda
- Fix issue with C compilation mode for vlc
- Fix python installation path

Closes: https://bugs.gentoo.org/656530
Closes: https://bugs.gentoo.org/656580
Package-Manager: Portage-2.3.24, Repoman-2.3.6

 .../files/opencv-3.4.1-compilation-C-mode.patch    | 56 ++++++++++++++++++++++
 .../opencv-3.4.1-cuda-add-relaxed-constexpr.patch  | 14 ++++++
 .../opencv-3.4.1-python-lib-suffix-hack.patch      | 13 +++++
 ...encv-3.4.1-r1.ebuild => opencv-3.4.1-r2.ebuild} |  6 ++-
 4 files changed, 88 insertions(+), 1 deletion(-)

diff --git a/media-libs/opencv/files/opencv-3.4.1-compilation-C-mode.patch b/media-libs/opencv/files/opencv-3.4.1-compilation-C-mode.patch
new file mode 100644
index 00000000000..c94f206ed4f
--- /dev/null
+++ b/media-libs/opencv/files/opencv-3.4.1-compilation-C-mode.patch
@@ -0,0 +1,56 @@
+From 549b5df22520b60b91dd77096434d79425b31ac2 Mon Sep 17 00:00:00 2001
+From: Alexander Alekhin <alexander.alekhin@intel.com>
+Date: Mon, 28 May 2018 18:07:23 +0300
+Subject: [PATCH] build: workaround issues with C compilation mode
+
+- cvdef.h + cvRound (double only)
+- highgui_c.h
+---
+ modules/core/include/opencv2/core/cvdef.h           | 8 +++++++-
+ modules/highgui/include/opencv2/highgui/highgui_c.h | 2 ++
+ 2 files changed, 9 insertions(+), 1 deletion(-)
+
+diff --git a/modules/core/include/opencv2/core/cvdef.h b/modules/core/include/opencv2/core/cvdef.h
+index a87ced09d78..4ab72b34cc1 100644
+--- a/modules/core/include/opencv2/core/cvdef.h
++++ b/modules/core/include/opencv2/core/cvdef.h
+@@ -480,7 +480,7 @@ Cv64suf;
+ // Integer types portatibility
+ #ifdef OPENCV_STDINT_HEADER
+ #include OPENCV_STDINT_HEADER
+-#else
++#elif defined(__cplusplus)
+ #if defined(_MSC_VER) && _MSC_VER < 1600 /* MSVS 2010 */
+ namespace cv {
+ typedef signed char int8_t;
+@@ -517,9 +517,15 @@ typedef ::int64_t int64_t;
+ typedef ::uint64_t uint64_t;
+ }
+ #endif
++#else // pure C
++#include <stdint.h>
+ #endif
+ 
+ 
+ //! @}
+ 
++#ifndef __cplusplus
++#include "opencv2/core/fast_math.hpp" // define cvRound(double)
++#endif
++
+ #endif // OPENCV_CORE_CVDEF_H
+diff --git a/modules/highgui/include/opencv2/highgui/highgui_c.h b/modules/highgui/include/opencv2/highgui/highgui_c.h
+index 1eb414a76ca..35413139c79 100644
+--- a/modules/highgui/include/opencv2/highgui/highgui_c.h
++++ b/modules/highgui/include/opencv2/highgui/highgui_c.h
+@@ -135,8 +135,10 @@ CVAPI(int) cvNamedWindow( const char* name, int flags CV_DEFAULT(CV_WINDOW_AUTOS
+ CVAPI(void) cvSetWindowProperty(const char* name, int prop_id, double prop_value);
+ CVAPI(double) cvGetWindowProperty(const char* name, int prop_id);
+ 
++#ifdef __cplusplus  // FIXIT remove in OpenCV 4.0
+ /* Get window image rectangle coordinates, width and height */
+ CVAPI(cv::Rect)cvGetWindowImageRect(const char* name);
++#endif
+ 
+ /* display image within window (highgui windows remember their content) */
+ CVAPI(void) cvShowImage( const char* name, const CvArr* image );

diff --git a/media-libs/opencv/files/opencv-3.4.1-cuda-add-relaxed-constexpr.patch b/media-libs/opencv/files/opencv-3.4.1-cuda-add-relaxed-constexpr.patch
new file mode 100644
index 00000000000..11ca6aa861e
--- /dev/null
+++ b/media-libs/opencv/files/opencv-3.4.1-cuda-add-relaxed-constexpr.patch
@@ -0,0 +1,14 @@
+diff -Naur a/cmake/FindCUDA.cmake b/cmake/FindCUDA.cmake
+--- a/cmake/FindCUDA.cmake	2018-05-26 12:57:45.698858052 +0100
++++ b/cmake/FindCUDA.cmake	2018-05-26 16:49:01.196390803 +0100
+@@ -447,8 +447,8 @@
+ # Parse HOST_COMPILATION mode.
+ option(CUDA_HOST_COMPILATION_CPP "Generated file extension" ON)
+ 
+-# Extra user settable flags
+-set(CUDA_NVCC_FLAGS "" CACHE STRING "Semi-colon delimit multiple arguments.")
++ #Extra user settable flags
++set(CUDA_NVCC_FLAGS "--expt-relaxed-constexpr;" CACHE STRING "Semi-colon delimit multiple arguments.")
+ 
+ if(CMAKE_GENERATOR MATCHES "Visual Studio")
+   set(_CUDA_MSVC_HOST_COMPILER "$(VCInstallDir)Tools/MSVC/$(VCToolsVersion)/bin/Host$(Platform)/$(PlatformTarget)")

diff --git a/media-libs/opencv/files/opencv-3.4.1-python-lib-suffix-hack.patch b/media-libs/opencv/files/opencv-3.4.1-python-lib-suffix-hack.patch
new file mode 100644
index 00000000000..248e5034a21
--- /dev/null
+++ b/media-libs/opencv/files/opencv-3.4.1-python-lib-suffix-hack.patch
@@ -0,0 +1,13 @@
+--- a/cmake/OpenCVDetectPython.cmake	2018-05-31 09:14:42.998873104 +0200
++++ b/cmake/OpenCVDetectPython.cmake	2018-05-31 09:26:08.444914001 +0200
+@@ -140,8 +140,8 @@
+         else() #debian based assumed, install to the dist-packages.
+           set(_packages_path "python${_version_major_minor}/dist-packages")
+         endif()
+-        if(EXISTS "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}/${${packages_path}}")
+-          set(_packages_path "lib${LIB_SUFFIX}/${_packages_path}")
++        if(EXISTS "${CMAKE_INSTALL_PREFIX}/lib${LIBPY_SUFFIX}/${${packages_path}}")
++          set(_packages_path "lib${LIBPY_SUFFIX}/${_packages_path}")
+         else()
+           set(_packages_path "lib/${_packages_path}")
+         endif()

diff --git a/media-libs/opencv/opencv-3.4.1-r1.ebuild b/media-libs/opencv/opencv-3.4.1-r2.ebuild
similarity index 98%
rename from media-libs/opencv/opencv-3.4.1-r1.ebuild
rename to media-libs/opencv/opencv-3.4.1-r2.ebuild
index 578d147619a..34085a8db24 100644
--- a/media-libs/opencv/opencv-3.4.1-r1.ebuild
+++ b/media-libs/opencv/opencv-3.4.1-r2.ebuild
@@ -226,6 +226,9 @@ MULTILIB_WRAPPED_HEADERS=(
 PATCHES=(
 	"${FILESDIR}/${PN}-3.0.0-gles.patch"
 	"${FILESDIR}/${PN}-3.4.0-disable-download.patch"
+	"${FILESDIR}/${P}-compilation-C-mode.patch" # https://bugs.gentoo.org/656530
+	"${FILESDIR}/${P}-python-lib-suffix-hack.patch"
+	"${FILESDIR}/${P}-cuda-add-relaxed-constexpr.patch"
 )
 
 pkg_pretend() {
@@ -400,7 +403,7 @@ multilib_src_configure() {
 	# ==================================================
 	# cpu flags, should solve 633900
 	#===================================================
-		-DCPU_DISPATCH=OFF
+		-DCPU_DISPATCH=
 		-DENABLE_SSE=$(usex cpu_flags_x86_sse)
 		-DENABLE_SSE2=$(usex cpu_flags_x86_sse2)
 		-DENABLE_SSE3=$(usex cpu_flags_x86_sse3)
@@ -468,6 +471,7 @@ python_module_compile() {
 		-DPYTHON2_EXECUTABLE=$(type -P python2)
 		-DPYTHON3_EXECUTABLE=$(type -P python3)
 		-DINSTALL_PYTHON_EXAMPLES=$(usex examples)
+		-DLIBPY_SUFFIX=64
 	)
 
 	# Regenerate cache file. Can't use rebuild_cache as it won't


             reply	other threads:[~2018-05-31 17:25 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-31 17:24 Amy Liffey [this message]
  -- strict thread matches above, loose matches on Subject: below --
2024-04-26 19:49 [gentoo-commits] repo/gentoo:master commit in: media-libs/opencv/files/, media-libs/opencv/ Andrew Ammerlaan
2024-01-10 12:41 Sam James
2024-01-03 21:28 Andreas Sturmlechner
2023-08-24 22:37 Sam James
2022-10-15  0:44 Sam James
2021-12-03  0:54 Sam James
2020-06-25 17:08 Andreas Sturmlechner
2019-12-07 19:39 Amy Liffey
2019-08-10 20:15 Alexey Shvetsov
2019-01-16 19:46 Amy Liffey
2019-01-14 22:23 Amy Liffey
2018-05-25 19:26 Amy Liffey
2018-01-21  8:36 Amy Liffey
2017-07-27 18:54 Amy Liffey
2017-07-27 18:42 Amy Liffey
2016-09-27 14:22 Amy Winston
2016-06-09 13:54 Amy Winston
2016-04-07 17:39 Amy Winston
2016-02-25 13:35 Amy Winston

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1527787472.fbadf5fc3cdc26df32995e2e1cad1ed47f40efad.amynka@gentoo \
    --to=amynka@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox