# -*- 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
PortGroup           openssl 1.0

name                py-awscrt
# This is only used by awscli2. Bump when Amazon bumps
# their pinned version in awscli2's setup.cfg.
version             0.31.2
revision            0

categories-append   devel
maintainers         {gmail.com:davidgilman1 @dgilman} openmaintainer
license             Apache-2

description         A common runtime for AWS Python projects
long_description    {*}${description}

homepage            https://aws.amazon.com/cli/

checksums           rmd160  75e09241e873c5856084802caeefec986774e985 \
                    sha256  552555de1beff02d72a1f6d384cd49c5a7c283418310eae29d21bcb749c65792 \
                    size    38169245

python.versions     310 311 312 313

if {${name} ne ${subport}} {
    if {${os.platform} eq "darwin" && ${os.major} <= 18} {
        known_fail      yes
        pre-fetch {
            ui_error "${name} @${version} requires macOS 10.15 or later."
            return -code error "incompatible macOS version"
        }
    }

    depends_build-append \
                        path:bin/cmake:cmake

    depends_lib-append  port:py${python.version}-setuptools

    build.env-append    AWS_CRT_BUILD_USE_SYSTEM_LIBCRYPTO=1
}
