# -*- 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           cmake 1.1
PortGroup           muniversal 1.0

name                uncrustify
version             0.77.1
categories          devel
maintainers         nomaintainer
license             GPL-2

description         Source code beautifier

long_description    Banish crusty code with the Uncrustify \
                    C/C++/C#/D/Java/Pawn source code beautifier. It indents, \
                    adds newlines, aligns etc., and is highly configurable.

homepage            https://uncrustify.sourceforge.net
# Not a typo here, upstream forgot a dot:
master_sites        sourceforge:project/uncrustify/uncrustify-077.1

checksums           rmd160  a40612e339046073d0a577c746777e15afe1b327 \
                    sha256  939d50c8206a5e016a09947d51bb64b8a4275d89181efc484f44d5e5c3e66666 \
                    size    1687101

set py_ver          3.11
set py_ver_nodot    [string map {. {}} ${py_ver}]
depends_build-append \
                    port:python${py_ver_nodot}

compiler.cxx_standard   2011

configure.python    ${prefix}/bin/python${py_ver}

configure.args      -DPYTHON_EXECUTABLE=${configure.python}

post-destroot {
    set docdir ${prefix}/share/doc/${name}
    xinstall -d ${destroot}${docdir}
    copy ${worksrcpath}/documentation ${destroot}${docdir}
}

livecheck.type      regex
livecheck.url       https://sourceforge.net/projects/uncrustify/files/
livecheck.regex     "${name}-(\\d+(?:\\.\\d+)*)"