summaryrefslogtreecommitdiff
blob: 89d5199c64dad1503f162963700a9b7aae9c06cf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-embedded/sdcc-svn/sdcc-svn-2.5.0.ebuild,v 1.2 2007/09/14 08:56:31 dragonheart Exp $

ESVN_REPO_URI="https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc"

inherit subversion

DESCRIPTION="Small device C compiler (for various microprocessors, sources from Subversion repository)"
HOMEPAGE="http://sdcc.sourceforge.net/"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64 ~ppc ~x86"
IUSE="doc"

DEPEND=">=dev-embedded/gputils-0.13.2
	dev-libs/boehm-gc
	doc? ( >=app-office/lyx-1.3.4 )"
RDEPEND="!dev-embedded/sdcc
	!dev-embedded/sdcc-cvs"

src_unpack() {
	subversion_src_unpack
	cd ${S}

	# Fix conflicting variable names between Gentoo and sdcc
	find ./ -type f -exec sed -i s:PORTDIR:PORTINGDIR:g  {} \; || die "sed failed"
	find device/lib/pic*/ -type f -exec sed -i s:ARCH:SDCCARCH:g  {} \; || die "sed failed"
	find device/lib/pic/libdev/ -type f -exec sed -i s:CFLAGS:SDCCFLAGS:g  {} \; || die "sed failed"

	# --as-needed fix :
	sed -i -e "s/= @CURSES_LIBS@ @LIBS@/= @CURSES_LIBS@ @LIBS@ -lcurses/" sim/ucsim/gui.src/serio.src/Makefile.in || die "sed failed"
}

src_compile() {
	econf --enable-libgc docdir=/usr/share/doc/${PF} || die "Configure failed"
	emake || die "Make failed"
	if use doc ; then
		cd doc
		lyx -e html cdbfileformat
		lyx -e html sdccman
		lyx -e html test_suite_spec
	fi
}

src_install() {
	emake DESTDIR=${D} install || die "Make install failed"
	if use doc ; then
		cd doc
		insinto /usr/share/doc/${PF}
		doins cdbfileformat.html sdccman.html test_suite_spec.html
	fi
}