# -*- 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-setuptools
version             59.5.0
categories-append   devel
# License status is murky. The current maintainer decided to relicense as
# MIT, but he doesn't appear to have obtained the permission of previous
# contributors to do so. Thus it has to be assumed that portions are still
# under the previous license. The vendored copy of the 'packaging' module is
# dual licensed under Apache-2 or BSD.
license             MIT {PSF ZPL} {Apache-2 BSD}
maintainers         {jmr @jmroot} openmaintainer
description         distutils enhancement for build and distribution
long_description \
    setuptools is a collection of enhancements to the Python distutils that \
    allow you to more easily build and distribute Python packages, \
    especially ones that have dependencies on other packages.

supported_archs     noarch

homepage            https://pypi.org/project/setuptools/

checksums           md5 53964c1b60bc9a8b077983d276fe08c7 \
                    rmd160 3471f0e789af45c3af531888b4572eaa6d164b07 \
                    sha256 d144f85102f999444d06f9c0e8c737fd0194f10f2f7e5fdb77573f6e2fa4fad0

python.versions     26 27 33 34 35 36 37 38 39 310
python.link_binaries no

if {$subport ne $name} {

    if {${python.version} >= 36} {
        python.pep517   yes
        python.add_dependencies no
        depends_build   port:py-bootstrap-modules
        depends_lib     port:python${python.version}
        build.env-append    PYTHONPATH=${prefix}/share/py-bootstrap-modules
        build.args      --skip-dependency-check
        destroot.env-append PYTHONPATH=${prefix}/share/py-bootstrap-modules
    } else {
        use_zip     yes
        post-destroot {
            ln -s ${python.prefix}/bin/easy_install-${python.branch} ${destroot}${prefix}/bin
        }
    }

    if {${python.version} == 35} {
        version     50.3.1
        revision    0
        checksums   md5 6a323319a1d3b7d1939ddc0f6bc7dbe9 \
                    rmd160 7f42ab7c6305d5c01180fe8d3946bc0d57b6c718 \
                    sha256 0e9772768fa6e9d3cf818a3e6e24dd2236f319d2c478312995edcb30ddeb8343
    } elseif {${python.version} == 27} {
        version     44.1.1
        revision    0
        checksums   md5 2c41f19cfd1f16a7d7bb23689921ac1b \
                    rmd160 f8af333dabae2df9fba6f02dc2d22249b15d83e8 \
                    sha256 c67aa55db532a0dadc4d2e20ba9961cbd3ccc84d544e9029699822542b5a476b
    } elseif {${python.version} == 34} {
        version     43.0.0
        revision    0
        checksums   md5 792983f474cd2bd314fa3af28813cdb6 \
                    rmd160 b0c380d5789a76b43c409d35f3250efd8577fd91 \
                    sha256 db45ebb4a4b3b95ff0aca3ce5fe1e820ce17be393caf8902c78aa36240e8c378
    } elseif {${python.version} == 33} {
        version     39.2.0
        revision    0
        checksums   md5 dd4e3fa83a21bf7bf9c51026dc8a4e59 \
                    rmd160 6070de164cf74412fe7c9a9d04031112b06cfc2a \
                    sha256 f7cddbb5f5c640311eb00eab6e849f7701fa70bf6a183fc8a2c33dd1d1672fb2
    } elseif {${python.version} == 26} {
        version     36.8.0
        revision    0
        checksums   md5    3ecaa938a4c95a74dfbcd6340a47c7c5 \
                    rmd160 457c838b9fb09cf0bf9ba519a098e1c009710aa3 \
                    sha256 b2aa5a00e9e4fd20f3c3dd412d490921746efe14bda34d53973c4a59ab05b35d
    }

    build.env-append    SETUPTOOLS_INSTALL_WINDOWS_SPECIFIC_FILES=0
    destroot.env-append SETUPTOOLS_INSTALL_WINDOWS_SPECIFIC_FILES=0
    post-destroot {
       xinstall -m 755 -d ${destroot}${prefix}/share/doc/${subport}
       xinstall -m 644 -W ${worksrcpath} CHANGES.rst README.rst \
          ${destroot}${prefix}/share/doc/${subport}
    }
    livecheck.type      none
}
