1 # Copyright 1999-2012 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
7 inherit autotools eutils
9 if [[ "${PV}" == "9999" ]]; then
12 EGIT_REPO_URI="git://git.savannah.nongnu.org/${PN}.git"
15 SRC_URI="http://download.savannah.nongnu.org/releases/${PN}/${P}.tar.gz"
18 DESCRIPTION="A simulator for the Atmel AVR family of microcontrollers"
19 HOMEPAGE="http://www.nongnu.org/${PN}/"
24 IUSE="doc python static-libs tcl verilog"
26 RDEPEND="sys-libs/ncurses"
29 doc? ( app-doc/doxygen[dot] dev-python/sphinx )
30 python? ( >=dev-lang/python-2.4 )
31 tcl? ( dev-lang/tcl dev-tcltk/itcl )
32 verilog? ( sci-electronics/iverilog )"
35 if ! has_version cross-avr/gcc; then
37 eerror "${PN} requires avr-gcc >= 4.3.4 to be installed."
38 eerror "You can install it by running:"
39 eerror " # crossdev -t avr"
43 if ! has_version cross-avr/binutils; then
45 eerror "${PN} requires avr binutils >= 2.20 to be installed."
46 eerror "You can install it by running:"
47 eerror " # crossdev -t avr"
49 die "Missing avr binutils"
54 epatch "${FILESDIR}/${PV}"-*.patch
55 if [[ "${PV}" == "9999" ]]; then
61 local my_conf="--enable-dependency-tracking"
62 local BINUTILS=$(binutils-config --get-current-profile avr)
63 local BINUTILS_CONFIG="/etc/env.d/binutils/${BINUTILS}"
64 local BINUTILS_PATH=$(sed -n 's/^LIBPATH="\(.*\)"$/\1/p' "${BINUTILS_CONFIG}")
65 my_conf="${my_conf} --with-bfd=${BINUTILS_PATH}"
66 my_conf="${my_conf} $(use_enable python)"
67 my_conf="${my_conf} $(use_enable static-libs static)"
68 my_conf="${my_conf} $(use_enable tcl)"
69 my_conf="${my_conf} $(use_enable verilog)"
70 my_conf="${my_conf} $(use_enable doc doxygen-doc)"
71 my_conf="${my_conf} $(use_enable doc doxygen-html)"
72 LDFLAGS="-Wl,-rpath=${BINUTILS_PATH},--enable-new-dtags ${LDFLAGS}" econf ${my_conf} --docdir="${EPREFIX}/usr/share/doc/${PF}"
84 emake DESTDIR="${D}" install
85 dodoc NEWS README* AUTHORS SUPPORT TODO ChangeLog
87 dohtml -r doc/web_build/html/*
88 _E_DOCDESTTREE_="doxygen" dohtml -r doc/doxygen-doc/html/*