# -*- 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           compiler_blacklist_versions 1.0
PortGroup           legacysupport 1.1
PortGroup           makefile 1.0
PortGroup           codeberg 1.0

codeberg.setup      grunfink snac2 2.73
name                snac
revision            0

categories          net
license             MIT
maintainers         {@artkiver gmail.com:artkiver} openmaintainer
description         A simple, minimalistic ActivityPub instance
long_description    snac Social Networks Are Crap \
                    This program is written in highly portable C. \
                      Features from the README.md: \
                    - Lightweight, minimal dependencies \
                    - Extensive support of ActivityPub operations, e.g. write public notes, follow users, be followed, reply to the notes of others, admire wonderful content (like or boost), write private messages... \
                    - Simple but effective web interface \
                    - Multiuser \
                    - Mastodon API support, so Mastodon-compatible apps can \
                      be used (work in progress) \
                    - Simple but effective web interface \
                    - Easily-accessed MUTE button to silence morons \
                    - Tested interoperability with related software \
                    - No database needed \
                    - Totally JavaScript-free \
                    - No cookies either \
                    - Not much bullshit

checksums           rmd160  4571938946611ccf5f68addea2eab0ee9d8fe1e6 \
                    sha256  b4ebba0d7990690ba5027d855b9d595d029993fc82d2c4edd99c9159b826d9da \
                    size    234987
depends_lib         path:lib/libssl.dylib:openssl \
                    port:curl

worksrcdir          ${name}2

patchfiles          Makefile.patch

platform darwin {
    configure.cflags-append \
                    -Dst_mtim=st_mtimespec -Dst_ctim=st_ctimespec
}

# data.c: error: ‘for’ loop initial declaration used outside C99 mode
configure.cflags-append \
                    -std=c99

# error: 'cleanup' function '_xs_destroy' parameter has
# type 'char **' which is incompatible with type 'X509_STORE **'
# (aka 'struct x509_store_st **') on macOS < 10.14
compiler.blacklist-append \
                    {clang < 1001}

variant nomastodon description {omit Mastodon API support} {
configure.cflags-append \
                    -Dst_mtim=st_mtimespec -Dst_ctim=st_ctimespec -DNO_MASTODON_API
}

livecheck.type      regex
livecheck.url       https://codeberg.org/grunfink/snac2/tags
livecheck.regex     {/grunfink/snac2/releases/tag/(\d+\.\d+)}
