/[gentoo-x86]/dev-embedded/tigcc/tigcc-0.95_p3.ebuild
Gentoo

Contents of /dev-embedded/tigcc/tigcc-0.95_p3.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (show annotations) (download)
Sun Jul 15 03:57:21 2007 UTC (7 years, 2 months ago) by mr_bones_
Branch: MAIN
Changes since 1.3: +1 -2 lines
whitespace
(Portage version: 2.1.2.9)

1 # Copyright 1999-2005 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/dev-embedded/tigcc/tigcc-0.95_p3.ebuild,v 1.3 2005/02/17 17:13:36 robbat2 Exp $
4
5 inherit eutils
6
7 BASE_GCC="3.3.3"
8 BASE_BINUTILS="2.14"
9 GCC_VER=${BASE_GCC:0:3}
10 BIN_VER=${BASE_BINUTILS:0:4}
11 S=${WORKDIR}
12 DESCRIPTION="Cross compiler for Texas Instruments TI-89, TI-92(+) and V200 calculators"
13 HOMEPAGE="http://tigcc.ticalc.org"
14
15 # mirror://gentoo/${P}.tar.bz2 comes from http://tigcc.ticalc.org/linux/tigcc_src.tar.bz2
16 # which isn't that reliable
17
18 #All kernel mirrors in gentoo didn't have 2.14
19 # mirror://kernel/linux/devel/binutils/binutils-${BASE_BINUTILS}.tar.bz2
20
21 SRC_URI="mirror://gentoo/${P}.tar.bz2
22 mirror://gnu/gcc/releases/gcc-${BASE_GCC}/gcc-core-${BASE_GCC}.tar.bz2
23 http://cdn.mirror.garr.it/mirrors/gnuftp/binutils/binutils-${BASE_BINUTILS}.tar.bz2
24 http://members.chello.at/gerhard.kofler/kevin/ti89prog/libfargo.zip
25 http://members.chello.at/gerhard.kofler/kevin/ti89prog/flashosa.zip"
26
27 LICENSE="GPL-2"
28
29 SLOT="0"
30 KEYWORDS="~x86 ~amd64 ~ppc"
31 #KEYWORDS="~x86 ~ppc ~sparc ~amd64"
32 IUSE=""
33
34 RDEPEND="virtual/libc
35 >=sys-devel/binutils-2.14.90.0.6-r1
36 >=sys-devel/bison-1.875"
37 DEPEND="${RDEPEND}
38 app-arch/unzip"
39
40 src_unpack() {
41 unpack ${A}
42 # start by patching binutils and gcc
43 cd ${WORKDIR}/binutils-${BASE_BINUTILS}
44 epatch ${S}/sources/gcc/gas-${BIN_VER}-tigcc-*.diff
45
46 cd ${WORKDIR}/gcc-${BASE_GCC}
47 epatch ${S}/sources/gcc/gcc-${BASE_GCC}-tigcc-*.diff
48
49 # a68k didn't compile, this should fix it.
50 cd ${S}
51 epatch ${FILESDIR}/a68k-fix.patch
52
53 # fixes a bug in tprbuilder, needed for 0.95_beta8-r1
54 # epatch ${FILESDIR}/tprbuilder-fix.patch
55
56 # make build directories for binutils and gcc
57 mkdir -p ${WORKDIR}/build/binutils
58 mkdir ${WORKDIR}/build/gcc
59 }
60
61 src_compile() {
62 # build binutils
63 cd ${WORKDIR}/build/binutils
64 CFLAGS="$CFLAGS" ${WORKDIR}/binutils-${BASE_BINUTILS}/configure \
65 --disable-serial-configure --target=m68k-coff --disable-shared \
66 --enable-static --disable-multilib --disable-nls \
67 || die
68 emake || die
69
70 # build gcc
71 cd ${WORKDIR}/build/gcc
72
73 # --with-headers=${S}/tigcclib/include/c \
74 CFLAGS="$CFLAGS" ${WORKDIR}/gcc-${BASE_GCC}/configure --target=m68k-coff \
75 --with-gnu-as --with-as=${WORKDIR}/build/binutils/gas/as-new --with-gnu-ld \
76 --disable-nls --disable-multilib --disable-shared --enable-static \
77 --disable-threads \
78 || die
79 # GCC compilations _is intended_ to fail on a certain point, don't worry about that.
80 emake
81
82 # build a68k assembler
83 cd ${S}/sources/a68k/src
84 emake -e || die
85
86 # build ld-tigcc linker
87 cd ${S}/sources/ld-tigcc
88 emake -e || die
89
90 # build tigcc front-end
91 cd ${S}/sources/tigcc/src
92 emake -e || die
93
94 # build tprbuilder (TIGCC project builder)
95 cd ${S}/sources/tprbuilder/src
96 emake -e || die
97
98 # build patcher (object file patcher)
99 cd ${S}/sources/patcher/src
100 emake -e || die
101
102 # build parser
103 cd ${S}/sources/parser/src
104 emake -e || die
105
106 # build tict tool suite
107 cd ${S}/tt
108 CFLAGS="$CFLAGS" ./makelinux.sh || die
109
110 # patch the script that launches the documentation browser to point to the correct location
111 sed "s:\$TIGCC/doc:/usr/share/doc/${P}:g" ${S}/tigcclib/doc/converter/tigccdoc > ${S}/tigcclib/doc/converter/tigccdoc.new
112 }
113
114 src_install() {
115 #ENV_FILE=${D}/etc/env.d/gcc/ti-linux-gnu-${GCC_VER}
116 ENV_FILE=${D}/etc/env.d/99tigcc
117
118 # install documentation
119
120 cd ${S}/tigcclib/doc/converter
121 into /usr
122 dodir /usr/bin
123 newbin tigccdoc.new tigccdoc
124
125 dodir /usr/share/doc/${PF}
126 cd ${S}
127 dodoc AUTHORS BUGS CHANGELOG COPYING DIRECTORIES HOWTO INSTALL README README.linux README.osX
128
129 cd ${S}/tigcclib/doc
130 dohtml -r html/*.html
131 cp html/qt-assistant.adp ${D}/usr/share/doc/${PF}/html
132
133 cd ${S}/sources/a68k
134 docinto a68k
135 dodoc docs/*.txt
136
137 cd ${S}/sources/tigcc
138 docinto tigcc
139 dodoc AUTHORS COPYING ChangeLog README
140
141 cd ${S}/sources/tprbuilder
142 docinto tprbuilder
143 dodoc AUTHORS COPYING ChangeLog README
144
145 cd ${S}/sources/patcher
146 docinto patcher
147 dodoc AUTHORS COPYING ChangeLog README
148
149 cd ${S}/sources/parser
150 docinto parser
151 dodoc AUTHORS COPYING ChangeLog README
152
153 cd ${S}/tt
154 docinto tools
155 dodoc history.txt linux_readme.txt readme.txt tooldocs.txt
156
157 exeinto /usr/ti-linux-gnu/tigcc-bin/${GCC_VER}
158 # install gcc
159 cd ${WORKDIR}/build/gcc
160 doexe gcc/cc1
161 newexe gcc/xgcc gcc
162 dosym /usr/ti-linux-gnu/tigcc-bin/${GCC_VER}/gcc /usr/ti-linux-gnu/tigcc-bin/${GCC_VER}/ti-linux-gnu-gcc
163
164 # install gas
165 # exeinto /usr/ti-linux-gnu/bin <-- a symlink will be created so that gas resides in /usr/ti-linux-gnu/bin too
166 cd ${WORKDIR}/build/binutils
167 newexe gas/as-new as
168
169 # install a68k
170 cd ${S}/sources/a68k/src
171 newexe A68k a68k
172
173 # install ld-tigcc
174 cd ${S}/sources/ld-tigcc
175 doexe ld-tigcc
176 doexe ar-tigcc
177
178 # install tigcc
179 cd ${S}/sources/tigcc/src
180 doexe tigcc
181 dosym /usr/ti-linux-gnu/tigcc-bin/${GCC_VER}/tigcc /usr/ti-linux-gnu/tigcc-bin/${GCC_VER}/ti-linux-gnu-tigcc
182
183 # install tprbuilder
184 cd ${S}/sources/tprbuilder/src
185 doexe tprbuilder
186
187 # install patcher
188 cd ${S}/sources/patcher/src
189 doexe patcher
190
191 # install parser
192 cd ${S}/sources/parser/src
193 doexe parser
194
195 # install tict tool suite
196 cd ${S}/tt
197 doexe linuxbin/*
198
199 # install header files
200 dodir /usr/include/tigcc
201 cp -R ${S}/tigcclib/include/* ${D}/usr/include/tigcc
202 dosym /usr/include/tigcc/asm/os.h /usr/include/tigcc/asm/OS.h
203
204 insinto /usr/lib/gcc-lib/ti-linux-gnu/${GCC_VER}
205 # install library
206 cd ${S}/tigcclib
207 doins lib/*
208 cd ${WORKDIR}
209 doins flashosa/flashos.a
210 doins fargo.a
211
212 dodir /usr/share/tigcc
213 # copy example programs
214 cp -r ${S}/examples ${D}/usr/share/tigcc
215
216 # create TIGCC env variable
217 dodir /etc/env.d/gcc
218 # echo -e "TIGCC=\"/usr/ti-linux-gnu/tigcc-bin/${GCC_VER}\"" >> ${ENV_FILE}
219 # echo -e "CC=\"tigcc\"" >> ${ENV_FILE}
220 echo -e "TIGCC=\"/usr/ti-linux-gnu\"" >> ${ENV_FILE}
221 echo -e "PATH=\"/usr/ti-linux-gnu/tigcc-bin/${GCC_VER}:/usr/ti-linux-gnu/bin\"" >> ${ENV_FILE}
222 echo -e "ROOTPATH=\"/usr/ti-linux-gnu/tigcc-bin/${GCC_VER}:/usr/ti-linux-gnu/bin\"" >> ${ENV_FILE}
223 echo -e "LDPATH=\"/usr/lib/gcc-lib/ti-linux-gnu/${GCC_VER}\"" >> ${ENV_FILE}
224
225 # a cross-compiling gcc with hard-coded names has been built.
226 # therefore, we must place some symlinks.
227 dosym /usr/include/tigcc /usr/ti-linux-gnu/include
228 dosym /usr/lib/gcc-lib/ti-linux-gnu/${GCC_VER} /usr/ti-linux-gnu/lib
229 dosym /usr/share/doc/${PF} /usr/ti-linux-gnu/doc
230 dosym /usr/ti-linux-gnu/tigcc-bin/${GCC_VER} /usr/ti-linux-gnu/bin
231 }
232
233 pkg-postinst() {
234 env-update && source /etc/profile
235 }

  ViewVC Help
Powered by ViewVC 1.1.20