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

nim.setup           github status-im nim-bearssl 0.2.1 v
revision            0
categories          devel security crypto
license             {MIT Apache-2}
maintainers         {@barracuda156 macos-powerpc.org:barracuda} openmaintainer

description         Nim wrapper for BearSSL cryptographic library
long_description    nim-bearssl provides Nim bindings for BearSSL, a smaller, \
                    simpler SSL/TLS library with a focus on security and \
                    performance. Used by Status.im projects for cryptographic \
                    operations and secure communications.

checksums           rmd160  87f79c5877003be00bfc6b7282ec8f3e4b93282d \
                    sha256  653d738711768b48aaa796043a4f6142501f5cc80fb2908891ac4968794facb9 \
                    size    137125

depends_lib-append  port:bearssl \
                    port:nim-stew

depends_test

variant tests description "Run tests" {
    # Nimble is designed to be broken. And with tests it really wants to be broken.
    # Package must not be installed from this build.
    known_fail      yes

    # Needs C sources of Bearssl which are not bundled in the tarball.
    fetch.type      git

    post-fetch {
        system -W ${worksrcpath} "git submodule update --init"
    }

    # No nimble packages can be active, so drop dependencies:
    depends_lib

    post-configure {
        ui_warn "Please deactivate all nim-\* ports in order to run tests."
    }

    test.run        yes
}
