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

# getline, fmemopen
legacysupport.newest_darwin_requires_legacy 10

sourcehut.setup     sircmpwn gmni 1.0
categories          net gemini
license             BSD
maintainers         nomaintainer
description         ${name} is a Gemini client
long_description    ${description}
checksums           rmd160  a8c4d5c88e5811b240d148c1fa1db6e28c8298fa \
                    sha256  cdd091f0330a38d65831bafd41f40cec283e67a6530fbf01284fe1bbc1ed20e4 \
                    size    49877

patchfiles          patch-Makefile.diff

depends_lib-append  port:bearssl

compiler.c_standard 2011

# src/url.c:1026:24: error: 'calloc' sizes specified with 'sizeof' in the earlier argument and not in the later argument [-Werror=calloc-transposed-args]
configure.cflags-append \
                    -Wno-error=calloc-transposed-args
configure.cppflags-append \
                    -D_DARWIN_C_SOURCE

post-patch {
    reinplace "s|@@CFLAGS@@|${configure.cppflags} ${configure.cflags}|" ${worksrcpath}/config.sh
    reinplace "s|@@LDFLAGS@@|${configure.ldflags}|" ${worksrcpath}/config.sh
}
