Gentoo Archives: gentoo-commits

From: Guilherme Amadio <amadio@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-util/perf/
Date: Fri, 22 May 2020 13:06:46
Message-Id: 1590152784.53994cf6c4350f80c96125897ce8049d0294295a.amadio@gentoo
1 commit: 53994cf6c4350f80c96125897ce8049d0294295a
2 Author: Guilherme Amadio <amadio <AT> gentoo <DOT> org>
3 AuthorDate: Fri May 22 09:57:30 2020 +0000
4 Commit: Guilherme Amadio <amadio <AT> gentoo <DOT> org>
5 CommitDate: Fri May 22 13:06:24 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=53994cf6
7
8 dev-util/perf: version bump
9
10 Package-Manager: Portage-2.3.99, Repoman-2.3.22
11 Signed-off-by: Guilherme Amadio <amadio <AT> gentoo.org>
12
13 dev-util/perf/Manifest | 1 +
14 dev-util/perf/perf-5.6.14.ebuild | 236 +++++++++++++++++++++++++++++++++++++++
15 2 files changed, 237 insertions(+)
16
17 diff --git a/dev-util/perf/Manifest b/dev-util/perf/Manifest
18 index c76bed7cba7..80a0a902057 100644
19 --- a/dev-util/perf/Manifest
20 +++ b/dev-util/perf/Manifest
21 @@ -5,4 +5,5 @@ DIST linux-5.6.tar.xz 111785252 BLAKE2B 8dbe02a8ca7fd3dcf512a15c5d8098c1e7f94257
22 DIST patch-4.14.33.xz 905284 BLAKE2B e67bd9a96708aaaf65eb0aa852493b2323c9e237bfcc6fa837f795e481943ead3e2d5005ee72e40fc247df01c50877d9da3848a05aba3c999c3cfb7678cbdbc9 SHA512 5c76be5171709c2df7df7d5a8e8f3d0f7ede47b433da3b0f1710f262c8fcf5cf6c744a96d4336ea397c2c88a5f0a7507a5ab08c7c82f08deeb7a6f887ad77cfd
23 DIST patch-4.20.3.xz 91732 BLAKE2B bf99271bcb35508df239343fd6c9d57c246f88320b586e44e2d97771d08b249a24db230214d4957015a5ed35261e201f0680101b99d0e92f0f1f69bc53e21458 SHA512 47178b8e3bfe4ba09cb82bb1ce8b0742e6749d4be3412fb57518918f7109e74eac1d3d8eb32a43e21b3837a14f37d5eefd8cab819defd10cc2db61fb0ceddeaf
24 DIST patch-5.4.20.xz 776552 BLAKE2B bad2a95ed8521ac5c379fe91e16d60b2a38de19b9239755084621e5230677b232ec4cf9e2e8161c0022daff43fdbb37d5b5b5bfdc9e932ef3a860bcd17f640f8 SHA512 65fbcdbd41e35c17601ff15bbe33933be2ab7a694aa181a0b802cc11c1c653c9b688dbb382076cbad05983a0c07467955c035ae25f5175f7ce5bc24339303d77
25 +DIST patch-5.6.14.xz 376464 BLAKE2B 01b64288759faa67aedfded7dfca5d8d1e894a863bf7bcaf91dd8f23c8b8c9df51d2e54ac5e414a33fc3469b32c10f1d630cf2636206b8e159d602df40ad3048 SHA512 8019bf12993f43d5508845a48b250d30220a8db6db262c8b97cd3f7c73abf0d054fcdfacb671644de529ceb495b95982d693a889051fb60fafc3180bd5b4f29e
26 DIST patch-5.6.4.xz 34744 BLAKE2B 856148010fefa7e45903da23a054429f924920f1fd331b725d00906baaf6a05fee769c5c780ae6548b4f02846f945b12012c1216411c8d92aef7499babc42528 SHA512 05607a47ee72af4a7b4d8424a3995d92d0cf358902459993908df0e95643cbfa9eec7ed56779d254b7b75ec1c8dbec5eea5e2e845f40f5511533d53b90b1c02e
27
28 diff --git a/dev-util/perf/perf-5.6.14.ebuild b/dev-util/perf/perf-5.6.14.ebuild
29 new file mode 100644
30 index 00000000000..afc8951d08d
31 --- /dev/null
32 +++ b/dev-util/perf/perf-5.6.14.ebuild
33 @@ -0,0 +1,236 @@
34 +# Copyright 1999-2020 Gentoo Authors
35 +# Distributed under the terms of the GNU General Public License v2
36 +
37 +EAPI=7
38 +
39 +PYTHON_COMPAT=( python3_{6,7,8} )
40 +inherit bash-completion-r1 estack eutils llvm toolchain-funcs prefix python-r1 linux-info
41 +
42 +MY_PV="${PV/_/-}"
43 +MY_PV="${MY_PV/-pre/-git}"
44 +
45 +DESCRIPTION="Userland tools for Linux Performance Counters"
46 +HOMEPAGE="https://perf.wiki.kernel.org/"
47 +
48 +LINUX_V="${PV:0:1}.x"
49 +if [[ ${PV} == *_rc* ]] ; then
50 + LINUX_VER=$(ver_cut 1-2).$(($(ver_cut 3)-1))
51 + PATCH_VERSION=$(ver_cut 1-3)
52 + LINUX_PATCH=patch-${PV//_/-}.xz
53 + SRC_URI="https://www.kernel.org/pub/linux/kernel/v${LINUX_V}/testing/${LINUX_PATCH}
54 + https://www.kernel.org/pub/linux/kernel/v${LINUX_V}/testing/v${PATCH_VERSION}/${LINUX_PATCH}"
55 +elif [[ ${PV} == *.*.* ]] ; then
56 + # stable-release series
57 + LINUX_VER=$(ver_cut 1-2)
58 + LINUX_PATCH=patch-${PV}.xz
59 + SRC_URI="https://www.kernel.org/pub/linux/kernel/v${LINUX_V}/${LINUX_PATCH}"
60 +else
61 + LINUX_VER=${PV}
62 + SRC_URI=""
63 +fi
64 +
65 +LINUX_SOURCES="linux-${LINUX_VER}.tar.xz"
66 +SRC_URI+=" https://www.kernel.org/pub/linux/kernel/v${LINUX_V}/${LINUX_SOURCES}"
67 +
68 +LICENSE="GPL-2"
69 +SLOT="0"
70 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~mips ~ppc ~ppc64 ~x86 ~amd64-linux ~x86-linux"
71 +IUSE="audit clang crypt debug +demangle +doc gtk java lzma numa perl python slang systemtap unwind zlib"
72 +# TODO babeltrace
73 +REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
74 +
75 +RDEPEND="audit? ( sys-process/audit )
76 + crypt? ( dev-libs/openssl:0= )
77 + clang? (
78 + <sys-devel/clang-10:*
79 + <sys-devel/llvm-10:*
80 + )
81 + demangle? ( sys-libs/binutils-libs:= )
82 + gtk? ( x11-libs/gtk+:2 )
83 + java? ( virtual/jre:* )
84 + lzma? ( app-arch/xz-utils )
85 + numa? ( sys-process/numactl )
86 + perl? ( dev-lang/perl:= )
87 + python? ( ${PYTHON_DEPS} )
88 + slang? ( sys-libs/slang )
89 + systemtap? ( dev-util/systemtap )
90 + unwind? ( sys-libs/libunwind )
91 + zlib? ( sys-libs/zlib )
92 + dev-libs/elfutils"
93 +DEPEND="${RDEPEND}
94 + >=sys-kernel/linux-headers-4.19
95 + ${LINUX_PATCH+dev-util/patchutils}
96 + sys-devel/bison
97 + sys-devel/flex
98 + java? ( virtual/jdk )
99 + doc? (
100 + app-text/asciidoc
101 + app-text/sgml-common
102 + app-text/xmlto
103 + sys-process/time
104 + )"
105 +
106 +S_K="${WORKDIR}/linux-${LINUX_VER}"
107 +S="${S_K}/tools/perf"
108 +
109 +CONFIG_CHECK="~PERF_EVENTS ~KALLSYMS"
110 +
111 +pkg_setup() {
112 + use clang && LLVM_MAX_SLOT=9 llvm_pkg_setup
113 +}
114 +
115 +src_unpack() {
116 + local paths=(
117 + tools/arch tools/build tools/include tools/lib tools/perf tools/scripts
118 + scripts include lib "arch/*/lib"
119 + )
120 +
121 + # We expect the tar implementation to support the -j option (both
122 + # GNU tar and libarchive's tar support that).
123 + echo ">>> Unpacking ${LINUX_SOURCES} (${paths[*]}) to ${PWD}"
124 + tar --wildcards -xpf "${DISTDIR}"/${LINUX_SOURCES} \
125 + "${paths[@]/#/linux-${LINUX_VER}/}" || die
126 +
127 + if [[ -n ${LINUX_PATCH} ]] ; then
128 + eshopts_push -o noglob
129 + ebegin "Filtering partial source patch"
130 + filterdiff -p1 ${paths[@]/#/-i } -z "${DISTDIR}"/${LINUX_PATCH} \
131 + > ${P}.patch
132 + eend $? || die "filterdiff failed"
133 + eshopts_pop
134 + fi
135 +
136 + local a
137 + for a in ${A}; do
138 + [[ ${a} == ${LINUX_SOURCES} ]] && continue
139 + [[ ${a} == ${LINUX_PATCH} ]] && continue
140 + unpack ${a}
141 + done
142 +}
143 +
144 +src_prepare() {
145 + default
146 + if [[ -n ${LINUX_PATCH} ]] ; then
147 + pushd "${S_K}" >/dev/null || die
148 + eapply "${WORKDIR}"/${P}.patch
149 + popd || die
150 + fi
151 +
152 + # Drop some upstream too-developer-oriented flags and fix the
153 + # Makefile in general
154 + sed -i \
155 + -e "s:\$(sysconfdir_SQ)/bash_completion.d:$(get_bashcompdir):" \
156 + "${S}"/Makefile.perf || die
157 + # A few places still use -Werror w/out $(WERROR) protection.
158 + sed -i -e 's:-Werror::' \
159 + "${S}"/Makefile.perf "${S_K}"/tools/lib/bpf/Makefile || die
160 +
161 + # Avoid the call to make kernelversion
162 + echo "#define PERF_VERSION \"${MY_PV}\"" > PERF-VERSION-FILE
163 +
164 + # The code likes to compile local assembly files which lack ELF markings.
165 + find -name '*.S' -exec sed -i '$a.section .note.GNU-stack,"",%progbits' {} +
166 +
167 + # Fix shebang to use python from prefix
168 + if [[ -n "${EPREFIX}" ]]; then
169 + hprefixify ${S_K}/scripts/bpf_helpers_doc.py
170 + fi
171 +}
172 +
173 +puse() { usex $1 "" no; }
174 +perf_make() {
175 + # The arch parsing is a bit funky. The perf tools package is integrated
176 + # into the kernel, so it wants an ARCH that looks like the kernel arch,
177 + # but it also wants to know about the split value -- i386/x86_64 vs just
178 + # x86. We can get that by telling the func to use an older linux version.
179 + # It's kind of a hack, but not that bad ...
180 +
181 + # LIBDIR sets a search path of perf-gtk.so. Bug 515954
182 +
183 + local arch=$(tc-arch-kernel)
184 + local java_dir
185 + use java && java_dir="/etc/java-config-2/current-system-vm"
186 + # FIXME: NO_CORESIGHT
187 + # FIXME: NO_LIBBABELTRACE
188 + emake V=1 VF=1 \
189 + CC="$(tc-getCC)" CXX="$(tc-getCXX)" AR="$(tc-getAR)" LD="$(tc-getLD)" \
190 + PKG_CONFIG="$(tc-getPKG_CONFIG)" \
191 + prefix="${EPREFIX}/usr" bindir_relative="bin" \
192 + EXTRA_CFLAGS="${CFLAGS}" \
193 + ARCH="${arch}" \
194 + JDIR="${java_dir}" \
195 + LIBCLANGLLVM=$(usex clang 1 "") \
196 + NO_AUXTRACE="" \
197 + NO_BACKTRACE="" \
198 + NO_CORESIGHT=1 \
199 + NO_DEMANGLE=$(puse demangle) \
200 + NO_GTK2=$(puse gtk) \
201 + NO_JVMTI=$(puse java) \
202 + NO_LIBAUDIT=$(puse audit) \
203 + NO_LIBBABELTRACE=1 \
204 + NO_LIBBIONIC=1 \
205 + NO_LIBBPF="" \
206 + NO_LIBCRYPTO=$(puse crypt) \
207 + NO_LIBDW_DWARF_UNWIND="" \
208 + NO_LIBELF="" \
209 + NO_LIBNUMA=$(puse numa) \
210 + NO_LIBPERL=$(puse perl) \
211 + NO_LIBPYTHON=$(puse python) \
212 + NO_LIBUNWIND=$(puse unwind) \
213 + NO_SDT=$(puse systemtap) \
214 + NO_SLANG=$(puse slang) \
215 + NO_LZMA=$(puse lzma) \
216 + NO_ZLIB= \
217 + WERROR=0 \
218 + LIBDIR="/usr/libexec/perf-core" \
219 + "$@"
220 +}
221 +
222 +src_compile() {
223 + # test-clang.bin not build with g++
224 + if use clang; then
225 + pushd "${S_K}/tools/build/feature/" || die
226 + make V=1 CXX=${CHOST}-clang++ test-clang.bin || die
227 + popd
228 + fi
229 + perf_make -f Makefile.perf
230 + use doc && perf_make -C Documentation
231 +}
232 +
233 +src_test() {
234 + :
235 +}
236 +
237 +src_install() {
238 + _install_python_ext() {
239 + perf_make -f Makefile.perf install-python_ext DESTDIR="${D}"
240 + }
241 +
242 + perf_make -f Makefile.perf install DESTDIR="${D}"
243 + if use python; then
244 + python_foreach_impl _install_python_ext
245 + fi
246 +
247 + rm -rv "${ED}"/usr/share/doc/perf-tip || die
248 +
249 + if use gtk; then
250 + mv "${ED}"/usr/$(get_libdir)/libperf-gtk.so \
251 + "${ED}"/usr/libexec/perf-core || die
252 + fi
253 +
254 + dodoc CREDITS
255 +
256 + dodoc *txt Documentation/*.txt
257 + if use doc ; then
258 + HTML_DOCS="Documentation/*.html" einstalldocs
259 + doman Documentation/*.1
260 + fi
261 +}
262 +
263 +pkg_postinst() {
264 + if ! use doc ; then
265 + elog "Without the doc USE flag you won't get any documentation nor man pages."
266 + elog "And without man pages, you won't get any --help output for perf and its"
267 + elog "sub-tools."
268 + fi
269 +}