# -*- 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
PortGroup           makefile 1.0

# strnlen
legacysupport.newest_darwin_requires_legacy 10

name                vgmi
github.setup        RealMelkor Vgmi e5078d2ec5a16a57b1e72b7df72b236d84b3435f
version             2.1-20251231
revision            0
categories          net gemini
license             ISC
maintainers         nomaintainer
description         Gemini client with vim-like keybindings
long_description    {*}${description}
homepage            https://rmf-dev.com/en/vgmi.html
checksums           rmd160  76cf4f28895768a9acfd01efcb26fd6af0a9491b \
                    sha256  302cbc08f36f56e7aabd84479c2accf0c4199b6775958f52e6915c6a2672339f \
                    size    342046
github.tarball_from archive
github.livecheck.branch lts-2.1

patchfiles          patch-GNUmakefile.diff

compiler.c_standard 2011

# libretls only needed with openssl
depends_lib         port:libretls \
                    path:lib/libssl.dylib:openssl

post-patch {
    reinplace "s|/usr/local|${prefix}|g" ${worksrcpath}/Makefile
}

build.target

destroot {
    copy ${worksrcpath}/${name} ${destroot}${prefix}/bin/
}

variant libressl description "Build with libressl" {
    depends_lib     path:lib/libssl.dylib:libressl
}
