# -*- 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           github 1.0
PortGroup           openssl 1.0

github.setup        arturo-lang arturo 0.10.0 v
github.tarball_from archive
revision            0
categories          lang
license             MIT
maintainers         {@drkameleon gmail.com:yaniszaf} openmaintainer

description         Simple, expressive & portable programming language for efficient scripting

long_description    Arturo is a simple, modern programming language with a focus on \
                    simplicity, expressiveness, and portability. It features a clean \
                    syntax, powerful metaprogramming capabilities, and minimal dependencies. \
                    The language is designed for efficient scripting and supports multiple \
                    programming paradigms.

homepage            https://arturo-lang.io

checksums           rmd160  b96a0148bb17de94a1ae5d74aefa4249006461e9 \
                    sha256  408646496895753608ad9dc6ddfbfa25921c03c4c7356f2832a9a63f4a7dc351 \
                    size    31294342

depends_build       port:nim \
                    path:bin/pkg-config:pkgconfig

depends_lib         port:gmp \
                    port:mpfr

patchfiles          patch-paths.diff

post-patch {
    reinplace "s|@@OPENSSL_PREFIX@@|[openssl::install_area]|g" ${worksrcpath}/.config/buildmode.nims
    reinplace "s|@@PREFIX@@|${prefix}|g" ${worksrcpath}/.config/buildmode.nims
}

supported_archs     arm64 x86_64

use_configure       no

build {
    system -W ${worksrcpath} "./build.nims --log"
}

destroot {
    xinstall -m 755 ${worksrcpath}/bin/arturo ${destroot}${prefix}/bin/
}

test.run            yes
test.cmd            ${prefix}/bin/arturo
test.args           --version

notes "
Arturo has been installed. You can verify the installation by running:
    arturo --version
"
