summaryrefslogtreecommitdiff
blob: 754906da94695539ea628c21b6b4502958a07f72 (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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8
PYTHON_COMPAT=( python3_{7..10} )

inherit autotools multiprocessing python-r1

DESCRIPTION="Satyr is a collection of low-level algorithms for program failure processing"
HOMEPAGE="https://github.com/abrt/satyr"
SRC_URI="https://github.com/abrt/${PN}/archive/${PV}/${P}.tar.gz"

LICENSE="GPL-2+"
SLOT="0/4"

IUSE="python"
REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"

KEYWORDS="~amd64 ~x86"

RDEPEND="
	python? ( ${PYTHON_DEPS} )
	>=dev-libs/elfutils-0.158
	dev-libs/glib:2
	dev-libs/json-c:=
	dev-libs/nettle:=
"
DEPEND="${RDEPEND}"
BDEPEND="
	virtual/pkgconfig
	dev-util/gperf
"

src_prepare() {
	default
	./gen-version || die # Needs to be run before full autoreconf
	eautoreconf
	use python && python_copy_sources
}

src_configure() {
	use python && python_setup

	local myargs=(
		--localstatedir="${EPREFIX}/var"
		--without-rpm
		$(usex python "--with-python3" "--without-python3")
	)

	if use python; then
		python_configure() {
			econf "${myargs[@]}"
		}
		python_foreach_impl run_in_build_dir python_configure
	else
		econf "${myargs[@]}"
	fi
}

src_compile() {
	if use python; then
		python_foreach_impl run_in_build_dir default
	else
		default
	fi

}

src_test() {
	local extra_args

	# In order to pass --jobs to the test runner
	run_tests() {
		cd tests || die
		emake testsuite
		./testsuite --jobs=$(makeopts_jobs) ${extra_args[@]} $@

		# Only run the python bindings tests for other python impls
		extra_args=('-k' 'python3_bindings.*')
	}

	if use python; then
		python_foreach_impl run_in_build_dir run_tests
	else
		run_tests SKIP_PYTHON3=yes
	fi
}

src_install() {
	if use python; then
		python_install() {
			default
			python_optimize
		}
		python_foreach_impl run_in_build_dir python_install
	else
		default
	fi

	find "${D}" -name '*.la' -type f -delete || die
}