summaryrefslogtreecommitdiff
blob: 48d3c3892ed1bfce1c637748e7cca66d8a8d77e5 (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 2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

DISTUTILS_EXT=1
DISTUTILS_USE_PEP517=setuptools
PYTHON_COMPAT=( python3_{10..13} )

inherit autotools distutils-r1 multiprocessing pypi toolchain-funcs

DESCRIPTION="Programmable debugger"
HOMEPAGE="
	https://github.com/osandov/drgn
	https://pypi.org/project/drgn/
	https://drgn.readthedocs.io/en/latest/
"

LICENSE="LGPL-2.1+"
SLOT="0"
KEYWORDS="~amd64"
IUSE="openmp"

DEPEND="
	>=dev-libs/elfutils-0.165
	dev-libs/libkdumpfile
"
RDEPEND="${DEPEND}"
BDEPEND="
	virtual/pkgconfig
	test? ( dev-libs/check )
"

PATCHES=(
	"${FILESDIR}"/${PN}-0.0.27-bashism.patch
)

distutils_enable_tests unittest

pkg_pretend() {
	[[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
}

pkg_setup() {
	[[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
}

src_prepare() {
	distutils-r1_src_prepare

	cd libdrgn || die
	eautoreconf
}

src_configure() {
	tc-export AR CC OBJCOPY OBJDUMP PKG_CONFIG RANLIB STRIP

	cat >> setup.cfg <<-EOF || die
	[build_ext]
	parallel = $(makeopts_jobs)
	EOF

	# setuptools calls autotools (!)
	export CONFIGURE_FLAGS
	CONFIGURE_FLAGS="--disable-dependency-tracking --disable-silent-rules"
	CONFIGURE_FLAGS+=" --with-libkdumpfile"
	CONFIGURE_FLAGS+=" $(use_enable openmp)"
	CONFIGURE_FLAGS+=" --build=${CBUILD}"
	CONFIGURE_FLAGS+=" --host=${CHOST}"
	CONFIGURE_FLAGS+=" --target=${CTARGET}"
	distutils-r1_src_configure
}