# -*- 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.470.12 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  579cc689db5d9b0798a110ad3b7e4bd6493046e6 \
                    sha256  5accaade2eaa7571fdc8b490cd1455a585f429ca42c5ead67cba60f952b4d98e \
                    size    9083950

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