# -*- 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            github.com/berty/berty 2.471.14 v
go.package          berty.tech/berty/v2
revision            0

homepage            https://berty.tech

description         Berty is an open, secure, offline-first, peer-to-peer and \
                    zero trust messaging app

long_description    {*}${description} that works with or without internet \
                    access, cellular data or trust in the network

categories          net
installs_libs       no
license             Apache-2
maintainers         {gmail.com:herby.gillot @herbygillot} \
                    openmaintainer

checksums           rmd160  07e451f08c46350b839135410efdd02633971bff \
                    sha256  22a97aead0119c0f338ac5be6aa32efb2ef40f1a4ac218ffae8cba76dcdfb030 \
                    size    9014589

# Allow Go to fetch dependencies at build time
go.offline_build no
go.toolchain_min    1.26.4

build.cmd           make
build.pre_args-append \
                    -C ./go \
                    VERSION=${version}
build.args          go.install

destroot {
    foreach _berty_bin [glob ${gopath}/bin/berty*] {
        xinstall -m 0755 ${_berty_bin} ${destroot}${prefix}/bin/
    }

    xinstall -m 0755 ${gopath}/bin/testbot ${destroot}${prefix}/bin/
}
