# -*- 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 1.21.1 v
revision            0
categories          net gemini
license             BSD
maintainers         {@sikmir disroot.org:sikmir} openmaintainer

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

checksums           rmd160  08ce193b4ec389e7a05783c57a165631b6ecd938 \
                    sha256  2746f8d1e285c2f404fb7cd32098a5007176ebe6958d77186a504c4b4663d67d \
                    size    9842322

worksrcdir          ${name}

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

destroot {
    copy ${build.dir}/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}/clagrange ${destroot}${prefix}/bin
        file mkdir ${destroot}${prefix}/share/lagrange
        copy ${build.dir}/Lagrange.app/Contents/Resources/resources.lgr ${destroot}${prefix}/share/lagrange
    }
}

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