blob: a13cb191165cd8819b8bb3cfe6ab87aaf6c13f70 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
|
# Copyright 2017-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
CRATES=""
inherit cargo
if [[ ${PV} == *9999 ]] ; then
EGIT_REPO_URI="https://github.com/xiph/rav1e.git"
inherit git-r3
else
SRC_URI="https://github.com/xiph/rav1e/archive/v${PV}.tar.gz -> ${P}.tar.gz
$(cargo_crate_uris ${CRATES})"
KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~riscv ~x86"
fi
DESCRIPTION="The fastest and safest AV1 encoder"
HOMEPAGE="https://github.com/xiph/rav1e/"
LICENSE="0BSD Apache-2.0 Apache-2.0-with-LLVM-exceptions BSD BSD-2 Boost-1.0 ISC MIT UoI-NCSA Unlicense ZLIB"
SLOT="0"
IUSE="+capi"
ASM_DEP=">=dev-lang/nasm-2.15"
BDEPEND="
amd64? ( ${ASM_DEP} )
capi? ( dev-util/cargo-c )
"
# Rust
QA_FLAGS_IGNORED="usr/lib.*/librav1e.* usr/bin/rav1e"
src_unpack() {
if [[ ${PV} == *9999* ]]; then
git-r3_src_unpack
cargo_live_src_unpack
else
default
cargo_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} --target-dir="capi" \
--prefix="/usr" --libdir="/usr/$(get_libdir)" \
--library-type=cdylib \
|| die "cargo cbuild failed"
fi
}
src_install() {
export CARGO_HOME="${ECARGO_HOME}"
local args=$(usex debug --debug "")
if use capi; then
cargo cinstall $args --target-dir="capi" \
--prefix="/usr" --libdir="/usr/$(get_libdir)" --destdir="${ED}" \
--library-type=cdylib \
|| die "cargo cinstall failed"
fi
cargo_src_install
}
|