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

legacysupport.newest_darwin_requires_legacy 10

github.setup        barracuda156 shigoku 35aa7a5bacc43f64cfb9441873656abab37652bf
version             0.1.0
revision            1
categories          www multimedia anime manga
license             GPL-3+
maintainers         {@barracuda156 macos-powerpc.org:barracuda}
description         Terminal anime browser/player (C++23 port of sabigoku)
long_description    shigoku is a keyboard-driven terminal UI for browsing anime \
                    via AniList, resolving streams through pluggable providers, \
                    and playing them in mpv — with Kitty-graphics cover art, \
                    SQLite-backed resume/watch history, and truecolor rendering. \
                    This is the P0-P9 walking skeleton: browse -> search -> \
                    episode grid -> play -> resume, covers and persistence.

checksums           rmd160  0412bf91db7d9204a2c169808427f7a7c11ec670 \
                    sha256  56bf103f1d8b59df0c93ea0ccb01ad3719784e00985cd6e65b5d652095cc0f11 \
                    size    1256768
github.tarball_from archive

installs_libs       no

depends_build-append \
                    port:nlohmann-json \
                    path:bin/pkg-config:pkgconfig

depends_lib-append  port:curl \
                    port:libsdl2 \
                    port:sqlite3 \
                    port:webp

depends_run-append  port:curl-impersonate \
                    path:bin/mpv:mpv-devel

compiler.cxx_standard   2023

configure.args-append \
                    -DCMAKE_BUILD_TYPE=Release \
                    -DSHIGOKU_SYSTEM_DOCTEST=OFF \
                    -DSHIGOKU_SYSTEM_NLOHMANN_JSON=ON \
                    -DSHIGOKU_SYSTEM_STB=OFF \
                    -DSHIGOKU_SYSTEM_TL_EXPECTED=OFF \
                    -DSHIGOKU_WERROR=OFF

if {[string match *gcc* ${configure.compiler}] && ${configure.build_arch} in [list arm i386 ppc]} {
    configure.ldflags-append \
                    -latomic
}

destroot {
    xinstall -m 0755 ${cmake.build_dir}/shigoku ${destroot}${prefix}/bin/
    xinstall -m 0755 ${cmake.build_dir}/shigoku-manga ${destroot}${prefix}/bin/
    xinstall -m 0755 ${cmake.build_dir}/shigoku-view ${destroot}${prefix}/bin/
}

test.run            yes
