/[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.5 - (hide annotations) (download)
Wed Sep 23 16:41:22 2009 UTC (5 years, 1 month ago) by patrick
Branch: MAIN
Changes since 1.4: +5 -6 lines
Remove virtual/libc
(Portage version: 2.2_rc41/cvs/Linux x86_64)

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

  ViewVC Help
Powered by ViewVC 1.1.20