summaryrefslogtreecommitdiff
blob: 178d1dfafe87db3bac3e07fd302eb67a9a467d6b (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
73
74
75
76
77
78
79
80
81
82
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-dotnet/mono/mono-1.0.5-r1.ebuild,v 1.3 2005/01/18 16:38:31 scandium Exp $

inherit eutils mono flag-o-matic debug gcc

DESCRIPTION="Mono runtime and class libraries, a C# compiler/interpreter"
HOMEPAGE="http://www.go-mono.com/"
SRC_URI="http://www.go-mono.com/archive/${PV}/${P}.tar.gz"

LICENSE="|| ( GPL-2 LGPL-2 X11)"
SLOT="0"
KEYWORDS="~x86 ~ppc ~amd64"
IUSE="nptl"

DEPEND="virtual/libc
	>=dev-libs/glib-2.0
	>=dev-libs/icu-2.6.1
	!<dev-dotnet/pnet-0.6.12
	nptl? ( >=sys-devel/gcc-3.4 )
	ppc? (
		>=sys-devel/gcc-3.2.3-r4
		>=sys-libs/glibc-2.3.3_pre20040420
	)"

RDEPEND="${DEPEND}
	dev-util/pkgconfig
	dev-libs/libxml2"

src_compile() {
	strip-flags

	local myconf="--with-sigaltstack=yes"
	if use nptl && have_NPTL
	then
		# NPTL support only works with gcc-3.4 and higher currently. ):
		if [ `gcc-minor-version` -lt 4 ]
		then
			echo
			eerror "NPTL enabled mono requires gcc-3.4 or higher to function."
			eerror "Please use gcc-config to select gcc-3.4 for the mono installation."
			die "gcc version not high enough for NPTL support."
		else
			myconf="${myconf} --with-tls=__thread"
			sed -i "s: -fexceptions::" ${S}/libgc/configure.host
		fi
	else
		if have_NPTL
		then
			ewarn "NPTL glibc detected, but nptl USE flag is not set."
			ewarn "This may cause some problems for mono as it will be"
			ewarn "compiled with normal pthread support."
		fi

		myconf="${myconf} --with-tls=pthread"
	fi

	econf ${myconf} || die
	emake -j1 || die "MONO compilation failure"
}

src_install() {
	make DESTDIR=${D} install || die

	dodoc AUTHORS ChangeLog NEWS README
	docinto docs
	dodoc docs/*
	docinto libgc
	dodoc libgc/ChangeLog

	# init script
	exeinto /etc/init.d ; newexe ${FILESDIR}/dotnet.init dotnet
	insinto /etc/conf.d ; newins ${FILESDIR}/dotnet.conf dotnet
}

pkg_postinst() {
	echo
	einfo "If you want to avoid typing '<runtime> program.exe'"
	einfo "you can configure your runtime in /etc/conf.d/dotnet"
	einfo "Use /etc/init.d/dotnet to register your runtime"
	echo
}