# -*- 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.0
name                wasmedge
github.tarball_from archive
revision            0

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  1e95ebe09d1bbb6de49c24bb0d19685de21cf597 \
                    sha256  3faabd223ba5fd20e6ffc962b1688942499a950b57e15b3c361d571c9b227240 \
                    size    3907559

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:llvm-${llvm_version} \
    port:zlib \
    port:zstd

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.]+)}
