# -*- 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
PortGroup           legacysupport 1.1

github.setup        htop-dev htop 3.5.3
revision            0
epoch               1
categories          sysutils
maintainers         {cal @neverpanic} openmaintainer
license             GPL-2

description         interactive text-mode process viewer for Unix
long_description    ${name} is an {*}${description} systems. It aims to be a better 'top'.

homepage            https://htop.dev

checksums           rmd160  0683a4a72537c0a904f92c7185d51e45b8d01bd3 \
                    sha256  edf25ee020a5263ffbef9eef5a8c14392bf74e78b3d5c8bc64d9343dd9a82605 \
                    size    487377
github.tarball_from archive

depends_build-append \
                    port:autoconf \
                    port:automake \
                    port:libtool \
                    path:bin/pkg-config:pkgconfig

depends_lib-append  port:ncurses

pre-configure {
    system -W ${worksrcpath} "sh autogen.sh"
}

configure.args      --disable-unwind

# This is just a quick hack to allow the app to compile.
# It works on 10.5 then, but some system info will be lacking.
if {${os.platform} eq "darwin" && ${os.major} < 10} {
    patchfiles-append \
                    patch-DarwinProcess-leopard.diff
}

post-destroot {
    # Delete the .png and .desktop files
    foreach dir [list applications pixmaps] {
        delete ${destroot}${prefix}/share/${dir}
    }
}

# Exclude beta releases from livecheck
github.livecheck.regex  {([0-9.]+)}
