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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.7 - (show annotations) (download)
Mon Jul 9 21:29:15 2012 UTC (3 years ago) by ulm
Branch: MAIN
Changes since 1.6: +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.ebuild,v 1.6 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
45 set_pp() {
46 case ${ARCH} in
47 x86) FPC_ARCH="386" ;;
48 ppc) FPC_ARCH="ppc" ;;
49 amd64) FPC_ARCH="x64" ;;
50 sparc) FPC_ARCH="sparc" ;;
51 *) die "This ebuild doesn't support ${ARCH}." ;;
52 esac
53
54 case ${1} in
55 bootstrap) pp="${WORKDIR}"/lib/fpc/${PV_BIN}/ppc${FPC_ARCH} ;;
56 new) pp="${S}"/compiler/ppc${FPC_ARCH} ;;
57 *) die "set_pp: unknown argument: ${1}" ;;
58 esac
59 }
60
61 src_compile() {
62 local pp
63
64 # Using the bootstrap compiler.
65 set_pp bootstrap
66
67 emake -j1 PP="${pp}" compiler_cycle || die "make compiler_cycle failed!"
68
69 # Save new compiler from cleaning...
70 cp "${S}"/compiler/ppc${FPC_ARCH} "${S}"/ppc${FPC_ARCH}.new
71
72 # ...rebuild with current version...
73 emake -j1 PP="${S}"/ppc${FPC_ARCH}.new compiler_cycle || die "make compiler_cycle failed!"
74
75 # ..and clean up afterwards
76 rm "${S}"/ppc${FPC_ARCH}.new
77
78 # Using the new compiler.
79 set_pp new
80
81 emake -j1 PP="${pp}" rtl_clean || die "make rtl_clean failed"
82
83 emake -j1 PP="${pp}" rtl packages_base_all packages_fcl_all fv_all \
84 packages_extra_all utils || die "make failed"
85
86 # Use pregenerated docs to avoid sandbox violations (#146804)
87 #if use doc ; then
88 # cd "${S}"/../fpcdocs
89 # emake -j1 pdf || die "make pdf failed!"
90 #fi
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 fv_install utils_install || die "make install failed!"
105
106 dosym ../lib/fpc/${PV}/ppc${FPC_ARCH} /usr/bin/ppc${FPC_ARCH}
107
108 if ! has nodoc ${FEATURES} ; then
109 cd "${S}"/../install/doc
110 emake -j1 "$@" installdoc || die "make installdoc failed!"
111 fi
112
113 if ! has noman ${FEATURES} ; then
114 cd "${S}"/../install/man
115 emake -j1 "$@" installman || die "make installman failed!"
116 fi
117
118 if ! has nodoc ${FEATURES} && use doc ; then
119 insinto /usr/share/doc/${PF}
120 doins "${WORKDIR}"/share/doc/fpdocs-${PV}/*.pdf
121 #cd "${S}"/../fpcdocs
122 #emake -j1 "$@" pdfinstall || die "make pdfinstall failed"
123 fi
124
125 if use source ; then
126 cd "${S}"
127 shift
128 emake -j1 PP="${D}"usr/bin/ppc${FPC_ARCH} "$@" sourceinstall || die "make sourceinstall failed!"
129 fi
130
131 "${D}"usr/lib/fpc/${PV}/samplecfg /usr/lib/fpc/${PV} "${D}"etc
132
133 rm -rf "${D}"usr/lib/fpc/lexyacc
134 }
135
136 pkg_postinst() {
137 # Using ewarn - it is really important for other ebuilds (e.g. Lazarus)
138 if [ -e /etc/._cfg0000_fpc.cfg ]; then
139 echo
140 ewarn "Make sure you etc-update /etc/fpc.cfg"
141 ewarn "Otherwise FPC will not work correctly."
142 echo
143 ebeep
144 fi
145
146 ewarn "The default configuration for fpc strips executables. This"
147 ewarn "will cause QA notices in ebuilds for software using fpc."
148 ewarn "You can remove -Xs from /etc/fpc.cfg to avoid this."
149 }

  ViewVC Help
Powered by ViewVC 1.1.20