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

codeberg.setup      skyjake lagrange 2.0.4 v
revision            0
categories          net gemini
license             BSD
maintainers         {@sikmir disroot.org:sikmir} openmaintainer

description         A Beautiful Gemini Client
long_description    {*}${description}

checksums           rmd160  724ee481e8ea09fb3bc7cc472d5b3f1573c29330 \
                    sha256  ac6e8b187718365b7c80d867d73da2dd1cd077c996a3c8a76c4f482d88368ee2 \
                    size    4830346

worksrcdir          ${name}

depends_build-append \
                    port:pkgconfig \
                    port:zip
depends_lib-append  port:the_Foundation \
                    port:fribidi \
                    path:lib/pkgconfig/harfbuzz.pc:harfbuzz \
                    port:libjxl \
                    port:SDL3 \
                    port:mpg123 \
                    port:opusfile  \
                    port:webp

destroot {
    copy ${build.dir}/app/Lagrange.app ${destroot}${applications_dir}
}

variant tui description {Build the TUI interface} {
    configure.args-append \
                    -DENABLE_TUI=YES

    depends_lib-append \
                    port:ncurses \
                    port:sealcurses

    post-destroot {
        copy ${build.dir}/app/clagrange ${destroot}${prefix}/bin
        file mkdir ${destroot}${prefix}/share/lagrange
        copy ${build.dir}/app/Lagrange.app/Contents/Resources/resources.lgr ${destroot}${prefix}/share/lagrange
    }
}

compiler.c_standard 2011
compiler.blacklist-append {clang < 800}
