app-admin/awscli: Bump to 1.37.9
[gentoo/gentoo.git] / media-libs / vidstab / vidstab-1.1.1-r1.ebuild
blobc8203cc91f9dbc1846da1f7e4316db66543a3a55
1 # Copyright 2018-2024 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
4 EAPI=8
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"
13         inherit git-r3
14 else
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}"
20 LICENSE="GPL-2+"
21 SLOT="0"
22 IUSE="openmp cpu_flags_x86_sse2 test"
24 RESTRICT="!test? ( test )"
25 DEPEND="test? ( dev-lang/orc )"
27 pkg_pretend() {
28         [[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
31 pkg_setup() {
32         [[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
35 src_prepare() {
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
39         # strip some CFLAGS
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
43         done
44         cmake_src_prepare
47 src_configure() {
48         local mycmakeargs=(
49                 -DUSE_OMP="$(usex openmp)"
50                 -DSSE2_FOUND="$(usex cpu_flags_x86_sse2)"
51         )
52         cmake-multilib_src_configure
55 multilib_src_test() {
56         local mycmakeargs=(
57                 -DUSE_OMP="$(usex openmp)"
58                 -DSSE2_FOUND="$(usex cpu_flags_x86_sse2)"
59         )
60         append-cflags $(test-flags-CC -fopenmp)
61         local CMAKE_USE_DIR="${CMAKE_USE_DIR}/tests"
62         local BUILD_DIR="${BUILD_DIR}/tests"
63         cmake_src_configure
64         cmake_build
65         "${BUILD_DIR}"/tests || die