commit:     8082ba7028491049b5b6deccede5e80b8c7fdfc1
Author:     Andrew Savchenko <bircoph <AT> gentoo <DOT> org>
AuthorDate: Sun Mar 20 17:14:34 2016 +0000
Commit:     Andrew Savchenko <bircoph <AT> gentoo <DOT> org>
CommitDate: Sun Mar 20 17:14:34 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8082ba70

Revert "dev-util/oprofile: remove old version"

This reverts commit 331e1e47a803fcc79d9e66ae54db9c364a8f1af9, which
accidentally removed patch used by 0.9.9-r2
(oprofile-1.0.0-athlon.patch).

 dev-util/oprofile/Manifest                         |  1 +
 .../oprofile/files/oprofile-1.0.0-athlon.patch     | 20 ++++++
 .../files/oprofile-1.0.0-opjitconv-open.patch      | 11 ++++
 dev-util/oprofile/oprofile-1.0.0-r2.ebuild         | 72 ++++++++++++++++++++++
 4 files changed, 104 insertions(+)

diff --git a/dev-util/oprofile/Manifest b/dev-util/oprofile/Manifest
index e5c9b78..0dd98d4 100644
--- a/dev-util/oprofile/Manifest
+++ b/dev-util/oprofile/Manifest
@@ -1,2 +1,3 @@
 DIST oprofile-0.9.9.tar.gz 1502834 SHA256 
1e523400daaba7b8d0d15269e977a08b40edfea53970774b69ae130e25117597 SHA512 
98cc3d2c15744d02ed649833cf4797482aec73bd52653e916f80b490e17a8250d988c4c945e52dd8999a0d0603fec405e99c9570dfc54baa4992950fe4d8763f
 WHIRLPOOL 
534d04449923da5008dbf044f9783a1d39ad8b749170edf04a503ca1a885455fc8aef4f5894060d14135f5e3b0a0d577897779eed30dc26deff9b0663fcbb7d1
+DIST oprofile-1.0.0.tar.gz 1397396 SHA256 
847110b4ecdcf8c8353cd38f94c1b704aad4bfcd9453e38b88d112cfb7e3c45a SHA512 
35b0e9f23c1d8df0aebda3f9b550692a896424de901d529a0ad41da41000328f33d184dcbb8e6f8367008723c8b2177b621757a2282b4c881ac46a57e1b51010
 WHIRLPOOL 
eaf7feefb6561851d2f8573ec60f2086245aa9fc034c8f4ab62679895ae80ca45e8dcb4bfdcb96ad477c5b446b7f0b11e339d9dc270e8b4b0366bc3a9e980143
 DIST oprofile-1.1.0.tar.gz 1468502 SHA256 
cf759a6de1a6033d5dfc93bda129a9f2e128aecc4238cc657feb0801d1b0366c SHA512 
b26f67f20172a4912c0aafb3adf83f9084ea62b9ca89e4cfcb3e13276114a05b07587f7d250028995a10c39ae993e2bce271be11688010473ab9f0fd81715758
 WHIRLPOOL 
b268af1578c485165624e0152751b6c5053c745e6813d6f13ea554993f311e540312854a36011e10560e82c378ef1fc357220a69cd713f73824ae249cc150650

diff --git a/dev-util/oprofile/files/oprofile-1.0.0-athlon.patch 
b/dev-util/oprofile/files/oprofile-1.0.0-athlon.patch
new file mode 100644
index 0000000..5916271
--- /dev/null
+++ b/dev-util/oprofile/files/oprofile-1.0.0-athlon.patch
@@ -0,0 +1,20 @@
+Fix AMD Athlon CPU family recognition.
+See upstream bug 275 for details:
+https://sourceforge.net/p/oprofile/bugs/275/
+--- oprofile-1.0.0/libop/op_cpu_type.c.orig    2014-09-12 18:39:47.000000000 
+0400
++++ oprofile-1.0.0/libop/op_cpu_type.c 2014-11-30 18:29:00.328342552 +0300
+@@ -538,10 +538,13 @@
+       family = cpu_family(eax);
+ 
+       /* These family does not exist in the past.*/
+-      if (family < 0x0f || family == 0x13)
++      if ((family < 0x0f && family != 0x06) || family == 0x13)
+               return ret;
+ 
+       switch (family) {
++      case 0x6:
++              ret = op_get_cpu_number("i386/athlon");
++              break;
+       case 0x0f:
+               ret = op_get_cpu_number("x86-64/hammer");
+               break;

diff --git a/dev-util/oprofile/files/oprofile-1.0.0-opjitconv-open.patch 
b/dev-util/oprofile/files/oprofile-1.0.0-opjitconv-open.patch
new file mode 100644
index 0000000..2943a07
--- /dev/null
+++ b/dev-util/oprofile/files/oprofile-1.0.0-opjitconv-open.patch
@@ -0,0 +1,11 @@
+--- a/opjitconv/opjitconv.c
++++ b/opjitconv/opjitconv.c
+@@ -216,7 +216,7 @@
+       int file_locked = 0;
+       unsigned int usecs_waited = 0;
+       int rc = OP_JIT_CONV_OK;
+-      int fd = open(dumpfile, S_IRUSR);
++      int fd = open(dumpfile, O_RDONLY);
+       if (fd < 0) {
+               perror("opjitconv failed to open JIT dumpfile");
+               return OP_JIT_CONV_FAIL;

diff --git a/dev-util/oprofile/oprofile-1.0.0-r2.ebuild 
b/dev-util/oprofile/oprofile-1.0.0-r2.ebuild
new file mode 100644
index 0000000..2fda6ad
--- /dev/null
+++ b/dev-util/oprofile/oprofile-1.0.0-r2.ebuild
@@ -0,0 +1,72 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+inherit eutils java-pkg-opt-2 linux-info multilib user
+
+MY_P=${PN}-${PV/_/-}
+DESCRIPTION="A transparent low-overhead system-wide profiler"
+HOMEPAGE="http://${PN}.sourceforge.net";
+SRC_URI="mirror://sourceforge/${PN}/${MY_P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~mips ~ppc ~ppc64 ~sparc ~x86"
+IUSE="java pch"
+
+RDEPEND=">=dev-libs/popt-1.7-r1
+       sys-libs/binutils-libs
+       >=sys-libs/glibc-2.3.2-r1
+       java? ( >=virtual/jdk-1.5:= )"
+DEPEND="${RDEPEND}
+       >=sys-kernel/linux-headers-2.6.31"
+
+S="${WORKDIR}/${MY_P}"
+
+CONFIG_CHECK="PERF_EVENTS"
+ERROR_PERF_EVENTS="CONFIG_PERF_EVENTS is mandatory for ${PN} to work."
+
+pkg_setup() {
+       linux-info_pkg_setup
+       if ! kernel_is -ge 2 6 31; then
+               echo
+               ewarn "Support for kernels before 2.6.31 has been dropped in 
${PN}-1.0.0."
+               echo
+       fi
+
+       # Required for JIT support, see README_PACKAGERS
+       enewgroup ${PN}
+       enewuser ${PN} -1 -1 -1 ${PN}
+
+       use java && java-pkg_init
+}
+
+src_prepare() {
+       epatch "${FILESDIR}/${P}-athlon.patch"
+       epatch "${FILESDIR}/${P}-opjitconv-open.patch"
+}
+
+src_configure() {
+       econf \
+               --disable-werror \
+               $(use_enable pch) \
+               $(use_with java java ${JAVA_HOME})
+}
+
+src_install() {
+       emake DESTDIR="${D}" htmldir="/usr/share/doc/${PF}" install
+
+       dodoc ChangeLog* README TODO
+       echo "LDPATH=${PREFIX}/usr/$(get_libdir)/${PN}" > "${T}/10${PN}"
+       doenvd "${T}/10${PN}"
+}
+
+pkg_postinst() {
+       echo
+       elog "Starting from ${PN}-1.0.0 opcontrol was removed, use operf 
instead."
+       elog "CONFIG_OPROFILE is no longer used, you may remove it from your 
kernels."
+       elog "Please read manpages and this html doc:"
+       elog "  /usr/share/doc/${PF}/${PN}.html"
+       echo
+}

Reply via email to