# $Id: Portfile 75344 2011-01-22 21:00:43Z landonf@macports.org $

PortSystem 1.0

name            avr-gdb
version         6.8
categories      cross
maintainers     nomaintainer
description     GDB for the AVR processors
long_description    avr-gdb is a version of the GNU Debugger that \
            through the avarice program can be used to debug \
            code for the AVR processors.
homepage        http://www.gnu.org/software/gdb/gdb.html
platforms       darwin
master_sites    gnu:gdb
distname        gdb-${version}
use_bzip2       yes
checksums       md5 c9da266b884fb8fa54df786dfaadbc7a \
                sha1 ba1394d59dd84a1dd3a83322bd82c799596f0bcf \
                rmd160 23fc9442290b6383ce8f943ef1eb117fa06e79fb
depends_run     bin:avarice:avarice

patchfiles      patch-atmega256x-gdb \
                patch-gdb::remote.c

# without --disable-nls the build process breaks
configure.args  --mandir=${prefix}/share/man \
                --infodir=${prefix}/share/info \
                --target=avr --disable-nls \
                --disable-werror

post-destroot {
    # Installing (host) libiberty was a mistake.
    foreach f [glob -directory "${destroot}${prefix}/lib" libiberty.a */libiberty.a] {
        file delete $f
    }
    file delete "${destroot}${prefix}/share/info/bfd.info"

    # Conflcts with autoconf and other gdb ports
    file delete -force "${destroot}/${prefix}/share/info"
}
