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

# clock_gettime
legacysupport.newest_darwin_requires_legacy 16

# Cannot use the latest release now, it is broken with the current Erlang:
# Code compiled with OTP-28 is not supported by this version of AtomVM.
# Please recompile using an earlier version, such as OTP-27,
# or switch to a newer version of AtomVM, such as a main snapshot.
github.setup            atomvm atomvm d4ab6745ebe7526bd7ecddedf91ad60b4a7a8508
version                 0.7.0-20250930
revision                0
epoch                   1
categories              erlang devel
maintainers             {pguyot @pguyot} openmaintainer
license                 Apache-2

description             Tiny Erlang VM
long_description        AtomVM implements from scratch a minimal Erlang VM that \
                        supports a subset of ErlangVM features and that is able to \
                        run unmodified BEAM binaries on really small systems like \
                        MCUs.

checksums               rmd160  c6d5f502f5cbb8e4531838a6787ac6051316587a \
                        sha256  8d9ffa49a10795699f794a1703c890bc341ceabe3c948a9a2e44ad867a2d9760 \
                        size    1356839
github.tarball_from     archive

cmake.generator         Ninja

depends_build-append    port:elixir \
                        port:erlang \
                        port:gperf \
                        port:rebar3
depends_lib-append      port:mbedtls3

# CMake Error at src/platforms/generic_unix/CMakeLists.txt:25 (target_compile_features):
# target_compile_features The compiler feature "c_std_11" is not known to C compiler
compiler.c_standard     2011
# CMake Error at src/libAtomVM/CMakeLists.txt:155 (message):
# Platform doesn't support atomic pointers
compiler.blacklist-append {clang < 900}

test.run                yes
test.cmd                tests/test-erlang && \
                        tests/test-enif && \
                        tests/test-mailbox && \
                        tests/test-structs && \
                        src/AtomVM ./tests/libs/estdlib/test_estdlib.avm && \
                        src/AtomVM ./tests/libs/eavmlib/test_eavmlib.avm && \
                        src/AtomVM ./tests/libs/alisp/test_alisp.avm && \
                        src/AtomVM ./tests/libs/exavmlib/Tests.avm
test.target             {}
