media-libs/vidstab: multilib support
authorCraig Andrews <candrews@gentoo.org>
Fri, 11 Jan 2019 16:08:44 +0000 (11:08 -0500)
committerCraig Andrews <candrews@gentoo.org>
Fri, 11 Jan 2019 16:14:54 +0000 (11:14 -0500)
Package-Manager: Portage-2.3.54, Repoman-2.3.12
Signed-off-by: Craig Andrews <candrews@gentoo.org>
media-libs/vidstab/vidstab-1.1.0-r1.ebuild [new file with mode: 0644]
media-libs/vidstab/vidstab-9999.ebuild

diff --git a/media-libs/vidstab/vidstab-1.1.0-r1.ebuild b/media-libs/vidstab/vidstab-1.1.0-r1.ebuild
new file mode 100644 (file)
index 0000000..31b7ac6
--- /dev/null
@@ -0,0 +1,57 @@
+# Copyright 2018-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+: ${CMAKE_MAKEFILE_GENERATOR:=ninja}
+
+inherit cmake-multilib toolchain-funcs
+
+DESCRIPTION="Video stabilization library"
+HOMEPAGE="http://public.hronopik.de/vid.stab/"
+
+if [[ ${PV} == *9999 ]] ; then
+       EGIT_REPO_URI="https://github.com/georgmartius/vid.stab.git"
+       inherit git-r3
+else
+       SRC_URI="https://github.com/georgmartius/vid.stab/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+       KEYWORDS="~amd64 ~x86"
+       S="${WORKDIR}/vid.stab-${PV}"
+fi
+
+LICENSE="GPL-2+"
+SLOT="0"
+IUSE="openmp cpu_flags_x86_sse2"
+PATCHES=(
+       "${FILESDIR}/vidstab-1.1.0-tests-should-exit-with-code-0-on-success.patch"
+)
+src_prepare() {
+       # USE=cpu_flags_x86_sse2 instead
+       sed -E 's#include (FindSSE)##' -i CMakeLists.txt
+       # 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}
+       done
+       cmake-utils_src_prepare
+}
+
+src_configure() {
+       use openmp && tc-check-openmp
+       local mycmakeargs=(
+               -DUSE_OMP="$(usex openmp)"
+               -DSSE2_FOUND="$(usex cpu_flags_x86_sse2)"
+       )
+       cmake-multilib_src_configure
+}
+
+multilib_src_test() {
+       local mycmakeargs=(
+               -DUSE_OMP="$(usex openmp)"
+       )
+       local CMAKE_USE_DIR="${CMAKE_USE_DIR}/tests"
+       local BUILD_DIR="${BUILD_DIR}/tests"
+       cmake-utils_src_configure
+       cmake-utils_src_make
+       "${BUILD_DIR}"/tests || die
+}
index 08bf38d39555a2a274c3f71827cd8f032d38d045..c694caee1d919be47b4fb29b49e703fd77158364 100644 (file)
@@ -1,9 +1,11 @@
 # Copyright 2018-2019 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
-EAPI=7
+EAPI=6
 
-inherit cmake-utils toolchain-funcs
+: ${CMAKE_MAKEFILE_GENERATOR:=ninja}
+
+inherit cmake-multilib toolchain-funcs
 
 DESCRIPTION="Video stabilization library"
 HOMEPAGE="http://public.hronopik.de/vid.stab/"
@@ -38,11 +40,10 @@ src_configure() {
                -DUSE_OMP="$(usex openmp)"
                -DSSE2_FOUND="$(usex cpu_flags_x86_sse2)"
        )
-       cmake-utils_src_configure
+       cmake-multilib_src_configure
 }
 
-src_test() {
-       cd tests || die
+multilib_src_test() {
        local mycmakeargs=(
                -DUSE_OMP="$(usex openmp)"
        )