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

Contents of /dev-lang/fpc/fpc-2.2.0-r1.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (show annotations) (download)
Mon Jul 9 21:29:15 2012 UTC (2 years, 1 month ago) by ulm
Branch: MAIN
Changes since 1.2: +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.0-r1.ebuild,v 1.2 2008/12/16 19:30:03 truedfx Exp $
4
5 inherit eutils
6
7 # bug #183604
8 RESTRICT="strip"
9
10 PV_BIN="2.2.0"
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 x86? ( mirror://sourceforge/freepascal/fpc-${PV_BIN}.i386-linux.tar )
17 sparc? ( mirror://sourceforge/freepascal/fpc-2.0.0.sparc-linux.tar )
18 ppc? ( mirror://sourceforge/freepascal/fpc-${PV_BIN}.powerpc-linux.tar )
19 amd64? ( mirror://sourceforge/freepascal/fpc-${PV_BIN}.x86_64-linux.tar )
20 doc? ( mirror://sourceforge/freepascal/fpc-${PV}-doc-pdf.tar.gz )"
21
22 SLOT="0"
23 LICENSE="GPL-2 LGPL-2.1-with-linking-exception"
24 KEYWORDS="~amd64 ~ppc ~sparc ~x86"
25 IUSE="doc source"
26
27 DEPEND="!dev-lang/fpc-bin
28 !dev-lang/fpc-source"
29
30 src_unpack() {
31 case ${ARCH} in
32 x86) FPC_ARCH="i386" ;;
33 ppc) FPC_ARCH="powerpc" ;;
34 amd64) FPC_ARCH="x86_64" ;;
35 sparc) FPC_ARCH="sparc" ;;
36 *) die "This ebuild doesn't support ${ARCH}." ;;
37 esac
38
39 unpack ${A} || die "Unpacking ${A} failed!"
40
41 tar -xf binary.${FPC_ARCH}-linux.tar || die "Unpacking binary.${FPC_ARCH}-linux.tar failed!"
42 tar -xzf base.${FPC_ARCH}-linux.tar.gz || die "Unpacking base.${FPC_ARCH}-linux.tar.gz failed!"
43
44 cd "${S}"
45 epatch "${FILESDIR}"/${P}-unneeded-symbols.patch
46 }
47
48 set_pp() {
49 case ${ARCH} in
50 x86) FPC_ARCH="386" ;;
51 ppc) FPC_ARCH="ppc" ;;
52 amd64) FPC_ARCH="x64" ;;
53 sparc) FPC_ARCH="sparc" ;;
54 *) die "This ebuild doesn't support ${ARCH}." ;;
55 esac
56
57 case ${1} in
58 bootstrap) pp="${WORKDIR}"/lib/fpc/${PV_BIN}/ppc${FPC_ARCH} ;;
59 new) pp="${S}"/compiler/ppc${FPC_ARCH} ;;
60 *) die "set_pp: unknown argument: ${1}" ;;
61 esac
62 }
63
64 src_compile() {
65 local pp
66
67 # Using the bootstrap compiler.
68 set_pp bootstrap
69
70 emake -j1 PP="${pp}" compiler_cycle || die "make compiler_cycle failed!"
71
72 # Save new compiler from cleaning...
73 cp "${S}"/compiler/ppc${FPC_ARCH} "${S}"/ppc${FPC_ARCH}.new
74
75 # ...rebuild with current version...
76 emake -j1 PP="${S}"/ppc${FPC_ARCH}.new compiler_cycle || die "make compiler_cycle failed!"
77
78 # ..and clean up afterwards
79 rm "${S}"/ppc${FPC_ARCH}.new
80
81 # Using the new compiler.
82 set_pp new
83
84 emake -j1 PP="${pp}" rtl_clean || die "make rtl_clean failed"
85
86 emake -j1 PP="${pp}" rtl packages_base_all packages_fcl_all fv_all \
87 packages_extra_all utils || die "make failed"
88
89 # Use pregenerated docs to avoid sandbox violations (#146804)
90 #if use doc ; then
91 # cd "${S}"/../fpcdocs
92 # emake -j1 pdf || die "make pdf failed!"
93 #fi
94 }
95
96 src_install() {
97 local pp
98 set_pp new
99
100 set -- PP="${pp}" FPCMAKE="${S}/utils/fpcm/fpcmake" \
101 INSTALL_PREFIX="${D}"usr \
102 INSTALL_DOCDIR="${D}"usr/share/doc/${P} \
103 INSTALL_MANDIR="${D}"usr/share/man \
104 INSTALL_SOURCEDIR="${D}"/usr/lib/fpc/${PV}/source
105
106 emake -j1 "$@" compiler_install rtl_install packages_install \
107 fv_install utils_install || die "make install failed!"
108
109 dosym ../lib/fpc/${PV}/ppc${FPC_ARCH} /usr/bin/ppc${FPC_ARCH}
110
111 if ! has nodoc ${FEATURES} ; then
112 cd "${S}"/../install/doc
113 emake -j1 "$@" installdoc || die "make installdoc failed!"
114 fi
115
116 if ! has noman ${FEATURES} ; then
117 cd "${S}"/../install/man
118 emake -j1 "$@" installman || die "make installman failed!"
119 fi
120
121 if ! has nodoc ${FEATURES} && use doc ; then
122 insinto /usr/share/doc/${PF}
123 doins "${WORKDIR}"/share/doc/fpdocs-${PV}/*.pdf
124 #cd "${S}"/../fpcdocs
125 #emake -j1 "$@" pdfinstall || die "make pdfinstall failed"
126 fi
127
128 if use source ; then
129 cd "${S}"
130 shift
131 emake -j1 PP="${D}"usr/bin/ppc${FPC_ARCH} "$@" sourceinstall || die "make sourceinstall failed!"
132 find "${D}"usr/lib/fpc/${PV}/source -name '*.o' -exec rm {} \;
133 fi
134
135 "${D}"usr/lib/fpc/${PV}/samplecfg /usr/lib/fpc/${PV} "${D}"etc
136
137 rm -rf "${D}"usr/lib/fpc/lexyacc
138 }
139
140 pkg_postinst() {
141 # Using ewarn - it is really important for other ebuilds (e.g. Lazarus)
142 if [ -e /etc/._cfg0000_fpc.cfg ]; then
143 echo
144 ewarn "Make sure you etc-update /etc/fpc.cfg"
145 ewarn "Otherwise FPC will not work correctly."
146 echo
147 ebeep
148 fi
149
150 ewarn "The default configuration for fpc strips executables. This"
151 ewarn "will cause QA notices in ebuilds for software using fpc."
152 ewarn "You can remove -Xs from /etc/fpc.cfg to avoid this."
153 }

  ViewVC Help
Powered by ViewVC 1.1.20