# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4

PortSystem              1.0
PortGroup               github 1.0

github.setup            avrdudes avr-libc 2_3_2 avr-libc- -release
version                 [string map {_ .} ${github.version}]
revision                0

categories              cross
license                 BSD
platforms               any
supported_archs         noarch
homepage                https://avrdudes.github.io/avr-libc
maintainers             nomaintainer

description             C library for the AVR microcontroller
long_description        AVR Libc is a Free Software project whose goal is to \
                        provide a high quality C library for use with GCC on \
                        Atmel AVR microcontrollers.

depends_lib-append      port:avr-binutils \
                        port:avr-gcc

distname                ${name}-${version}

checksums               rmd160  08e9c2610ff83f9679961dea587015bf7ed10b36 \
                        sha256  92eb253d30cec94f2861a82d40d0b17ad79c0d95fce32b74ffccc26a70afb150 \
                        size    11303422

use_bzip2               yes

configure.cc            avr-gcc
configure.args          --build=`./config.guess` \
                        --host=avr

build.type              gnu

test.run                yes
test.target             check

# installs deliberately files outside regular tree:
destroot.violate_mtree  yes

post-destroot {
    set destdocdir  ${destroot}${prefix}/share/doc/${name}

    xinstall -d ${destdocdir}
    xinstall -m 644 \
        ${worksrcpath}/AUTHORS \
        ${worksrcpath}/INSTALL \
        ${worksrcpath}/LICENSE \
        ${worksrcpath}/NEWS \
        ${worksrcpath}/NEWS.md \
        ${worksrcpath}/README.md \
        ${destdocdir}
}
