# -*- 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-watchdog
version             6.0.0
revision            0

categories-append   sysutils
license             Apache-2
maintainers         {petr @petrrr} openmaintainer

description         Python API and shell utilities to monitor file system events.
long_description    {*}${description}

homepage            https://github.com/gorakhargosh/watchdog

checksums           sha256  9ddf7c82fda3ae8e24decda1338ede66e1c99883db93711d8fb941eaa2d8c282 \
                    rmd160  59936be92eaa0d6b7d8b19563d51191f553738f2 \
                    size    131220

python.versions     27 310 311 312 313 314

if {${name} ne ${subport}} {
    if {${os.platform} eq "darwin" && ${os.major} <= 10} {
        # support for 10.7 and below was dropped in version 0.10.4
        # https://trac.macports.org/ticket/64584
        # https://github.com/gorakhargosh/watchdog/issues/1021
        # TODO: see if we can use a newer version, borrowing fallback code from 0.10.3.
        version     0.10.3
        revision    0
        checksums   sha256  4214e1379d128b0588021880ccaf40317ee156d4603ac388b9adcf29165e0c04 \
                    rmd160  cd117cd0cd0f54264eb6ebfd855f58dbeeb616f9 \
                    size    94086
        patchfiles  patch.osx-10.6.setup.py
        depends_lib-append  port:py${python.version}-pathtools
        compiler.blacklist-append \
                    *gcc-4.0 *gcc-4.2
    } elseif {${python.version} == 27} {
        version     0.10.7
        revision    0
        checksums   sha256  50cb861700b99edcb4b7af330d28ce34ba5551a74b51c0a283ed221e936435f4 \
                    rmd160  73748d31a104982a71a2329288e0b6bcef92f90d \
                    size    102622
        depends_lib-append  port:py${python.version}-pathtools
    } elseif {${os.platform} eq "darwin" && ${os.major} <= 16} {
        # support for 10.12 and below was dropped in version 2.0.0
        version     1.0.2
        revision    0
        checksums   sha256  376cbc2a35c0392b0fe7ff16fbc1b303fd99d4dd9911ab5581ee9d69adc88982 \
                    rmd160  72dbfbb51f8b9a1d5ea277e1815ec53fadada066 \
                    size    98483
    }

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

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

    test.run        yes

    livecheck.type  none
}
