1 # Copyright 2018-2024 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 inherit cmake-multilib toolchain-funcs flag-o-matic
8 DESCRIPTION="Video stabilization library"
9 HOMEPAGE="http://public.hronopik.de/vid.stab/"
11 if [[ ${PV} == *9999* ]] ; then
12 EGIT_REPO_URI="https://github.com/georgmartius/vid.stab.git"
15 SRC_URI="https://github.com/georgmartius/vid.stab/archive/v${PV}.tar.gz -> ${P}.tar.gz"
16 KEYWORDS="~alpha amd64 arm arm64 ~loong ppc ppc64 ~riscv ~x86"
17 S="${WORKDIR}/vid.stab-${PV}"
22 IUSE="openmp cpu_flags_x86_sse2 test"
24 RESTRICT="!test? ( test )"
25 DEPEND="test? ( dev-lang/orc )"
28 [[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
32 [[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
36 # USE=cpu_flags_x86_sse2 instead
37 sed -E 's#include (FindSSE)##' -i CMakeLists.txt || die
38 sed -E 's#include (FindSSE)##' -i tests/CMakeLists.txt || die
40 for FILE_TO_PATCH in {,transcode/,tests/}CMakeLists.txt; do
41 sed -E 's#(add_definitions.* )-g #\1#' -i ${FILE_TO_PATCH} || die
42 sed -E 's#(add_definitions.* )-O3 #\1#' -i ${FILE_TO_PATCH} || die
49 -DUSE_OMP="$(usex openmp)"
50 -DSSE2_FOUND="$(usex cpu_flags_x86_sse2)"
52 cmake-multilib_src_configure
57 -DUSE_OMP="$(usex openmp)"
58 -DSSE2_FOUND="$(usex cpu_flags_x86_sse2)"
60 append-cflags $(test-flags-CC -fopenmp)
61 local CMAKE_USE_DIR="${CMAKE_USE_DIR}/tests"
62 local BUILD_DIR="${BUILD_DIR}/tests"
65 "${BUILD_DIR}"/tests || die