# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:filetype=tcl:et:sw=4:ts=4:sts=4

PortSystem          1.0
PortGroup           gitlab 1.0
PortGroup           meson 1.0

gitlab.instance     https://source.puri.sm
gitlab.setup        Librem5 libcmatrix 0.0.2 v
revision            0
categories          devel
license             LGPL-2.1+
maintainers         nomaintainer

description         Matrix client library
long_description    {*}${description} written in GObjectified C.
use_bzip2           yes

checksums           rmd160  3a51b43627f6f3bb9f05a3966a43ff1111509102 \
                    sha256  7edf81dd0893a85f8ebd0a666addd0d059f6f4a76f534ffc0f61c48c2b7ea542 \
                    size    126316

meson.wrap_mode     nodownload

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

# It uses libsoup3: https://gitlab.gnome.org/World/Chatty/-/issues/727
depends_lib-append  port:gettext-runtime \
                    path:lib/pkgconfig/glib-2.0.pc:glib2 \
                    path:lib/pkgconfig/gobject-introspection-1.0.pc:gobject-introspection \
                    port:json-glib \
                    port:libgcrypt \
                    port:libsecret \
                    path:lib/pkgconfig/libsoup-3.0.pc:libsoup \
                    port:olm \
                    port:sqlite3

# At least on macOS 13 this fails otherwise:
# ld: malformed 32-bit x.y.z version number: 0u
patchfiles-append   patch-fix-dylib-ver.diff

# Build uses gnu18 standard.
compiler.c_standard 2017

configure.args-append \
                    -Dbuild-examples=false \
                    -Dbuild-tests=false \
                    -Dgtk_doc=false \
                    -Dintrospection=true
