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