1 # Copyright 1999-2014 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
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 )"
11 KEYWORDS="~amd64 ~x86"
14 DEPEND=">=dev-embedded/gputils-0.13.2
16 RDEPEND="!dev-embedded/sdcc-svn"
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"
30 sed -i -e "s/= @CURSES_LIBS@ @LIBS@/= @CURSES_LIBS@ @LIBS@ -lcurses/" sim/ucsim/gui.src/serio.src/Makefile.in || die "sed failed"
34 econf --enable-libgc docdir=/usr/share/doc/${PF} || die "configure failed"
35 emake || die "emake failed"
39 make DESTDIR="${D}" install || die "Install failed"
42 cp -pPR "${WORKDIR}"/doc/* "${D}"/usr/share/doc/${PF}/
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 {} \;