summaryrefslogtreecommitdiff
blob: b32f856edf9f784630098b9b8605eae0e8130221 (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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-ruby/ruby-prof/ruby-prof-0.7.2.ebuild,v 1.3 2009/01/03 04:42:13 mr_bones_ Exp $

inherit ruby

DESCRIPTION="A module for profiling Ruby code"
HOMEPAGE="http://rubyforge.org/projects/ruby-prof/"
SRC_URI="mirror://rubyforge/${PN}/${P}.tgz"

LICENSE="BSD"
SLOT="0"
KEYWORDS="~amd64 ~ppc ~x86"
IUSE="doc test"

RDEPEND="virtual/ruby"
DEPEND="${RDEPEND}
	test? ( dev-ruby/rake )
	doc? ( dev-ruby/rake )"

USE_RUBY="ruby18"

src_unpack() {
	ruby_src_unpack

	# The thread testing in 0.7.2 and earlier versions is broken, it
	# has to be tested for the next versions, since upstream is
	# looking for a solution.
	rm "${S}"/test/thread_test.rb \
		|| die "unable to remove broken test unit"
	sed -i -e '/thread_test/d' \
		test/test_suite.rb || die "unable to remove broken test reference"

	epatch "${FILESDIR}/${P}+glibc-2.8.patch"
}

src_compile() {
	cd "${S}/ext"
	ruby_econf || die "ruby_econf failed"
	ruby_emake || die "ruby_emake failed"

	if use doc; then
		rake rdoc || die "rake rdoc failed"
	fi
}

src_test() {
	rake test || die "rake test failed"
}

src_install() {
	dobin bin/ruby-prof || die "dobin failed"

	cd "${S}"/lib
	doruby -r * || die "doruby failed"

	cd "${S}"/ext
	ruby_einstall || die "ruby_einstall failed"

	cd "${S}"

	dodoc README CHANGES || die "dodoc failed"

	if use doc; then
		dohtml -r doc/* || die "dohtml failed"
	fi

	for dir in examples rails rails/example rails/environment; do
		docinto "$dir"
		dodoc "$dir"/* || die "dodoc $dir failed"
	done
}