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

github.setup        ICRAR crc32c 2.2 v
revision            1
name                py-${github.project}
categories-append   devel

license             GPL-2.1
maintainers         nomaintainer
platforms           darwin

description         A python package implementing the crc32c algorithm \
                    in hardware and software.

long_description    This package implements the crc32c checksum \
                    algorithm. It automatically chooses between a \
                    hardware-based implementation (using the CRC32C \
                    SSE 4.2 instruction of Intel CPUs, and the crc32* \
                    instructions on ARMv8 CPUs), or a software-based \
                    one when no hardware support can be found.


checksums           rmd160  465dcd7b6ae7bdcc9a6d214dedb6c1995ef82f91 \
                    sha256  837d305556ffe08814b5b76300fd0d8e779d7c212f6ade0cf084fb5128f0e711 \
                    size    40228

python.versions     37 38 39

if {${name} ne ${subport}} {
    depends_build-append \
                    port:py${python.version}-setuptools

    depends_test-append \
                    port:py${python.version}-mkl \
                    port:py${python.version}-numpy \
                    port:py${python.version}-pytest

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

    pre-test {
        test.env-append \
                    PYTHONPATH=[glob -nocomplain ${build.dir}/build/lib*]
    }
    test.run        yes
    test.cmd        py.test-${python.branch}

    livecheck.type  none
}
