# -*- 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/traefik/yaegi 0.16.3 v
go.toolchain_min    1.21
revision            0

description         \
    Yaegi is Another Elegant Go Interpreter

long_description    \
    Yaegi is Another Elegant Go Interpreter. It powers executable Go scripts \
    and plugins, in embedded interpreters or interactive shells, on top of \
    the Go runtime. It has complete support for the Go specification, is \
    written in Pure Go, and works everywhere Go works. All Go & runtime \
    resources accessible from script (with control), and for security, \
    "unsafe" and "syscall" packages are neither used nor exported by default.

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

checksums           rmd160  2c9e09b88b3320673a4787a6e14a1fe9adfb1f24 \
                    sha256  1fca3442639e2f25fffc6d6cf104dd33a9c0951d32bf8b958ed6e2e979d32d1d \
                    size    2272355

build.cmd           make
build.target        install

patch {
    # Explicitly embed the version into the build command in the Makefile,
    # instead of trying to dynamically determine it from the current git tag.
    # We are using a tarball, and not a checked-out git repository, so querying
    # for git tag will fail.
    reinplace -E "s|\\$\\$\\(git describe --tags\\)|v${version}|" \
        ${worksrcpath}/Makefile
}

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