-# 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
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
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
+}