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

Contents of /dev-lang/fpc/fpc-2.4.4.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, 2 months 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.4.4.ebuild,v 1.2 2011/12/12 23:40:50 radhermit Exp $
4
5 EAPI=4
6
7 HOMEPAGE="http://www.freepascal.org/"
8 DESCRIPTION="Free Pascal Compiler"
9 SRC_URI="mirror://sourceforge/freepascal/fpcbuild-${PV}.tar.gz
10 amd64? ( mirror://sourceforge/freepascal/${P}.x86_64-linux.tar )
11 ppc? ( mirror://sourceforge/freepascal/${P}.powerpc-linux.tar )
12 sparc? ( mirror://sourceforge/freepascal/${PN}-2.2.4.sparc-linux.tar )
13 x86? ( mirror://sourceforge/freepascal/${P}.i386-linux.tar )
14 doc? ( mirror://sourceforge/freepascal/Documentation/${PV}/doc-html.tar.gz -> ${P}-doc-html.tar.gz
15 http://dev.gentoo.org/~radhermit/distfiles/${P}-fpctoc.htx.bz2 )"
16
17 SLOT="0"
18 LICENSE="GPL-2 LGPL-2.1-with-linking-exception"
19 KEYWORDS="~amd64 ~ppc ~sparc ~x86"
20 IUSE="doc ide source"
21
22 RDEPEND="ide? ( !dev-lang/fpc-ide )"
23
24 RESTRICT="strip" #269221
25
26 S="${WORKDIR}/fpcbuild-${PV}/fpcsrc"
27
28 src_unpack() {
29 case ${ARCH} in
30 amd64) FPC_ARCH="x86_64" PV_BIN=${PV} ;;
31 ppc) FPC_ARCH="powerpc" PV_BIN=${PV} ;;
32 sparc) FPC_ARCH="sparc" PV_BIN=2.2.4 ;;
33 x86) FPC_ARCH="i386" PV_BIN=${PV} ;;
34 *) die "This ebuild doesn't support ${ARCH}." ;;
35 esac
36
37 unpack ${A}
38
39 tar -xf binary.${FPC_ARCH}-linux.tar || die "Unpacking binary.${FPC_ARCH}-linux.tar failed!"
40 tar -xzf base.${FPC_ARCH}-linux.tar.gz || die "Unpacking base.${FPC_ARCH}-linux.tar.gz failed!"
41 }
42
43 src_prepare() {
44 find "${WORKDIR}" -name Makefile -exec sed -i -e 's/ -Xs / /g' {} + || die
45 }
46
47 set_pp() {
48 case ${ARCH} in
49 x86) FPC_ARCH="386" ;;
50 ppc) FPC_ARCH="ppc" ;;
51 amd64) FPC_ARCH="x64" ;;
52 sparc) FPC_ARCH="sparc" ;;
53 *) die "This ebuild doesn't support ${ARCH}." ;;
54 esac
55
56 case ${1} in
57 bootstrap) pp="${WORKDIR}"/lib/fpc/${PV_BIN}/ppc${FPC_ARCH} ;;
58 new) pp="${S}"/compiler/ppc${FPC_ARCH} ;;
59 *) die "set_pp: unknown argument: ${1}" ;;
60 esac
61 }
62
63 src_compile() {
64 local pp
65
66 # Using the bootstrap compiler.
67 set_pp bootstrap
68
69 emake -j1 PP="${pp}" compiler_cycle
70
71 # Save new compiler from cleaning...
72 cp "${S}"/compiler/ppc${FPC_ARCH} "${S}"/ppc${FPC_ARCH}.new || die
73
74 # ...rebuild with current version...
75 emake -j1 PP="${S}"/ppc${FPC_ARCH}.new compiler_cycle
76
77 # ..and clean up afterwards
78 rm "${S}"/ppc${FPC_ARCH}.new || die
79
80 # Using the new compiler.
81 set_pp new
82
83 emake -j1 PP="${pp}" rtl_clean
84
85 emake -j1 PP="${pp}" rtl packages_all utils
86
87 if use ide ; then
88 cd "${S}"/ide || die
89 emake -j1 PP="${pp}"
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/${PF} \
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 utils_install
104
105 dosym ../lib/fpc/${PV}/ppc${FPC_ARCH} /usr/bin/ppc${FPC_ARCH}
106
107 cd "${S}"/../install/doc || die
108 emake -j1 "$@" installdoc
109
110 cd "${S}"/../install/man || die
111 emake -j1 "$@" installman
112
113 if use doc ; then
114 cd "${S}"/../../doc || die
115 dodoc -r *
116 newdoc "${WORKDIR}"/${P}-fpctoc.htx fpctoc.htx
117 docompress -x /usr/share/doc/${PF}/fpctoc.htx
118 fi
119
120 if use ide ; then
121 cd "${S}"/ide
122 emake -j1 "$@" install
123 fi
124
125 if use source ; then
126 cd "${S}" || die
127 shift
128 emake -j1 PP="${D}"usr/bin/ppc${FPC_ARCH} "$@" sourceinstall
129 find "${D}"usr/lib/fpc/${PV}/source -name '*.o' -exec rm {} \;
130 fi
131
132 "${D}"usr/lib/fpc/${PV}/samplecfg "${D}"usr/lib/fpc/${PV} "${D}"etc || die
133 sed -i -e "s:${D}:/:g" "${D}"etc/fpc.cfg || die "sed fpc.cfg failed"
134
135 rm -r "${D}"usr/lib/fpc/lexyacc || die
136 }
137
138 pkg_postinst() {
139 if use ide ; then
140 einfo "To read the documentation in the fpc IDE, enable the doc USE flag"
141 einfo "and add /usr/share/doc/${PF}/fpctoc.htx to the Help Files list."
142 fi
143 }

  ViewVC Help
Powered by ViewVC 1.1.20