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

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

  ViewVC Help
Powered by ViewVC 1.1.20