# -*- 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           stub 1.0

name                gutils-suite
version             1.1
revision            3

categories          sysutils
maintainers         {mascguy @mascguy} openmaintainer

description         Meta port encompassing the GNU utils suite, plus other useful ports
long_description    {*}${description}

# Leaf ports, not intended to be used as lib deps [for other ports]
supported_archs     noarch
platforms           any

subport ${name}-base {
    depends_lib-append \
                    path:lib/libMacportsLegacySupport.dylib:legacy-support-devel \
                    path:bin/rsync:rsync-hfscomp
}

subport ${name}-core {
    depends_lib-append \
                    port:${name}-base

    depends_run-append \
                    port:apple-completion \
                    port:bash \
                    port:bash-completion \
                    port:bc \
                    port:bison \
                    path:bin/cmake:cmake \
                    path:libexec/coreutils/libstdbuf.so:coreutils \
                    port:curl \
                    port:ddrescue \
                    port:diffutils \
                    port:dos2unix \
                    port:e2fsprogs \
                    path:libexec/gnubin/find:findutils \
                    port:file \
                    port:flex \
                    port:gawk \
                    port:gnetcat \
                    port:gnutar \
                    port:gpatch \
                    port:gmake \
                    port:grep \
                    port:gsed \
                    port:gtime \
                    port:hexdiff \
                    port:htop \
                    port:jdupes \
                    port:jq \
                    port:lbzip2 \
                    port:libxslt \
                    port:lrzip \
                    port:lzip \
                    port:memtester \
                    port:meson \
                    port:moreutils \
                    port:mpstats \
                    port:nmap \
                    port:openssh \
                    port:osxutils \
                    port:p7zip \
                    port:parallel \
                    port:pbzip2 \
                    port:pigz \
                    port:rdfind \
                    port:smartmontools \
                    port:sox \
                    port:symlinks \
                    port:tcl \
                    port:tcllib \
                    port:tclreadline \
                    port:tclx \
                    port:tree \
                    port:wget \
                    port:xz

    platform darwin {
        if { ${os.major} >= 10 } {
            depends_run-append \
                    port:afscompress \
                    port:ccache \
                    port:mtr \
                    port:vim
        }

        if { ${os.major} >= 11 } {
            depends_run-append \
                    port:trash
        }
    }
}

subport ${name}-extra {
    depends_lib-append \
                    port:${name}-core

    depends_run-append \
                    path:bin/ffmpeg:ffmpeg \
                    port:ffmpeg6 \
                    path:bin/git:git

    platform darwin {
        if { ${os.major} >= 10 } {
            depends_run-append \
                    port:yt-dlp
        }
    }
}

if { ${subport} eq ${name} } {
    depends_lib-append \
                    port:${name}-extra
}

livecheck.type      none
