aboutsummaryrefslogtreecommitdiff
blob: 69231b7d0d87e454db91e5317978462b9533c2e5 (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
102
103
104
105
# Copyright 2020-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

PYTHON_COMPAT=( python3_{10..11} ) #pypy3 has warnings

inherit distutils-r1 perl-module

DESCRIPTION="User space software for Intel(R) Resource Director Technology"
HOMEPAGE="
	https://www.intel.com/content/www/us/en/architecture-and-technology/resource-director-technology.html
	https://github.com/intel/intel-cmt-cat
"
SRC_URI="https://github.com/intel/intel-cmt-cat/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz"

LICENSE="BSD"
SLOT="0"
IUSE="perl"

RDEPEND="perl? ( dev-lang/perl:= )"

PATCHES=(
	"${FILESDIR}/${P}-perl-makefile.patch"
	"${FILESDIR}/${P}-no-strip.patch"
	"${FILESDIR}/${PN}-4.3.0-respect-flags.patch"
)

distutils_enable_tests unittest

src_prepare() {
	mkdir -p "${T}/prefix" || die

	distutils-r1_python_prepare_all
}

src_compile() {
	emake all PREFIX="${T}/prefix"

	pushd "lib/python" || die
	python_foreach_impl distutils-r1_python_compile
	popd || die

	if use perl; then
		pushd "lib/perl" || die
		perl-module_src_configure
		perl-module_src_compile
		popd || die
	fi
}

src_install() {
	emake install PREFIX="${T}/prefix"

	dobin "${T}"/prefix/bin/*
	doheader "${T}"/prefix/include/*
	doman "${T}"/prefix/man/man*/*
	dolib.so "${T}"/prefix/lib/*

	dobin tools/membw/membw
	dobin snmp/rdt-agentx.pl

	dodoc ChangeLog README.md
	docinto membw
	dodoc tools/membw/README
	docinto pqos
	dodoc -r pqos/README pqos/configs
	docinto lib
	dodoc lib/README
	docinto lib/python
	dodoc lib/python/README.md
	docinto snmp
	dodoc snmp/README
	docinto rdtset
	dodoc rdtset/README

	unset DOCS
	python_foreach_impl python_install

	if use perl; then
		pushd "lib/perl" || die
		unset DOCS
		myinst=( DESTDIR="${D}" )
		perl-module_src_install
		popd || die
		docinto lib/perl
		dodoc lib/perl/README
	fi
}

src_test() {
	LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${S}/lib" python_foreach_impl python_test
}

python_install() {
	pushd "lib/python" || die
	distutils-r1_python_install
	popd || die
}

python_test() {
	pushd "lib/python" || die
	eunittest
	popd || die
}