# -*- 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.0 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  1464bb8ff71a0146f92c45e2381f05c455b9e0a6 \
                    sha256  4e1549f13c0192f1f56e4f5e4a2a181a46b89a5c58921cca6f63a782c3d8080b \
                    size    8211318

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
}
