# -*- 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.29.0 v
go.toolchain_min    1.24
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  ae25126cb24fc187e063de8fbb4a282aaab98de4 \
                    sha256  7e4c7b8ade016052e63c1553cb4fbe0c4fe921e1e66913d49eef074ed894e933 \
                    size    167799

conflicts           bazel

go.offline_build no

build.pre_args-append \
                    -ldflags \"-X ${go.package}/core.BazeliskVersion=v${version}\" \
                    -trimpath

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

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