# -*- 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/umputun/ralphex 1.5.1 v
revision            0
categories          llm
maintainers         {@sikmir disroot.org:sikmir} openmaintainer
license             MIT

description         Extended Ralph loop for autonomous AI-driven plan execution
long_description    {*}${description}
homepage            https://ralphex.com/

build.cmd           make
build.pre_args-append \
                    REV=v${version} \
                    TAG=v${version}
build.args          build

checksums           rmd160  a3edd14816088db0016539bff3e54fd425ae1884 \
                    sha256  f6750a671853ec7bc7a45e04f50a0f5b5969e7d6d8f24dcae6d7508bb39c18c3 \
                    size    8210031

destroot {
    xinstall -m 0755 ${worksrcpath}/.bin/ralphex.v${version} ${destroot}${prefix}/bin/ralphex

    set src_completion_dir ${worksrcpath}/completions

    set bash_completion_dir ${destroot}${prefix}/etc/bash_completion.d
    xinstall -d ${bash_completion_dir}
    xinstall -m 644 ${src_completion_dir}/ralphex.bash ${bash_completion_dir}/ralphex

    set fish_completion_dir ${destroot}${prefix}/share/fish/vendor_completions.d
    xinstall -d ${fish_completion_dir}
    xinstall -m 644 ${src_completion_dir}/ralphex.fish ${fish_completion_dir}/

    set zsh_completion_dir ${destroot}${prefix}/share/zsh/site-functions
    xinstall -d ${zsh_completion_dir}
    xinstall -m 644 ${src_completion_dir}/ralphex.zsh ${zsh_completion_dir}/_ralphex
}
