/[gentoo-x86]/dev-lang/fpc/fpc-2.2.4-r2.ebuild
Gentoo

Contents of /dev-lang/fpc/fpc-2.2.4-r2.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Mon Jul 9 21:29:15 2012 UTC (2 years, 5 months ago) by ulm
Branch: MAIN
Changes since 1.1: +3 -3 lines
Update LICENSE, bug 425140.

(Portage version: 2.1.11.5/cvs/Linux x86_64)

1 # Copyright 1999-2012 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/dev-lang/fpc/fpc-2.2.4-r2.ebuild,v 1.1 2009/07/22 20:24:39 truedfx Exp $
4
5 inherit eutils
6
7 RESTRICT="strip" #269221
8
9 S="${WORKDIR}/fpcbuild-${PV}/fpcsrc"
10
11 HOMEPAGE="http://www.freepascal.org/"
12 DESCRIPTION="Free Pascal Compiler"
13 SRC_URI="mirror://sourceforge/freepascal/fpcbuild-${PV}.tar.gz
14 x86? ( mirror://sourceforge/freepascal/fpc-2.2.4.i386-linux.tar )
15 sparc? ( mirror://sourceforge/freepascal/fpc-2.2.4.sparc-linux.tar )
16 ppc? ( mirror://sourceforge/freepascal/fpc-2.2.4.powerpc-linux.tar )
17 amd64? ( mirror://sourceforge/freepascal/fpc-2.2.4.x86_64-linux.tar )
18 doc? ( mirror://sourceforge/freepascal/fpc-${PV}-doc-html.tar.gz
19 mirror://gentoo/fpc-${PV}-fpctoc.htx.bz2 )"
20
21 SLOT="0"
22 LICENSE="GPL-2 LGPL-2.1-with-linking-exception"
23 KEYWORDS="~amd64 ~ppc ~sparc ~x86"
24 IUSE="doc source"
25
26 DEPEND="!dev-lang/fpc-bin
27 !dev-lang/fpc-source"
28 RDEPEND="${DEPEND}"
29 #DEPEND="${DEPEND}
30 # >=sys-devel/binutils-2.19.1-r1"
31
32 src_unpack() {
33 case ${ARCH} in
34 x86) FPC_ARCH="i386" PV_BIN=2.2.4 ;;
35 ppc) FPC_ARCH="powerpc" PV_BIN=2.2.4 ;;
36 amd64) FPC_ARCH="x86_64" PV_BIN=2.2.4 ;;
37 sparc) FPC_ARCH="sparc" PV_BIN=2.2.4 ;;
38 *) die "This ebuild doesn't support ${ARCH}." ;;
39 esac
40
41 unpack ${A} || die "Unpacking ${A} failed!"
42
43 tar -xf binary.${FPC_ARCH}-linux.tar || die "Unpacking binary.${FPC_ARCH}-linux.tar failed!"
44 tar -xzf base.${FPC_ARCH}-linux.tar.gz || die "Unpacking base.${FPC_ARCH}-linux.tar.gz failed!"
45
46 cd "${S}"
47 epatch "${FILESDIR}"/${P}-execstack.patch
48 #sed -i -e 's/ -Xs / /g' $(find . -name Makefile) || die "sed failed"
49 }
50
51 set_pp() {
52 case ${ARCH} in
53 x86) FPC_ARCH="386" ;;
54 ppc) FPC_ARCH="ppc" ;;
55 amd64) FPC_ARCH="x64" ;;
56 sparc) FPC_ARCH="sparc" ;;
57 *) die "This ebuild doesn't support ${ARCH}." ;;
58 esac
59
60 case ${1} in
61 bootstrap) pp="${WORKDIR}"/lib/fpc/${PV_BIN}/ppc${FPC_ARCH} ;;
62 new) pp="${S}"/compiler/ppc${FPC_ARCH} ;;
63 *) die "set_pp: unknown argument: ${1}" ;;
64 esac
65 }
66
67 src_compile() {
68 local pp
69
70 # Using the bootstrap compiler.
71 set_pp bootstrap
72
73 emake -j1 PP="${pp}" compiler_cycle || die "make compiler_cycle failed!"
74
75 # Save new compiler from cleaning...
76 cp "${S}"/compiler/ppc${FPC_ARCH} "${S}"/ppc${FPC_ARCH}.new
77
78 # ...rebuild with current version...
79 emake -j1 PP="${S}"/ppc${FPC_ARCH}.new compiler_cycle || die "make compiler_cycle failed!"
80
81 # ..and clean up afterwards
82 rm "${S}"/ppc${FPC_ARCH}.new
83
84 # Using the new compiler.
85 set_pp new
86
87 emake -j1 PP="${pp}" rtl_clean || die "make rtl_clean failed"
88
89 emake -j1 PP="${pp}" rtl packages_all utils || die "make failed"
90 }
91
92 src_install() {
93 local pp
94 set_pp new
95
96 set -- PP="${pp}" FPCMAKE="${S}/utils/fpcm/fpcmake" \
97 INSTALL_PREFIX="${D}"usr \
98 INSTALL_DOCDIR="${D}"usr/share/doc/${P} \
99 INSTALL_MANDIR="${D}"usr/share/man \
100 INSTALL_SOURCEDIR="${D}"usr/lib/fpc/${PV}/source
101
102 emake -j1 "$@" compiler_install rtl_install packages_install \
103 utils_install || die "make install failed!"
104
105 dosym ../lib/fpc/${PV}/ppc${FPC_ARCH} /usr/bin/ppc${FPC_ARCH}
106
107 cd "${S}"/../install/doc
108 emake -j1 "$@" installdoc || die "make installdoc failed!"
109
110 cd "${S}"/../install/man
111 emake -j1 "$@" installman || die "make installman failed!"
112
113 if use doc ; then
114 cd "${S}"/../../share/doc/fpdocs-${PV}
115 insinto /usr/share/doc/${P}
116 doins -r * || die "doins fpdocs failed"
117 newins "${WORKDIR}"/fpc-${PV}-fpctoc.htx fpctoc.htx || die "newins fpctoc.htx failed"
118 fi
119
120 if use source ; then
121 cd "${S}"
122 shift
123 emake -j1 PP="${D}"usr/bin/ppc${FPC_ARCH} "$@" sourceinstall || die "make sourceinstall failed!"
124 find "${D}"usr/lib/fpc/${PV}/source -name '*.o' -exec rm {} \;
125 fi
126
127 "${D}"usr/lib/fpc/${PV}/samplecfg "${D}"usr/lib/fpc/${PV} "${D}"etc || die "samplecfg failed"
128 sed -i -e "s:${D}:/:g" "${D}"etc/fpc.cfg || die "sed fpc.cfg failed"
129
130 rm -rf "${D}"usr/lib/fpc/lexyacc
131 }

  ViewVC Help
Powered by ViewVC 1.1.20