media-libs/kvazaar: EAPI=7, test deps, fix tests
authorCraig Andrews <candrews@gentoo.org>
Mon, 26 Nov 2018 19:16:18 +0000 (14:16 -0500)
committerCraig Andrews <candrews@gentoo.org>
Tue, 4 Dec 2018 14:07:53 +0000 (09:07 -0500)
Bug: https://bugs.gentoo.org/671146
Package-Manager: Portage-2.3.52, Repoman-2.3.12
Signed-off-by: Craig Andrews <candrews@gentoo.org>
media-libs/kvazaar/kvazaar-1.2.0-r1.ebuild [new file with mode: 0644]
media-libs/kvazaar/kvazaar-9999.ebuild

diff --git a/media-libs/kvazaar/kvazaar-1.2.0-r1.ebuild b/media-libs/kvazaar/kvazaar-1.2.0-r1.ebuild
new file mode 100644 (file)
index 0000000..b868535
--- /dev/null
@@ -0,0 +1,64 @@
+# Copyright 1999-2018 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+GREATEST_PV="1.2.1"
+
+if [[ ${PV} = *9999 ]] ; then
+       inherit git-r3
+       EGIT_REPO_URI="https://github.com/ultravideo/kvazaar"
+else
+       SRC_URI="https://github.com/ultravideo/kvazaar/archive/v${PV}.tar.gz -> ${P}.tar.gz
+               test? ( https://github.com/silentbicycle/greatest/archive/v${GREATEST_PV}.tar.gz -> greatest-${GREATEST_PV}.tar.gz )"
+       KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86"
+fi
+inherit autotools flag-o-matic multilib-minimal toolchain-funcs
+
+DESCRIPTION="Open-source HEVC encoder"
+HOMEPAGE="http://ultravideo.cs.tut.fi/ https://github.com/ultravideo/kvazaar"
+
+LICENSE="LGPL-2.1"
+# subslot = libkvazaar major
+SLOT="0/4"
+IUSE="static-libs test"
+REQUIRED_USE="test? ( static-libs )"
+
+RESTRICT="!test? ( test )"
+ASM_DEP=">=dev-lang/yasm-1.2.0"
+RDEPEND=""
+DEPEND="${RDEPEND}
+       test? (
+               media-video/ffmpeg
+       )
+       abi_x86_32? ( ${ASM_DEP} )
+       abi_x86_64? ( ${ASM_DEP} )
+"
+
+src_prepare() {
+       default
+       sed -e "/^dist_doc_DATA/s/COPYING //" -i Makefile.am || die
+       eautoreconf
+       if use test && [[ ${PV} != *9999 ]]; then
+               # https://bugs.gentoo.org/show_bug.cgi?id=595932
+               rmdir "${S}/greatest" || die
+               mv "${WORKDIR}/greatest-${GREATEST_PV}" "${S}/greatest" || die
+       fi
+       # Some m4 macros append Werror, we do not want that.
+       append-flags "-Wno-error"
+
+       # valgrind isn't available on all archs
+       # also, the valgrind tests fail with new ffmpeg (upstream only tests again ffmpeg 2.6.3)
+       # see https://github.com/ultravideo/kvazaar/issues/216
+       find "${S}/tests/" -type f -exec grep -q 'valgrind_test' '{}' \; -delete || die
+}
+
+multilib_src_configure() {
+       ECONF_SOURCE="${S}" econf \
+               --disable-werror \
+               $(use_enable static-libs static)
+}
+
+multilib_src_install_all() {
+       find "${ED}" -name '*.la' -delete || die
+}
index 48ce175d04873246279533e935d22b1a5f01d0c9..b8685352e2214d15943a2b84ccc50d12c4d2adba 100644 (file)
@@ -1,7 +1,7 @@
 # Copyright 1999-2018 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
-EAPI=6
+EAPI=7
 
 GREATEST_PV="1.2.1"
 
@@ -24,9 +24,13 @@ SLOT="0/4"
 IUSE="static-libs test"
 REQUIRED_USE="test? ( static-libs )"
 
+RESTRICT="!test? ( test )"
 ASM_DEP=">=dev-lang/yasm-1.2.0"
 RDEPEND=""
 DEPEND="${RDEPEND}
+       test? (
+               media-video/ffmpeg
+       )
        abi_x86_32? ( ${ASM_DEP} )
        abi_x86_64? ( ${ASM_DEP} )
 "
@@ -42,6 +46,11 @@ src_prepare() {
        fi
        # Some m4 macros append Werror, we do not want that.
        append-flags "-Wno-error"
+
+       # valgrind isn't available on all archs
+       # also, the valgrind tests fail with new ffmpeg (upstream only tests again ffmpeg 2.6.3)
+       # see https://github.com/ultravideo/kvazaar/issues/216
+       find "${S}/tests/" -type f -exec grep -q 'valgrind_test' '{}' \; -delete || die
 }
 
 multilib_src_configure() {