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

PortSystem          1.0
PortGroup           github 1.0
PortGroup           legacysupport 1.1
PortGroup           makefile 1.0

# O_CLOEXEC
legacysupport.newest_darwin_requires_legacy 10
legacysupport.redirect_bins ytcui

github.setup        MilkmanAbi ytcui 48e6330b1181e3567d216eb9610054b3c75fbf28
version             4.0.0
revision            0
categories          www multimedia
license             MIT
maintainers         {@barracuda156 macos-powerpc.org:barracuda} openmaintainer

description         Light-weight terminal-based YouTube client
long_description    {*}${description} written in C++.

checksums           rmd160  3e1c8e70812278f6a0b72b2629e616f528d18a75 \
                    sha256  9921d418844ecab10562e1d4af48d6ae2b72ac39306e0d350357b8465c539905 \
                    size    844648
github.tarball_from archive

installs_libs       no

if {![variant_isset yt_dlp]} {
    PortGroup       openssl 1.0

    depends_lib-append \
                    port:curl
}

depends_build-append \
                    path:bin/pkg-config:pkgconfig

depends_lib-append  port:ncurses

depends_run-append  path:bin/mpv:mpv

if {![variant_isset sixel]} {
    depends_run-append \
                    port:chafa
}

compiler.cxx_standard   2017

platform darwin 8 {
    depends_build-append \
                    port:gmake
    build.cmd       gmake
}

variant sixel description "Use libsixel instead of chafa" {
    depends_lib-append \
                    port:libsixel

    build.args-append \
                    SIXEL=libsixel
}

variant yt_dlp description "Build with yt-dlp backend instead of the native one" {
    depends_run-append \
                    port:yt-dlp

    build.args-append \
                    BACKEND=ytdlp
}

default_variants    +sixel

# https://github.com/MilkmanAbi/ytcui/issues/1
notes "
    At the moment mlterm is not supported, please use some other terminal emulator.
    Also, you may need to set LC_ALL=C in some terminals.
"
