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

Contents of /dev-lang/fpc/fpc-2.4.0.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


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

  ViewVC Help
Powered by ViewVC 1.1.20