# -*- 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           cmake 1.1
PortGroup           qt5 1.0
PortGroup           boost 1.0

github.setup        nheko-reborn nheko 0.11.3 v
revision            5
checksums           rmd160  a25950b5483becc488ccc42b32bb9c6913a64ff8 \
                    sha256  f285156884a3a0c6870f3fba89c13d1fd70c8727bd179d8310b13819f8a63a37 \
                    size    1780179

categories          net chat
platforms           {darwin >= 16}
license             GPL-3
maintainers         nomaintainer
description         A matrix chat client
long_description    Nheko is a native desktop matrix \
                    chat client. It aims to be more \
                    like a chat app and less like an \
                    IRC client

github.tarball_from archive

compiler.cxx_standard  2020
# base does not yet know about c++20 so manually blacklist Xcode clangs for now
compiler.blacklist-append clang
compiler.thread_local_storage yes

configure.cppflags-append -I${prefix}/include/lmdbxx-cxx17
configure.cxxflags-append -fno-sized-deallocation

depends_build-append \
                    port:lmdbxx-cxx17 \
                    port:tweeny

depends_lib-append  \
                    port:cmark \
                    port:coeurl \
                    port:fontconfig \
                    port:libsodium \
                    port:lmdb \
                    port:mtxclient \
                    port:nlohmann-json \
                    port:olm \
                    port:qtkeychain-qt5 \
                    port:spdlog-fmt8

qt5.depends_component \
                    qtmacextras \
                    qtmultimedia \
                    qtquickcontrols2 \
                    qtsvg \
                    qttools

patchfiles          MacNotificationDelegate.mm.patch

# Match libfmt version with spdlog once there's a new release
cmake.module_path-append \
                    ${prefix}/lib/libfmt8/cmake \
                    ${prefix}/libexec/spdlog-fmt8/lib/cmake

destroot {
    copy ${build.dir}/nheko.app ${destroot}${applications_dir}/Nheko.app
}
