# -*- 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/bazelbuild/bazelisk 1.25.0 v
revision            0

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

description         A user-friendly launcher for Bazel

long_description    Bazelisk is a wrapper for Bazel written in Go. \
                    It automatically picks a good version of Bazel given your \
                    current working directory, downloads it from the official \
                    server (if required) and then transparently passes through \
                    all command-line arguments to the real Bazel binary. You \
                    can call it just like you would call Bazel.

checksums           rmd160  9220308ba960a7dd708876c37b695bf6b59be662 \
                    sha256  8ff4c6b9ab6a00fbef351d52fde39afc2b9f047865f219a89ed0b23ad6f8cf06 \
                    size    153421

conflicts           bazel

build.cmd           ./build.sh
build.env-append    BAZELISK_VERSION=v${version}
go.offline_build no

patchfiles          patch-bazelisk-version.diff \
                    patch-build.sh.diff

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

    ln -s ${prefix}/bin/${name} ${destroot}${prefix}/bin/bazel
}
