commit:     888a5176d519cbe68d1647f5af9c9180f17f2683
Author:     Adel KARA SLIMANE <adel.ks <AT> zegrapher <DOT> com>
AuthorDate: Sun Apr 10 22:37:13 2022 +0000
Commit:     Joonas Niilola <juippis <AT> gentoo <DOT> org>
CommitDate: Mon Apr 18 06:43:02 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=888a5176

media-libs/libvmaf: fix tests and add embed-models useflag

Closes: https://bugs.gentoo.org/837221
Closes: https://bugs.gentoo.org/837488
Signed-off-by: Adel KARA SLIMANE <adel.ks <AT> zegrapher.com>
Closes: https://github.com/gentoo/gentoo/pull/24982
Signed-off-by: Joonas Niilola <juippis <AT> gentoo.org>

 ...vmaf-2.3.0-r1.ebuild => libvmaf-2.3.0-r2.ebuild} | 21 +++++++++++++++++----
 media-libs/libvmaf/metadata.xml                     |  3 +++
 2 files changed, 20 insertions(+), 4 deletions(-)

diff --git a/media-libs/libvmaf/libvmaf-2.3.0-r1.ebuild 
b/media-libs/libvmaf/libvmaf-2.3.0-r2.ebuild
similarity index 66%
rename from media-libs/libvmaf/libvmaf-2.3.0-r1.ebuild
rename to media-libs/libvmaf/libvmaf-2.3.0-r2.ebuild
index d83062357877..9276f49b516c 100644
--- a/media-libs/libvmaf/libvmaf-2.3.0-r1.ebuild
+++ b/media-libs/libvmaf/libvmaf-2.3.0-r2.ebuild
@@ -20,20 +20,33 @@ fi
 
 LICENSE="BSD-2-with-patent"
 SLOT="0"
+IUSE="+embed-models test"
+
+RESTRICT="!test? ( test )"
 
 BDEPEND="
        dev-lang/nasm
-       app-editors/vim-core
+       embed-models? ( app-editors/vim-core )
 "
-# The app-editors/vim-core dep is needed to embed models within the library
-# could be made into a useflag if someones express the need for it
-# see https://github.com/Netflix/vmaf/blob/master/libvmaf/meson_options.txt#L21
 
 RDEPEND="${BDEPEND}"
 
 S="${WORKDIR}/vmaf-${PV}"
 
+src_prepare() {
+       default
+
+       # Workaround for https://bugs.gentoo.org/837221
+       # The paths in the tests are hard coded to look for the model folder as 
"../../model"
+       sed -i "s|\"../../model|\"../vmaf-${PV}/model|g" ${S}/libvmaf/test/* || 
die
+}
+
 multilib_src_configure() {
+       local emesonargs=(
+               $(meson_use embed-models built_in_models)
+               $(meson_use test enable_tests)
+       )
+
        EMESON_SOURCE="${S}/libvmaf"
        meson_src_configure
 }

diff --git a/media-libs/libvmaf/metadata.xml b/media-libs/libvmaf/metadata.xml
index 765ae6466607..01039a20cb19 100644
--- a/media-libs/libvmaf/metadata.xml
+++ b/media-libs/libvmaf/metadata.xml
@@ -16,4 +16,7 @@
                <remote-id type="github">Netflix/vmaf</remote-id>
                <bugs-to>https://github.com/Netflix/vmaf/issues</bugs-to>
        </upstream>
+       <use>
+               <flag name="embed-models">Compile default vmaf models into the 
library (needs <pkg>app-editors/vim-core</pkg>)</flag>
+       </use>
 </pkgmetadata>

Reply via email to