Gentoo Archives: gentoo-commits

From: "Robin H. Johnson (robbat2)" <robbat2@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in dev-util/perf: ChangeLog perf-3.1.ebuild
Date: Tue, 01 Nov 2011 07:33:22
Message-Id: 20111101073312.7AB2E2004B@flycatcher.gentoo.org
1 robbat2 11/11/01 07:33:12
2
3 Modified: ChangeLog
4 Added: perf-3.1.ebuild
5 Log:
6 Version bump. Improve install phase. Fix automagic dependency on dev-libs/newt and python. Install python+perl tools. Ensure DWARF is built on amd64.
7
8 (Portage version: 2.2.0_alpha70/cvs/Linux x86_64)
9
10 Revision Changes Path
11 1.18 dev-util/perf/ChangeLog
12
13 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-util/perf/ChangeLog?rev=1.18&view=markup
14 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-util/perf/ChangeLog?rev=1.18&content-type=text/plain
15 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-util/perf/ChangeLog?r1=1.17&r2=1.18
16
17 Index: ChangeLog
18 ===================================================================
19 RCS file: /var/cvsroot/gentoo-x86/dev-util/perf/ChangeLog,v
20 retrieving revision 1.17
21 retrieving revision 1.18
22 diff -p -w -b -B -u -u -r1.17 -r1.18
23 --- ChangeLog 11 Jul 2010 20:57:52 -0000 1.17
24 +++ ChangeLog 1 Nov 2011 07:33:12 -0000 1.18
25 @@ -1,6 +1,13 @@
26 # ChangeLog for dev-util/perf
27 -# Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2
28 -# $Header: /var/cvsroot/gentoo-x86/dev-util/perf/ChangeLog,v 1.17 2010/07/11 20:57:52 flameeyes Exp $
29 +# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
30 +# $Header: /var/cvsroot/gentoo-x86/dev-util/perf/ChangeLog,v 1.18 2011/11/01 07:33:12 robbat2 Exp $
31 +
32 +*perf-3.1 (01 Nov 2011)
33 +
34 + 01 Nov 2011; Robin H. Johnson <robbat2@g.o> +perf-3.1.ebuild:
35 + Version bump. Improve install phase. Fix automagic dependency on
36 + dev-libs/newt and python. Install python+perl tools. Ensure DWARF is built on
37 + amd64.
38
39 *perf-2.6.35_rc4 (11 Jul 2010)
40
41
42
43
44 1.1 dev-util/perf/perf-3.1.ebuild
45
46 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-util/perf/perf-3.1.ebuild?rev=1.1&view=markup
47 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-util/perf/perf-3.1.ebuild?rev=1.1&content-type=text/plain
48
49 Index: perf-3.1.ebuild
50 ===================================================================
51 # Copyright 1999-2011 Gentoo Foundation
52 # Distributed under the terms of the GNU General Public License v2
53 # $Header: /var/cvsroot/gentoo-x86/dev-util/perf/perf-3.1.ebuild,v 1.1 2011/11/01 07:33:12 robbat2 Exp $
54
55 EAPI=4
56
57 PYTHON_DEPEND="python? 2"
58 inherit versionator eutils toolchain-funcs python linux-info
59
60 MY_PV="${PV/_/-}"
61 MY_PV="${MY_PV/-pre/-git}"
62
63 DESCRIPTION="Userland tools for Linux Performance Counters"
64 HOMEPAGE="http://perf.wiki.kernel.org/"
65
66 LINUX_V=$(get_version_component_range 1-2)
67
68 if [ ${PV/_rc} != ${PV} ]; then
69 LINUX_VER=$(get_version_component_range 1-2).$(($(get_version_component_range 3)-1))
70 PATCH_VERSION=$(get_version_component_range 1-3)
71 LINUX_PATCH=patch-${PV//_/-}.bz2
72 SRC_URI="mirror://kernel/linux/kernel/v${LINUX_V}/testing/${LINUX_PATCH}
73 mirror://kernel/linux/kernel/v${LINUX_V}/testing/v${PATCH_VERSION}/${LINUX_PATCH}"
74 elif [ $(get_version_component_count) == 4 ]; then
75 # stable-release series
76 LINUX_VER=$(get_version_component_range 1-3)
77 LINUX_PATCH=patch-${PV}.bz2
78 SRC_URI="mirror://kernel/linux/kernel/v${LINUX_V}/${LINUX_PATCH}"
79 else
80 LINUX_VER=${PV}
81 fi
82
83 LINUX_SOURCES=linux-${LINUX_VER}.tar.bz2
84 SRC_URI="${SRC_URI} mirror://kernel/linux/kernel/v${LINUX_V}/${LINUX_SOURCES}"
85
86 LICENSE="GPL-2"
87 SLOT="0"
88 KEYWORDS="~amd64 ~x86 ~ppc"
89 IUSE="+demangle +doc perl python ncurses"
90
91 RDEPEND="demangle? ( sys-devel/binutils )
92 perl? ( || ( >=dev-lang/perl-5.10 sys-devel/libperl ) )
93 ncurses? ( dev-libs/newt )
94 dev-libs/elfutils"
95 DEPEND="${RDEPEND}
96 ${LINUX_PATCH+dev-util/patchutils}
97 doc? ( app-text/asciidoc app-text/xmlto )"
98
99 S_K="${WORKDIR}/linux-${LINUX_VER}"
100 S="${S_K}/tools/perf"
101
102 CONFIG_CHECK="~PERF_EVENTS ~KALLSYMS"
103
104 pkg_setup() {
105 use python && python_set_active_version 2
106 }
107
108 src_unpack() {
109 local _tarpattern=
110 local _filterdiff=
111 for _pattern in {tools/perf,include,lib,"arch/*/include"}; do
112 _tarpattern="${_tarpattern} linux-${LINUX_VER}/${_pattern}"
113 _filterdiff="${_filterdiff} -i ${_pattern}/*"
114 done
115
116 # We expect the tar implementation to support the -j option (both
117 # GNU tar and libarchive's tar support that).
118 ebegin "Unpacking partial source tarball"
119 tar --wildcards -xpf "${DISTDIR}"/${LINUX_SOURCES} ${_tarpattern}
120 eend $? || die "tar failed"
121
122 if [[ -n ${LINUX_PATCH} ]]; then
123 ebegin "Filtering partial source patch"
124 filterdiff -p1 ${_filterdiff} -z "${DISTDIR}"/${LINUX_PATCH} > ${P}.patch || die
125 eend $? || die "filterdiff failed"
126 fi
127
128 MY_A=
129 for _AFILE in ${A}; do
130 [[ ${_AFILE} == ${LINUX_SOURCES} ]] && continue
131 [[ ${_AFILE} == ${LINUX_PATCH} ]] && continue
132 MY_A="${MY_A} ${_AFILE}"
133 done
134 [[ -n ${MY_A} ]] && unpack ${MY_A}
135 }
136
137 src_prepare() {
138 if [[ -n ${LINUX_PATCH} ]]; then
139 cd "${S_K}"
140 epatch "${WORKDIR}"/${P}.patch
141 fi
142
143 # Drop some upstream too-developer-oriented flags and fix the
144 # Makefile in general
145 sed -i \
146 -e 's:-Werror::' \
147 -e 's:-ggdb3::' \
148 -e 's:-fstack-protector-all::' \
149 -e 's:^LDFLAGS =:EXTLIBS +=:' \
150 -e '/\(PERL\|PYTHON\)_EMBED_LDOPTS/s:ALL_LDFLAGS +=:EXTLIBS +=:' \
151 -e '/-x c - /s:\$(ALL_LDFLAGS):\0 $(EXTLIBS):' \
152 -e '/^ALL_CFLAGS =/s:$: $(CFLAGS_OPTIMIZE):' \
153 -e '/^ALL_LDFLAGS =/s:$: $(LDFLAGS_OPTIMIZE):' \
154 -e '/.FORCE-PERF-VERSION-FILE/s,.FORCE-PERF-VERSION-FILE,,g' \
155 "${S}"/Makefile
156
157 # Avoid the call to make kernelversion
158 echo "PERF_VERSION = ${MY_PV}" >PERF-VERSION-FILE
159 }
160
161 perf_make() {
162 local makeargs= arch=
163
164 case $ARCH in
165 amd64) arch=x86 ;;
166 powerpc*|ppc*) arch=ppc ;;
167 *) arch=$ARCH ;;
168 esac
169 use demangle || makeargs="${makeargs} NO_DEMANGLE= "
170 use perl || makeargs="${makeargs} NO_LIBPERL= "
171 use python || makeargs="${makeargs} NO_LIBPYTHON= "
172 use ncurses || makeargs="${makeargs} NO_NEWT= "
173
174 emake ${makeargs} \
175 CC="$(tc-getCC)" AR="$(tc-getAR)" \
176 prefix="/usr" bindir_relative="sbin" \
177 CFLAGS_OPTIMIZE="${CFLAGS}" \
178 LDFLAGS_OPTIMIZE="${LDFLAGS}" \
179 ARCH="${arch}" \
180 "$@" || die
181 }
182
183 src_compile() {
184 perf_make || die
185
186 if use doc; then
187 pushd Documentation
188 emake ${makeargs} || die
189 popd
190 fi
191 }
192
193 src_test() {
194 :
195 }
196
197 src_install() {
198 perf_make install DESTDIR="${D}" || die
199
200 dodoc CREDITS || die
201
202 dodoc *txt Documentation/*.txt || die
203 if use doc; then
204 dohtml Documentation/*.html || die
205 doman Documentation/*.1 || die
206 fi
207 }
208
209 pkg_postinst() {
210 if ! use doc; then
211 elog "Without the doc USE flag you won't get any documentation nor man pages."
212 elog "And without man pages, you won't get any --help output for perf and its"
213 elog "sub-tools."
214 fi
215 }