# -*- 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.466.2 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  d79392018130fb9fa911afade82d78d5fafb6593 \
                    sha256  bb8d074d9e99b656ab6b12ed73ffa53b0749cac74682c3f136501bc808b515cc \
                    size    6240404

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

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/
}
