# -*- 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-uncompyle6
version             3.7.4
revision            0

categories-append   devel
platforms           darwin
supported_archs     noarch
license             GPL-3+
maintainers         {reneeotten @reneeotten} openmaintainer

description         Python cross-version byte-code decompiler
long_description    ${description}

homepage            https://github.com/rocky/python-uncompyle6/

checksums           rmd160  5b3eb3edff065c151ab240f7691d49a10ee78a2e \
                    sha256  af8330861bf940e7a3ae0f06d129b8e645191a36bf73ca15ff51997a837d41f8 \
                    size    2381166

python.versions     27 35 36 37 38 39

if {${name} ne ${subport}} {
    post-patch {
        reinplace "s|PYTHON ?= python|PYTHON ?= ${python.bin}|g" ${worksrcpath}/test/Makefile \
            ${worksrcpath}/pytest/Makefile
        reinplace "s|py.test|py.test-${python.branch}|g" ${worksrcpath}/pytest/Makefile
    }

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

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

    test.run        yes
    test.cmd        make
    test.target     check-${python.branch}
    test.env        COMPILE=--compile \
                    PYTHONPATH=${worksrcpath}/build/lib

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

    livecheck.type  none
}
