# -*- 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        dustinkirkland byobu 6.13
github.tarball_from archive

revision            0
categories          sysutils
platforms           any
supported_archs     noarch
license             GPL-3
maintainers         {l2dy @l2dy} openmaintainer

description         open source text-based window manager and terminal multiplexer
long_description    Byobu is a GPLv3 open source text-based window manager and \
                    terminal multiplexer. It was originally designed to provide \
                    elegant enhancements to the otherwise functional, plain, \
                    practical GNU Screen, for the Ubuntu server distribution. \
                    Byobu now includes an enhanced profiles, convenient \
                    keybindings, configuration utilities, and toggle-able system \
                    status notifications for both the GNU Screen window manager \
                    and the more modern Tmux terminal multiplexer, and works on \
                    most Linux, BSD, and Mac distributions.
homepage            https://www.byobu.org


checksums           rmd160  fcf8113f238fbbcad7e8aa7cd31135fcb643b324 \
                    sha256  9690c629588e8f95d16b2461950d39934faaf8005dd2a283886d4e3bd6c86df6 \
                    size    673874

set python.branch   3.13
set python.version  [string replace ${python.branch} 1 1]
set python.bin      ${prefix}/bin/python${python.branch}

depends_run         path:libexec/coreutils/libstdbuf.so:coreutils \
                    port:python${python.version} \
                    port:py${python.version}-libnewt \
                    port:tmux

# Use aclocal / autoconf / automake / etc.
use_autoreconf      yes

# Ensure unpacked folder uses correct naming for post-patch block below (worksrcpath)
extract.rename      yes

post-patch {
    reinplace -W ${worksrcpath}/usr/lib/byobu/include "s|python3|${python.bin}|g" \
        constants \
        config.py.in \
        select-session.py

    reinplace "s|df -|${prefix}/bin/gdf -|g" ${worksrcpath}/usr/lib/byobu/disk
}

