summaryrefslogtreecommitdiff
blob: 39252187f330fc0c896e726c8df3edf27d0eddf2 (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
# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-lang/parrot/parrot-0.6.1.ebuild,v 1.1 2008/04/29 01:29:11 yuval Exp $

inherit base eutils multilib

DESCRIPTION="The virtual machine that perl6 relies on."
HOMEPAGE="http://www.parrotcode.org/"
SRC_URI="mirror://cpan/authors/id/P/PA/PARTICLE/${P}.tar.gz"
LICENSE="|| ( Artistic GPL-2 )"

SLOT="0"
KEYWORDS="~amd64 ~ppc ~sparc ~x86"
IUSE="doc examples gdbm gmp python"

RDEPEND=">=dev-libs/icu-2.6
		>=sys-libs/ncurses-5.2-r2
		>=sys-libs/readline-5.1
		gdbm? ( >=sys-libs/gdbm-1.8.3-r1 )
		gmp? ( >=dev-libs/gmp-4.1.4 )"

DEPEND="${RDEPEND}
		dev-lang/perl
		python? ( =dev-lang/python-2.4* )"
		#java? ( >=dev-java/antlr-2.7.5 )

src_compile() {
	#This configure defines the DESTDIR for make.
	perl Configure.pl --prefix=/usr --libdir=/usr/$(get_libdir) || die "Perl ./Configure.pl failed"
	emake -j1 || die "emake failed"
	if use doc ; then
		emake html || die "emake html failed"
	fi
}

src_install() {
	#Don't install stuff that is unnecessary
	#We can't do this in src_unpack() because it breaks emake html
	sed -e '/^\(docs\/\|LICENSES\|TODO\|compilers\|config\)/ D' -i MANIFEST
	sed -e '/^\(docs\/\|compilers\|config\)/ D' -i MANIFEST.generated
	sed -e '/^src.*\[main\]$/ D' -i MANIFEST.generated
	if ! use examples ; then
		sed -e '/^examples\// D' -i MANIFEST
		sed -e '/^examples\// D' -i MANIFEST.generated
	fi
	#Because install_files.pl doesn't respect LIB_DIR in some places
	sed -e "s:/lib/:/$(get_libdir)/:" -i tools/dev/install_files.pl
	#The prefix was set by Configure.pl - see src_compile().
	emake -j1 reallyinstall DESTDIR="${D}" DOC_DIR="/usr/share/doc/${P}" || die "emake install failed"
	insinto "/usr/$(get_libdir)/${PN}"
	doins config_lib.pasm

	#necessary for mod_parrot-0.3
	dodir "/usr/$(get_libdir)/${PN}/src/"
	insinto "/usr/$(get_libdir)/${PN}/src/"
	doins "${S}/src/install_config.o" "${S}/src/null_config.o" "${S}/src/parrot_config.o"

	pod2html DEPRECATED.pod > DEPRECATED.html
	dodoc README RESPONSIBLE_PARTIES ABI_CHANGES ChangeLog CREDITS NEWS \
		DEPRECATED.html
	use doc && dohtml -r docs/html/*
}

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