summaryrefslogtreecommitdiff
blob: d2beb9bada76953b6015e361453a08443c5d68ed (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
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-lang/fpc/fpc-1.9.5_pre20040820.ebuild,v 1.3 2005/09/15 22:02:41 vanquirius Exp $

inherit eutils

FPC_V="1.9.5"

DESCRIPTION="Source build for the Free Pascal Compiler"
HOMEPAGE="http://www.us.freepascal.org/fpc.html"
SRC_URI="doc? ( ftp://ftp.freepascal.org/pub/fpc/docs/doc-html.zip )"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~x86 -amd64"
IUSE="doc"
RDEPEND="!dev-lang/fpc-bin"
DEPEND="${RDEPEND}
	doc? ( app-arch/unzip )"
S="${WORKDIR}/fpc-${FPC_V}"

src_compile() {
	cd ${S}

	einfo "Building the fpc compiler and units"
	# have to use -j1 as it doesn't seem to like -j2+
	emake -j1 build \
		OS_TARGET=linux \
		PP=${S}/ppc386 \
		PREFIX=${D}/usr \
		|| die "Free Pascal Compiler build process failed!"
}

src_install() {
	einfo "Installing the fpc compiler and units"
	make install \
		OS_TARGET=linux \
		PP=${S}/ppc386 \
		PREFIX=${D}/usr \
		|| die "Free Pascal Compiler install failed!"

	if use doc; then
		#install the html docs
		einfo "Installing html docs"
		mkdir ${D}/usr/share/doc/fpc-${FPC_V}/html
		cp -r ${WORKDIR}/doc/* ${D}/usr/share/doc/fpc-${FPC_V}/html
	fi
}

config() {
	#Create our configuration file so fpc
	#is easier to use
	/usr/lib/fpc/${FPC_V}/samplecfg /usr/lib/fpc/${FPC_V} /etc

	einfo "The configuration file for fpc has been placed in /etc/fpc.cfg"
	einfo "Use this to customize your pascal compile flags"
	einfo "More information on the fpc flags can be found in the fpc manpage"
	echo
	einfo "Examples and docs can be found in /usr/share/doc/fpc-${FPC_V}"
	einfo "Upstream support can be found at: http://community.freepascal.org:10000/"
}