summaryrefslogtreecommitdiff
blob: fee581bf5d84e144d26e936415a31af895b54d97 (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
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-util/gprof2dot/gprof2dot-0_p20130517.ebuild,v 1.2 2013/06/16 13:29:36 sping Exp $

EAPI="5"

PYTHON_COMPAT=( python{2_6,2_7,3_1,3_2,3_3} )
PYTHON_REQ_USE='xml'

inherit eutils python-r1 python-utils-r1

DESCRIPTION="Converts profiling output to dot graphs"
HOMEPAGE="http://code.google.com/p/jrfonseca/wiki/Gprof2Dot"
SRC_URI="http://www.hartwork.org/public/${P}.tar.xz"

LICENSE="GPL-3"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE=""

DEPEND=""
RDEPEND=""

src_prepare() {
	epatch "${FILESDIR}"/${P}-py3-xrange.patch
}

_make_call_script() {
	cat <<-EOF >"${D}/$1"
	#! /usr/bin/env python
	from gprof2dot import Main
	Main().main()
	EOF

	fperms a+x "$1" || die
}

src_install() {
	abi_specific_install() {
		insinto "$(python_get_sitedir)"
		doins ${PN}.py || die
		python_optimize || die
	}
	python_parallel_foreach_impl abi_specific_install

	dodir /usr/bin || die
	_make_call_script /usr/bin/${PN} || die
	python_replicate_script "${D}"/usr/bin/${PN} || die
}