dev-embedded/sdcc: Dropped ppc keywords
[gentoo.git] / dev-embedded / sdcc / sdcc-2.7.0.ebuild
1 # Copyright 1999-2014 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 DESCRIPTION="Small device C compiler (for various microprocessors)"
5 HOMEPAGE="http://sdcc.sourceforge.net/"
6 SRC_URI="mirror://sourceforge/sdcc/${PN}-src-${PV}.tar.bz2
7         doc? ( mirror://sourceforge/sdcc/${PN}-doc-${PV}.tar.bz2 )"
8
9 LICENSE="GPL-2"
10 SLOT="0"
11 KEYWORDS="~amd64 ~x86"
12 IUSE="doc"
13
14 DEPEND=">=dev-embedded/gputils-0.13.2
15         dev-libs/boehm-gc"
16 RDEPEND="!dev-embedded/sdcc-svn"
17
18 S=${WORKDIR}/${PN}
19
20 src_unpack() {
21         unpack ${A}
22         cd "${S}"
23
24         # Fix conflicting variable names between Gentoo and sdcc
25         find ./ -type f -exec sed -i s:PORTDIR:PORTINGDIR:g  {} \; || die "sed failed"
26         find device/lib/pic*/ -type f -exec sed -i s:ARCH:SDCCARCH:g  {} \; || die "sed failed"
27         find device/lib/pic/libdev/ -type f -exec sed -i s:CFLAGS:SDCCFLAGS:g  {} \; || die "sed failed"
28
29         # --as-needed fix :
30         sed -i -e "s/= @CURSES_LIBS@ @LIBS@/= @CURSES_LIBS@ @LIBS@ -lcurses/" sim/ucsim/gui.src/serio.src/Makefile.in || die "sed failed"
31 }
32
33 src_compile() {
34         econf --enable-libgc docdir=/usr/share/doc/${PF} || die "configure failed"
35         emake || die "emake failed"
36 }
37
38 src_install() {
39         make DESTDIR="${D}" install || die "Install failed"
40         dodoc ChangeLog
41         if use doc ; then
42                 cp -pPR "${WORKDIR}"/doc/* "${D}"/usr/share/doc/${PF}/
43         fi
44         find "${D}"/usr/share/doc/${PF}/ -name *.txt -exec gzip -f -9 {} \;
45         find "${D}"/usr/share/doc/${PF}/ -name */*.txt -exec gzip -f -9 {} \;
46 }