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

github.setup        profanity-im profanity 0.14.0
revision            0

categories          net
maintainers         {judaew @judaew} openmaintainer
description         A console-based XMPP client written in C using ncurses
long_description    Profanity is a console based XMPP client written in C using \
                    ncurses and libstrophe, inspired by Irssi.
homepage            https://profanity-im.github.io
license             {GPL-3+ OpenSSLException}
github.tarball_from archive
checksums           rmd160  f7aea8953a2be677e79b115e596dcc60995d7bff \
                    sha256  e8c28a1ec36d8d9e81ca62a91ec0f1c6db888f1b22c9c4b6cdbfce0de4ad711d \
                    size    600430

depends_build-append \
                    path:bin/pkg-config:pkgconfig \
                    port:libtool \
                    port:autoconf-archive

# test dependencies checked at configure
depends_build-append \
                    port:cmocka

depends_lib-append  path:lib/pkgconfig/glib-2.0.pc:glib2 \
                    port:curl \
                    port:expat \
                    port:gpgme \
                    port:libassuan \
                    port:libgcrypt \
                    port:libgpg-error \
                    port:libotr \
                    port:libsignal-protocol-c \
                    port:libstrophe \
                    port:ncurses \
                    port:python312 \
                    port:readline

# allow pkg-config to find specifig version of python-embed.pc
patchfiles-append   patch-configure.ac.diff

use_autoreconf      yes
use_automake        yes

configure.args      --disable-silent-rules \
                    --enable-omemo \
                    --enable-pgp \
                    --enable-otr \
                    --enable-plugins \
                    --enable-c-plugins \
                    --enable-python-plugins

# specify a python version
configure.args-append  \
                    PYTHON_FRAMEWORK=${frameworks_dir}/Python.framework \
                    PYTHON=${prefix}/bin/python3.10

variant notifications description {Enable terminal-notifier for notifications} {
    depends_lib-append     port:terminal-notifier
    configure.args-append  --enable-notifications
}
