media-libs/vidstab: For tests, use sse2 only if it is available
authorCraig Andrews <candrews@gentoo.org>
Mon, 14 Jan 2019 16:14:57 +0000 (11:14 -0500)
committerCraig Andrews <candrews@gentoo.org>
Mon, 14 Jan 2019 16:15:13 +0000 (11:15 -0500)
Reported upstream at https://github.com/georgmartius/vid.stab/pull/70

Closes: https://bugs.gentoo.org/675318
Package-Manager: Portage-2.3.55, Repoman-2.3.12
Signed-off-by: Craig Andrews <candrews@gentoo.org>
media-libs/vidstab/files/vidstab-1.1.0-tests-use-sse2-only-if-available.patch [new file with mode: 0644]
media-libs/vidstab/vidstab-1.1.0-r1.ebuild
media-libs/vidstab/vidstab-9999.ebuild

diff --git a/media-libs/vidstab/files/vidstab-1.1.0-tests-use-sse2-only-if-available.patch b/media-libs/vidstab/files/vidstab-1.1.0-tests-use-sse2-only-if-available.patch
new file mode 100644 (file)
index 0000000..fc7deca
--- /dev/null
@@ -0,0 +1,33 @@
+From 80932fbd1e77d397a7b503697c78fd888ede396a Mon Sep 17 00:00:00 2001
+From: Craig Andrews <candrews@integralblue.com>
+Date: Mon, 14 Jan 2019 11:08:30 -0500
+Subject: [PATCH] In tests, use sse2 only if it is available
+
+Use FindSSE and SSE2_FOUND in the same way as done in the main CMakeLists.txt in commit 0f41dfb89ba3fa7d20f45cbeb02cc1ff37c89c27
+---
+ tests/CMakeLists.txt | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
+index 9597141..6812916 100644
+--- a/tests/CMakeLists.txt
++++ b/tests/CMakeLists.txt
+@@ -7,6 +7,8 @@ project (vid.stab)
+ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/../CMakeModules/")
++include (FindSSE)
++
+ option(USE_OMP "use parallelization use OMP" ON)
+ # Default to debug builds if no explicit build type specified.
+@@ -23,7 +25,9 @@ else()
+ add_definitions( -DDISABLE_ORC)
+ endif()
++if(SSE2_FOUND)
+ add_definitions( -DUSE_SSE2 -msse2 -ffast-math -fno-show-column ) # -DUSE_SSE2_ASM
++endif()
+ if(USE_OMP)
+ add_definitions(-fopenmp -DUSE_OMP)
index 31b7ac658193fc948ed9b3773eeb3ba3251d5f77..a6e5eadfa24b6d70a7d3cfcf17112c9bb90f9a4b 100644 (file)
@@ -24,14 +24,16 @@ SLOT="0"
 IUSE="openmp cpu_flags_x86_sse2"
 PATCHES=(
        "${FILESDIR}/vidstab-1.1.0-tests-should-exit-with-code-0-on-success.patch"
+       "${FILESDIR}/vidstab-1.1.0-tests-use-sse2-only-if-available.patch"
 )
 src_prepare() {
        # USE=cpu_flags_x86_sse2 instead
-       sed -E 's#include (FindSSE)##' -i CMakeLists.txt
+       sed -E 's#include (FindSSE)##' -i CMakeLists.txt || die
+       sed -E 's#include (FindSSE)##' -i tests/CMakeLists.txt || die
        # strip some CFLAGS
        for FILE_TO_PATCH in {,transcode/,tests/}CMakeLists.txt; do
-               sed -E 's#(add_definitions.* )-g #\1#' -i ${FILE_TO_PATCH}
-               sed -E 's#(add_definitions.* )-O3 #\1#' -i ${FILE_TO_PATCH}
+               sed -E 's#(add_definitions.* )-g #\1#' -i ${FILE_TO_PATCH} || die
+               sed -E 's#(add_definitions.* )-O3 #\1#' -i ${FILE_TO_PATCH} || die
        done
        cmake-utils_src_prepare
 }
@@ -48,6 +50,7 @@ src_configure() {
 multilib_src_test() {
        local mycmakeargs=(
                -DUSE_OMP="$(usex openmp)"
+               -DSSE2_FOUND="$(usex cpu_flags_x86_sse2)"
        )
        local CMAKE_USE_DIR="${CMAKE_USE_DIR}/tests"
        local BUILD_DIR="${BUILD_DIR}/tests"
index c694caee1d919be47b4fb29b49e703fd77158364..447fa85568696a25288fb170e997a2e68760c02f 100644 (file)
@@ -22,14 +22,14 @@ fi
 LICENSE="GPL-2+"
 SLOT="0"
 IUSE="openmp cpu_flags_x86_sse2"
-
 src_prepare() {
        # USE=cpu_flags_x86_sse2 instead
-       sed -E 's#include (FindSSE)##' -i CMakeLists.txt
+       sed -E 's#include (FindSSE)##' -i CMakeLists.txt || die
+       sed -E 's#include (FindSSE)##' -i tests/CMakeLists.txt || die
        # strip some CFLAGS
        for FILE_TO_PATCH in {,transcode/,tests/}CMakeLists.txt; do
-               sed -E 's#(add_definitions.* )-g #\1#' -i ${FILE_TO_PATCH}
-               sed -E 's#(add_definitions.* )-O3 #\1#' -i ${FILE_TO_PATCH}
+               sed -E 's#(add_definitions.* )-g #\1#' -i ${FILE_TO_PATCH} || die
+               sed -E 's#(add_definitions.* )-O3 #\1#' -i ${FILE_TO_PATCH} || die
        done
        cmake-utils_src_prepare
 }
@@ -46,6 +46,7 @@ src_configure() {
 multilib_src_test() {
        local mycmakeargs=(
                -DUSE_OMP="$(usex openmp)"
+               -DSSE2_FOUND="$(usex cpu_flags_x86_sse2)"
        )
        local CMAKE_USE_DIR="${CMAKE_USE_DIR}/tests"
        local BUILD_DIR="${BUILD_DIR}/tests"