summaryrefslogtreecommitdiff
blob: bd2a2a1bc1406b38ba1e610b5fa940a42b188b56 (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
# Copyright 1999-2004 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-lang/pm3/pm3-1.1.15.ebuild,v 1.7 2004/04/19 06:29:44 vapier Exp $

inherit gcc 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=""

S=${WORKDIR}/${PN}

src_unpack() {
	unpack ${MY_P}.tar.bz2
	cd ${S}
	unpack ${P}-${M3_TARGET}-boot.tgz
	epatch ${FILESDIR}/${P}.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
}