# -*- 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           gitea 1.0
PortGroup           compiler_blacklist_versions 1.0

gitea.domain        git.skyjake.fi
gitea.setup         gemini lagrange 1.17.3 v
revision            0
categories          net gemini
license             BSD
maintainers         {@sikmir disroot.org:sikmir} openmaintainer

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

checksums           rmd160  85f681b2be154e2a568d324bb947288484a9867d \
                    sha256  4b97941b57a2c71dba2c17e9a0165c6b6e22396a0b16a375ec7dda6e165f52e7 \
                    size    7730821

worksrcdir          ${name}

depends_build-append \
                    port:pkgconfig \
                    port:zip
depends_lib-append  port:the_Foundation

variant gui conflicts tui description {Build the GUI interface} {
    depends_lib-append \
                    port:fribidi \
                    path:lib/pkgconfig/harfbuzz.pc:harfbuzz \
                    port:libsdl2 \
                    port:mpg123 \
                    port:webp

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

variant tui conflicts gui description {Build the TUI interface} {
    configure.args-append \
                    -DENABLE_TUI=YES \
                    -DENABLE_MPG123=NO \
                    -DENABLE_WEBP=NO \
                    -DENABLE_FRIBIDI=NO \
                    -DENABLE_HARFBUZZ=NO \
                    -DENABLE_POPUP_MENUS=NO \
                    -DENABLE_IDLE_SLEEP=NO

    depends_lib-append \
                    port:ncurses \
                    port:sealcurses
}

default_variants    +gui

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