# -*- 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           golang 1.0

go.setup            gitlab.com/shackra/goimapnotify 2.5.8
revision            0
categories          mail
maintainers         {cal @neverpanic} openmaintainer
license             GPL-3 MIT BSD

description         \
    Execute scripts on IMAP mailbox changes (new/deleted/updated messages) \
    using IDLE

long_description    {*}${description}

go.package          gitlab.com/shackra/goimapnotify
go.toolchain_min    1.23

use_bzip2           no
extract.suffix      .tar.gz
extract.cmd         gzip

checksums           ${distname}${extract.suffix} \
                        rmd160  4e7e3b33144af865909696776eeed2a68db08e40 \
                        sha256  616aae1f48fbe4e2afffd968e7c393d32075365a0a94aa7654ab7abe4b4ac1c6 \
                        size    2371498

# 2.5.x ships a complete vendor directory, so no go.vendors block is needed --
# the build resolves every dependency from vendor/ with GOPROXY=off.
#
# main moved to ./cmd/goimapnotify in 2.5.0.
#
# Upstream's Makefile stamps main.commit and main.branch from git, which is not
# available here; gittag is the one that matters, as it feeds both -version and
# the imap client's version string. The Makefile also passes -gcflags '-N -l',
# which disables optimization and inlining -- that is a debug build, not
# something to reproduce here.
build.pre_args-append \
                    -ldflags \" -X main.gittag=${version} \"

build.args-append   -o ${name} ./cmd/${name}

destroot {
    xinstall -m 0755 ${worksrcpath}/${name} ${destroot}${prefix}/bin/
}
