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

github.setup                BlueM cliclick 4.0.1
revision                    1
checksums                   rmd160  c79e26f413cb829c49e92cf45a5cab2042bd99dd \
                            sha256  c218b3356a804d768d5f074fc64eb1ff6842083bf476a80b363d95211deff59f \
                            size    35710

categories                  sysutils
maintainers                 {ryandesign @ryandesign}
license                     BSD

description                 a utility for simulating mouse and keyboard events

long_description            ${name}, short for \"Command-Line Interface \
                            Click\", is a tiny shell/Terminal application that \
                            emulates mouse clicks (including double-clicks and \
                            Control-clicks) at arbitrary screen coordinates. \
                            It also lets you move the mouse, get the current \
                            mouse coordinates, press modifier keys, enter \
                            text, and more.

homepage                    https://www.bluem.net/en/projects/cliclick/

if {${os.major} < 9} {
    known_fail              yes
    pre-fetch {
        ui_error "${name} @${version} requires Mac OS X 10.5 or greater."
        return -code error "incompatible Mac OS X version"
    }
} elseif {${os.major} < 13} {
    # https://github.com/BlueM/cliclick/issues/81
    notes-append "
${name} @${version} officially supports OS X 10.9 and later. Support\
for earlier systems is provided by MacPorts.
"
}

patchfiles-append           32-bit.patch \
                            fix-comments.patch \
                            legacy.patch

xcode.configuration         Release

destroot {
    xinstall ${worksrcpath}/build/${xcode.configuration}/${name} ${destroot}${prefix}/bin
    xinstall -d ${destroot}${prefix}/share/doc/${name}
    xinstall -m 0644 -W ${worksrcpath} README.markdown ${destroot}${prefix}/share/doc/${name}
}
