blob: 5aa8a7320448652959ff2a55b5e9f284aac80b8e (
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
73
74
75
76
77
78
79
80
81
82
83
|
# Copyright 2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# Autogenerated by pycargoebuild 0.14.0
EAPI=8
CRATES="
"
declare -A GIT_CRATES=(
[criterion-plot]='https://github.com/bheisler/criterion.rs;b913e232edd98780961ecfbae836ec77ede49259;criterion.rs-%commit%/plot'
[criterion]='https://github.com/bheisler/criterion.rs;b913e232edd98780961ecfbae836ec77ede49259;criterion.rs-%commit%'
[vmlinux]='https://github.com/libbpf/vmlinux.h;a9c092aa771310bf8b00b5018f7d40a1fdb6ec82;vmlinux.h-%commit%'
)
inherit cargo edo rust-toolchain
DESCRIPTION="C bindings for blazesym, a library for address symbolization and related tasks"
HOMEPAGE="https://github.com/libbpf/blazesym"
SRC_URI="
https://github.com/libbpf/blazesym/archive/refs/tags/capi-v${PV}.tar.gz -> ${P}.tar.gz
https://github.com/gentoo-crate-dist/blazesym/releases/download/capi-v${PV}/blazesym-capi-v${PV}-crates.tar.xz
${CARGO_CRATE_URIS}
"
# build in the capi subdirectory since cargo has no -C option:
# https://github.com/rust-lang/cargo/issues/10098
S="${WORKDIR}/blazesym-capi-v${PV}/capi"
LICENSE="BSD"
# Dependent crate licenses
LICENSE+="
Apache-2.0 Apache-2.0-with-LLVM-exceptions BSD-2 BSD Boost-1.0 ISC
MIT MPL-2.0 Unicode-3.0
"
SLOT="0"
KEYWORDS="amd64 ~arm64"
# Currently suffers from (at least):
# - problems with crate tarball
# - hardcoded/hand-rolled multilib assumptions
# - possibly sandbox
RESTRICT="test"
BDEPEND="
dev-util/cargo-c
"
QA_FLAGS_IGNORED="usr/lib64/libblazesym_c.so.${PV}"
src_prepare() {
default
# make blazesym aware of cargo-c
# https://github.com/libbpf/blazesym/pull/1098 (merged)
eapply -p2 "${FILESDIR}/0.1.1-add-capi-feature-to-enable-building-with-cargo-c.patch"
}
src_configure() {
CARGO_ARGS=(
--library-type=cdylib
--prefix="${EPREFIX}"/usr
--libdir="${EPREFIX}/usr/$(get_libdir)"
--target="$(rust_abi)"
$(usev !debug '--release')
)
cargo_src_configure
}
src_compile() {
edo cargo cbuild "${CARGO_ARGS[@]}" || die
}
src_install() {
CARGO_ARGS+=(
--destdir="${ED}"
)
edo cargo cinstall "${CARGO_ARGS[@]}" || die
}
|