From 9eb1fe1c84a4da20a6147a16ef5dfca27b2364ef Mon Sep 17 00:00:00 2001 From: Luca Barbato Date: Mon, 6 Apr 2020 15:01:39 +0200 Subject: [PATCH] media-video/rav1e: Add support for the C-API Package-Manager: Portage-2.3.96, Repoman-2.3.22 Signed-off-by: Luca Barbato --- media-video/rav1e/metadata.xml | 3 +++ media-video/rav1e/rav1e-9999.ebuild | 35 ++++++++++++++++++++++++----- 2 files changed, 33 insertions(+), 5 deletions(-) diff --git a/media-video/rav1e/metadata.xml b/media-video/rav1e/metadata.xml index 71e948fffb95..8d7337c607f9 100644 --- a/media-video/rav1e/metadata.xml +++ b/media-video/rav1e/metadata.xml @@ -4,4 +4,7 @@ lu_zero@gentoo.org + + Build the C-API library and header file + diff --git a/media-video/rav1e/rav1e-9999.ebuild b/media-video/rav1e/rav1e-9999.ebuild index 131796f9e62c..3865291f3bed 100644 --- a/media-video/rav1e/rav1e-9999.ebuild +++ b/media-video/rav1e/rav1e-9999.ebuild @@ -1,8 +1,6 @@ -# Copyright 2017-2019 Gentoo Authors +# Copyright 2017-2020 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 -# Auto-Generated by cargo-ebuild 0.2.0 - EAPI=7 inherit cargo @@ -20,11 +18,11 @@ LICENSE="BSD-2" SLOT="0" KEYWORDS="" -IUSE="" +IUSE="+capi" ASM_DEP=">=dev-lang/nasm-2.14" DEPEND="amd64? ( ${ASM_DEP} )" -RDEPEND="" +RDEPEND="capi? ( dev-util/cargo-c )" src_unpack() { if [[ "${PV}" == *9999* ]]; then @@ -32,3 +30,30 @@ src_unpack() { cargo_live_src_unpack fi } + +src_compile() { + export CARGO_HOME="${ECARGO_HOME}" + local args=$(usex debug "" --release) + + cargo build ${args} \ + || die "cargo build failed" + + if use capi; then + cargo cbuild ${args} \ + --prefix="/usr" --libdir="/usr/$(get_libdir)" --destdir="${ED}" \ + || die "cargo cbuild failed" + fi +} + +src_install() { + export CARGO_HOME="${ECARGO_HOME}" + local args=$(usex debug "" --release) + + if use capi; then + cargo cinstall $args \ + --prefix="/usr" --libdir="/usr/$(get_libdir)" --destdir="${ED}" \ + || die "cargo cinstall failed" + fi + + cargo_src_install +} -- 2.26.2