# -*- 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.30.0 v
go.toolchain_min    1.27.3
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  389216d3e1e07de9db23714f212a463396691f8a \
                    sha256  938c875176d6895d1f9cce21d71a76f56f82e88d819f22ed587f124f795aad33 \
                    size    168948

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
}
