| # Copyright 2022 The Chromium OS Authors. All rights reserved. |
| # Distributed under the terms of the GNU General Public License v2 |
| |
| EAPI="7" |
| |
| CROS_RUST_REMOVE_DEV_DEPS=1 |
| |
| inherit cros-rust |
| |
| DESCRIPTION='C API for the "rustc-demangle" crate' |
| HOMEPAGE='https://crates.io/crates/rustc-demangle-capi' |
| SRC_URI="https://crates.io/api/v1/crates/${PN}/${PV}/download -> ${P}.crate" |
| |
| LICENSE="|| ( MIT Apache-2.0 )" |
| SLOT="0/${PVR}" |
| KEYWORDS="*" |
| |
| DEPEND=" |
| >=dev-rust/rustc-demangle-0.1.16 <dev-rust/rustc-demangle-0.2.0_alpha:= |
| " |
| RDEPEND="${DEPEND}" |
| |
| # This file was automatically generated by cargo2ebuild.py, with modifications |
| # in src_compile and src_install. |
| # |
| # This adds the capi rustc-demangle crate. While it was generated by |
| # cargo2ebuild, this crate exists solely to give us C headers + a C-compatible |
| # static library to work with, so we need to have custom src_install/src_compile |
| # bits here. |
| |
| src_compile() { |
| # Force the build, since we don't want to install the sources for this. |
| # Only the C-related artifacts are relevant. |
| ecargo_build |
| } |
| |
| src_install() { |
| local build_dir="$(cros-rust_get_build_dir)" |
| dolib.a "${build_dir}/librustc_demangle.a" |
| doheader "${S}/include/rustc_demangle.h" |
| } |