# -*- 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           cmake   1.1
PortGroup           boost   1.0

github.setup        WasmEdge WasmEdge 0.18.1
name                wasmedge
github.tarball_from archive
revision            1

homepage            https://wasmedge.org

description         \
    WasmEdge is a lightweight, high-performance, and extensible WebAssembly \
    runtime.

long_description    \
    {*}${description} It is the fastest Wasm VM today. WasmEdge is an \
    official sandbox project hosted by the CNCF. Its use cases include \
    modern web application architectures (Isomorphic & Jamstack \
    applications), microservices on the edge cloud, serverless SaaS APIs, \
    embedded functions, smart contracts, and smart devices.

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

checksums           rmd160  0c9a0b95181771b96bdd86d5c0137516dbab5c4f \
                    sha256  2a04eae7111185289e611474e7fbd051b3c3734cc1ad21149c0a6ab93e3419ae \
                    size    3905816

set llvm_version    21
set llvm_root_dir   ${prefix}/libexec/llvm-${llvm_version}
set llvm_lib_dir    ${llvm_root_dir}/lib

depends_build-append \
    port:clang-${llvm_version} \
    port:libffi \
    port:libxml2 \
    port:zlib \
    port:zstd

# libwasmedge links libLLVM.dylib at run time.
depends_lib-append  port:llvm-${llvm_version}

configure.env-append \
    LLVM_DIR=${llvm_root_dir}

post-destroot {
    system "install_name_tool -change \"@rpath/libLLVM.dylib\" ${llvm_lib_dir}/libLLVM.dylib ${destroot}${prefix}/lib/lib${name}.dylib"
}

github.livecheck.regex \
                    {([0-9.]+)}
