/[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.8 - (show annotations) (download)
Mon Apr 30 02:53:44 2012 UTC (2 years, 7 months ago) by vapier
Branch: MAIN
Changes since 1.7: +2 -3 lines
Drop old versions and stabilize newer ones as current stable fails to build #83676 #151569.

(Portage version: 2.2.0_alpha100/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-embedded/tigcc/tigcc-0.95_p3.ebuild,v 1.7 2012/02/06 03:10:58 vapier 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="~amd64 ~ppc ~x86"
31 IUSE=""
32
33 RDEPEND=">=sys-devel/binutils-2.14.90.0.6-r1"
34 DEPEND="${RDEPEND}
35 app-arch/unzip
36 >=sys-devel/bison-1.875"
37
38 src_unpack() {
39 unpack ${A}
40 # start by patching binutils and gcc
41 cd ${WORKDIR}/binutils-${BASE_BINUTILS}
42 epatch ${S}/sources/gcc/gas-${BIN_VER}-tigcc-*.diff
43
44 cd ${WORKDIR}/gcc-${BASE_GCC}
45 epatch ${S}/sources/gcc/gcc-${BASE_GCC}-tigcc-*.diff
46
47 # a68k didn't compile, this should fix it.
48 cd ${S}
49 epatch ${FILESDIR}/a68k-fix.patch
50
51 # fixes a bug in tprbuilder, needed for 0.95_beta8-r1
52 # epatch ${FILESDIR}/tprbuilder-fix.patch
53
54 # make build directories for binutils and gcc
55 mkdir -p ${WORKDIR}/build/binutils
56 mkdir ${WORKDIR}/build/gcc
57 }
58
59 src_compile() {
60 # build binutils
61 cd ${WORKDIR}/build/binutils
62 CFLAGS="$CFLAGS" ${WORKDIR}/binutils-${BASE_BINUTILS}/configure \
63 --disable-serial-configure --target=m68k-coff --disable-shared \
64 --enable-static --disable-multilib --disable-nls \
65 || die
66 emake || die
67
68 # build gcc
69 cd ${WORKDIR}/build/gcc
70
71 # --with-headers=${S}/tigcclib/include/c \
72 CFLAGS="$CFLAGS" ${WORKDIR}/gcc-${BASE_GCC}/configure --target=m68k-coff \
73 --with-gnu-as --with-as=${WORKDIR}/build/binutils/gas/as-new --with-gnu-ld \
74 --disable-nls --disable-multilib --disable-shared --enable-static \
75 --disable-threads \
76 || die
77 # GCC compilations _is intended_ to fail on a certain point, don't worry about that.
78 emake
79
80 # build a68k assembler
81 cd ${S}/sources/a68k/src
82 emake -e || die
83
84 # build ld-tigcc linker
85 cd ${S}/sources/ld-tigcc
86 emake -e || die
87
88 # build tigcc front-end
89 cd ${S}/sources/tigcc/src
90 emake -e || die
91
92 # build tprbuilder (TIGCC project builder)
93 cd ${S}/sources/tprbuilder/src
94 emake -e || die
95
96 # build patcher (object file patcher)
97 cd ${S}/sources/patcher/src
98 emake -e || die
99
100 # build parser
101 cd ${S}/sources/parser/src
102 emake -e || die
103
104 # build tict tool suite
105 cd ${S}/tt
106 CFLAGS="$CFLAGS" ./makelinux.sh || die
107
108 # patch the script that launches the documentation browser to point to the correct location
109 sed "s:\$TIGCC/doc:/usr/share/doc/${P}:g" ${S}/tigcclib/doc/converter/tigccdoc > ${S}/tigcclib/doc/converter/tigccdoc.new
110 }
111
112 src_install() {
113 #ENV_FILE=${D}/etc/env.d/gcc/ti-linux-gnu-${GCC_VER}
114 ENV_FILE=${D}/etc/env.d/99tigcc
115
116 # install documentation
117
118 cd ${S}/tigcclib/doc/converter
119 into /usr
120 dodir /usr/bin
121 newbin tigccdoc.new tigccdoc
122
123 dodir /usr/share/doc/${PF}
124 cd ${S}
125 dodoc AUTHORS BUGS CHANGELOG COPYING DIRECTORIES HOWTO INSTALL README README.linux README.osX
126
127 cd ${S}/tigcclib/doc
128 dohtml -r html/*.html
129 cp html/qt-assistant.adp ${D}/usr/share/doc/${PF}/html
130
131 cd ${S}/sources/a68k
132 docinto a68k
133 dodoc docs/*.txt
134
135 cd ${S}/sources/tigcc
136 docinto tigcc
137 dodoc AUTHORS COPYING ChangeLog README
138
139 cd ${S}/sources/tprbuilder
140 docinto tprbuilder
141 dodoc AUTHORS COPYING ChangeLog README
142
143 cd ${S}/sources/patcher
144 docinto patcher
145 dodoc AUTHORS COPYING ChangeLog README
146
147 cd ${S}/sources/parser
148 docinto parser
149 dodoc AUTHORS COPYING ChangeLog README
150
151 cd ${S}/tt
152 docinto tools
153 dodoc history.txt linux_readme.txt readme.txt tooldocs.txt
154
155 exeinto /usr/ti-linux-gnu/tigcc-bin/${GCC_VER}
156 # install gcc
157 cd ${WORKDIR}/build/gcc
158 doexe gcc/cc1
159 newexe gcc/xgcc gcc
160 dosym /usr/ti-linux-gnu/tigcc-bin/${GCC_VER}/gcc /usr/ti-linux-gnu/tigcc-bin/${GCC_VER}/ti-linux-gnu-gcc
161
162 # install gas
163 # exeinto /usr/ti-linux-gnu/bin <-- a symlink will be created so that gas resides in /usr/ti-linux-gnu/bin too
164 cd ${WORKDIR}/build/binutils
165 newexe gas/as-new as
166
167 # install a68k
168 cd ${S}/sources/a68k/src
169 newexe A68k a68k
170
171 # install ld-tigcc
172 cd ${S}/sources/ld-tigcc
173 doexe ld-tigcc
174 doexe ar-tigcc
175
176 # install tigcc
177 cd ${S}/sources/tigcc/src
178 doexe tigcc
179 dosym /usr/ti-linux-gnu/tigcc-bin/${GCC_VER}/tigcc /usr/ti-linux-gnu/tigcc-bin/${GCC_VER}/ti-linux-gnu-tigcc
180
181 # install tprbuilder
182 cd ${S}/sources/tprbuilder/src
183 doexe tprbuilder
184
185 # install patcher
186 cd ${S}/sources/patcher/src
187 doexe patcher
188
189 # install parser
190 cd ${S}/sources/parser/src
191 doexe parser
192
193 # install tict tool suite
194 cd ${S}/tt
195 doexe linuxbin/*
196
197 # install header files
198 dodir /usr/include/tigcc
199 cp -R ${S}/tigcclib/include/* ${D}/usr/include/tigcc
200 dosym /usr/include/tigcc/asm/os.h /usr/include/tigcc/asm/OS.h
201
202 insinto /usr/lib/gcc-lib/ti-linux-gnu/${GCC_VER}
203 # install library
204 cd ${S}/tigcclib
205 doins lib/*
206 cd ${WORKDIR}
207 doins flashosa/flashos.a
208 doins fargo.a
209
210 dodir /usr/share/tigcc
211 # copy example programs
212 cp -r ${S}/examples ${D}/usr/share/tigcc
213
214 # create TIGCC env variable
215 dodir /etc/env.d/gcc
216 # echo -e "TIGCC=\"/usr/ti-linux-gnu/tigcc-bin/${GCC_VER}\"" >> ${ENV_FILE}
217 # echo -e "CC=\"tigcc\"" >> ${ENV_FILE}
218 echo -e "TIGCC=\"/usr/ti-linux-gnu\"" >> ${ENV_FILE}
219 echo -e "PATH=\"/usr/ti-linux-gnu/tigcc-bin/${GCC_VER}:/usr/ti-linux-gnu/bin\"" >> ${ENV_FILE}
220 echo -e "ROOTPATH=\"/usr/ti-linux-gnu/tigcc-bin/${GCC_VER}:/usr/ti-linux-gnu/bin\"" >> ${ENV_FILE}
221 echo -e "LDPATH=\"/usr/lib/gcc-lib/ti-linux-gnu/${GCC_VER}\"" >> ${ENV_FILE}
222
223 # a cross-compiling gcc with hard-coded names has been built.
224 # therefore, we must place some symlinks.
225 dosym /usr/include/tigcc /usr/ti-linux-gnu/include
226 dosym /usr/lib/gcc-lib/ti-linux-gnu/${GCC_VER} /usr/ti-linux-gnu/lib
227 dosym /usr/share/doc/${PF} /usr/ti-linux-gnu/doc
228 dosym /usr/ti-linux-gnu/tigcc-bin/${GCC_VER} /usr/ti-linux-gnu/bin
229 }

  ViewVC Help
Powered by ViewVC 1.1.20