# -*- 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           gitlab 1.0
PortGroup           python 1.0

gitlab.instance     https://dev.gajim.org
gitlab.setup        gajim gajim 1.9.5
revision            0

categories          net chat x11
license             GPL-3

description         A full featured and easy to use Jabber client.
long_description    The goal of Gajim is to provide a full featured and \
                    easy to use Jabber client. Gajim works nicely with \
                    GNOME, but does not require it to run.

maintainers         nomaintainer

platforms           {darwin any}
supported_archs     noarch

master_sites        https://dev.gajim.org/gajim/gajim/-/archive/${version}/
use_bzip2           yes

checksums           rmd160  cd66dfbef7aedd185ff325527d687a41ca8bc82c \
                    sha256  ccf17fe078fdab46244aa3de7cb691d17e2b0cccf6b29a923b029242927ebd65 \
                    size    3141790

variant python310 conflicts python311 python312 description {Use Python 3.10} {}
variant python311 conflicts python310 python312 description {Use Python 3.11} {}
variant python312 conflicts python310 python311 description {Use Python 3.12} {}

if {![variant_isset python310] && ![variant_isset python311]} {
    default_variants +python312
}

foreach pv {312 311 310} {
    if {[variant_isset python${pv}]} {
        python.default_version ${pv}
        break
    }
}

depends_build-append \
                    port:gettext \
                    port:intltool \
                    port:libtool \
                    path:bin/pkg-config:pkgconfig

depends_lib-append  port:adwaita-icon-theme \
                    path:lib/pkgconfig/gtk+-3.0.pc:gtk3 \
                    port:gtksourceview4 \
                    path:lib/pkgconfig/librsvg-2.0.pc:librsvg \
                    path:lib/pkgconfig/libsoup-3.0.pc:libsoup \
                    port:py${python.version}-certifi \
                    port:py${python.version}-css-parser \
                    port:py${python.version}-emoji \
                    port:py${python.version}-idna \
                    port:py${python.version}-keyring \
                    port:py${python.version}-nbxmpp \
                    port:py${python.version}-omemo-dr \
                    port:py${python.version}-Pillow \
                    port:py${python.version}-pypng \
                    port:py${python.version}-qrcode \
                    port:py${python.version}-sqlalchemy

# https://dev.gajim.org/gajim/gajim/-/issues/11966
if {${os.platform} eq "darwin" && ${os.major} > 12} {
    depends_run-append \
                    port:py${python.version}-pyobjc
} else {
    patchfiles-append \
                    0001-Avoid-non-existing-unsupported-AppKit-module.patch
}

depends_run-append  port:libayatana-appindicator
