# -*- 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/docker/buildx 0.19.3 v
# Delete this on next update to use golang PortGroup's default ('archive')
github.tarball_from tarball
revision            0
name                docker-buildx-plugin
categories          devel
license             Apache-2
maintainers         {danchr @danchr} \
                    openmaintainer
description         Docker CLI plugin for extended build capabilities with BuildKit

long_description    {*}{
    buildx is a Docker CLI plugin for extended build capabilities with
    BuildKit. Key features:\n\n

    * Familiar UI from docker build\n
    * Full BuildKit capabilities with container driver\n
    * Multiple builder instance support\n
    * Multi-node builds for cross-platform images\n
    * Compose build support\n
    * High-level build constructs (bake)\n
    * In-container driver support (both Docker and Kubernetes)
}

checksums           rmd160  432aa191153460f2c0bd578d4f55608ebfaeee32 \
                    sha256  1e92fab30587a6a34d26e1cc62fe9f1410737c7df4cdf1111d8c8a8cdca83bf8 \
                    size    11697181

go.offline_build    no

post-patch {
    reinplace "/Version/s/\"\[^\"]*\"/\"${go.version}\"/" \
        ${worksrcpath}/version/version.go
    reinplace "/Revision/s/\"\[^\"]*\"/\"MacPorts ${version}_${revision}${portvariants}\"/" \
        ${worksrcpath}/version/version.go
}

build.target        -o ${name} ./cmd/buildx

depends_run         port:docker

destroot {
    xinstall -d ${destroot}${prefix}/libexec/docker/cli-plugins
    xinstall -m 755 ${worksrcpath}/${name} ${destroot}${prefix}/libexec/docker/cli-plugins/docker-buildx
}

github.livecheck.regex  {([^"r]+)}
