summaryrefslogtreecommitdiff
blob: 17184fb0dbd557d4e0e2922d073665fe2df08685 (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
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-lang/pm3/pm3-1.1.15-r1.ebuild,v 1.6 2005/05/16 02:27:13 vapier Exp $

inherit toolchain-funcs eutils flag-o-matic

M3_TARGET="LINUXLIBC6"
MY_P="${PN}-src-${PV}"
DESCRIPTION="Modula-3 compiler"
HOMEPAGE="http://www.elegosoft.com/pm3/"
SRC_URI="ftp://www.elegosoft.com/pub/pm3/${P}-${M3_TARGET}-boot.tgz
	ftp://www.elegosoft.com/pub/pm3/${MY_P}.tar.bz2"

LICENSE="LGPL-2.1 GPL-2"
SLOT="0"
KEYWORDS="x86"
IUSE=""

DEPEND="dev-util/byacc"
RDEPEND=""
PROVIDE="virtual/m3"

S=${WORKDIR}/${PN}

src_unpack() {
	unpack ${MY_P}.tar.bz2
	cd ${S}
	unpack ${P}-${M3_TARGET}-boot.tgz
	epatch ${FILESDIR}/${P}.patch
	epatch ${FILESDIR}/${PV}-errno.patch
	cp ${FILESDIR}/PACKAGES ${S}/src/

	echo 'RANLIB = ["ranlib"]' >> m3config/src/${M3_TARGET}
	export LD_LIBRARY_PATH="${S}/EXPORTS/usr/lib/m3/${M3_TARGET}/:${LD_LIBRARY_PATH}"

	mv ${PN}-${M3_TARGET}/* ${S}/
}

src_compile() {
	[ `gcc-major-version` == 3 ] && replace-flags -O? -O1
	make || die
}

src_install() {
	mv EXPORTS/* ${D}/ || die
	prepall

	dodir /etc/env.d
	echo "LDPATH=/usr/lib/m3/${M3_TARGET}" >> ${D}/etc/env.d/05pm3
}