# -*- 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           python 1.0

name                py-onnx
version             1.16.1
categories-append   science
license             Apache-2
maintainers         nomaintainer

description         Open Neural Network Exchange

long_description    {*}${description} (ONNX) is an open \
                    ecosystem that empowers AI developers to choose \
                    the right tools as their project evolves. ONNX \
                    provides an open source format for AI models, both \
                    deep learning and traditional ML. It defines an \
                    extensible computation graph model, as well as \
                    definitions of built-in operators and standard \
                    data types. Currently we focus on the capabilities \
                    needed for inferencing (scoring).

homepage            https://onnx.ai/

checksums           md5     07fe47dc50e802e4a9051de9b3cdf928 \
                    rmd160  e9817f10bbce05a2a7d5a716c7557467637c5287 \
                    sha256  8299193f0f2a3849bfc069641aa8e4f93696602da8d165632af8ee48ec7556b6 \
                    size    12306956

python.versions     39 310 311 312

if {${name} ne ${subport}} {
    compiler.cxx_standard 2017

    depends_build-append \
        path:bin/cmake:cmake \
        port:pybind11

    depends_lib-append \
        port:py${python.version}-numpy \
        port:py${python.version}-protobuf3 \
        port:py${python.version}-typing_extensions

    depends_test-append \
        port:py${python.version}-nbval \
        port:py${python.version}-pytest \
        port:py${python.version}-tabulate

    # diff -Naur ./py-onnx_orig ./py-onnx_new | sed -E -e 's/\.\/py-onnx_(orig|new)/\./g' | sed -E -e 's|/opt/local|@@PREFIX@@|g' > ~/Downloads/patch-pyproject_toml.diff
    patchfiles-append \
        patch-pyproject_toml.diff

    post-destroot {
        set docdir ${prefix}/share/doc/${subport}
        xinstall -d ${destroot}${docdir}
        xinstall -m 0644 -W ${worksrcpath} LICENSE README.md \
            ${destroot}${docdir}
    }

    test.run        yes
    test.target     onnx/test
}
