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

github.setup        rocky python-xdis 6.1.8
github.tarball_from archive
name                py-xdis
revision            0

supported_archs     noarch
platforms           {darwin any}
license             GPL-2
maintainers         {khindenburg @kurthindenburg} openmaintainer

description         Python cross-version byte-code disassembler and marshal routines
long_description \
    The Python `dis` module allows you to disassemble bytecode from the same \
    version of Python that you are running on. \
    This package can "marshal load" Python \
    bytecodes from different versions of Python. The command-line routine \
    *pydisasm* will show disassembly output using the most modern Python \
    disassembly conventions in a variety of user-specified formats.  Some \
    of these formats like ``extended`` and ``extended-format`` are the most \
    advanced of any Python disassembler.

checksums           rmd160  a645e9b20375c20c47b860f566829db7ffba0d49 \
                    sha256  404c31baba6f3fb93e5434009bd1cc4466b289a8e7374a6ba2f2ecd17a31da98 \
                    size    553575

python.versions     310 311 312 313

if {${name} ne ${subport}} {
    if {${python.version} == 310} {
        distname    xdis_36-${version}
        revision    0
        checksums   rmd160  a645e9b20375c20c47b860f566829db7ffba0d49 \
                    sha256  404c31baba6f3fb93e5434009bd1cc4466b289a8e7374a6ba2f2ecd17a31da98 \
                    size    553575
    }

    depends_lib-append  port:py${python.version}-click \
                        port:py${python.version}-six

    post-patch {
        reinplace "s|PYTHON ?= python|PYTHON ?= ${python.bin}|g" ${worksrcpath}/test/Makefile
    }

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

    test.run        yes
    python.test_framework
    test.dir        ${build.dir}/test
    test.cmd        make
    test.target     check-full
}
