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

github.setup                jordansissel xdotool 3.20211022.1 v
revision                    0
checksums                   rmd160  c2f8891ffc37fb7c5a49e42c7a7364a536c7837d \
                            sha256  96f0facfde6d78eacad35b91b0f46fecd0b35e474c03e00e30da3fdd345f9ada \
                            size    115237

categories                  x11 devel
platforms                   darwin
maintainers                 {ryandesign @ryandesign} openmaintainer
license                     BSD

description                 X11 keyboard and mouse simulation utility

long_description            ${name} lets you programatically (or manually) \
                            simulate keyboard input and mouse activity\; \
                            move, resize, hide and show windows\; \
                            modify window properties like the title\; etc.

notes                       "To use xdotool (and avoid the error message\
                            \"Error: XTEST extension unavailable on '(null)'\")\
                            you need to enable the XTEST extension. If you're\
                            using Apple's X11.app, the command to do so is:\
                            \n\ndefaults write org.x.X11 enable_test_extensions -boolean true\
                            \n\nIf you're using the MacPorts X11.app, use:\
                            \n\ndefaults write org.macports.X11 enable_test_extensions -boolean true\
                            \n\nThis only needs to be done once."

homepage                    https://www.semicomplete.com/projects/xdotool/
github.tarball_from         releases

depends_build               port:pkgconfig \
                            path:bin/perl:perl5

depends_lib                 port:libxkbcommon \
                            port:xorg-libXi \
                            port:xorg-libXinerama \
                            port:xorg-libXtst

platform darwin {
    # error: implicit declaration of function 'strdup' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
    configure.cflags-append -D_XOPEN_SOURCE=600
}

patchfiles                  patch-Makefile.diff

destroot.env-append         INSTALLMAN=${prefix}/share/man

post-destroot {
    set docdir ${prefix}/share/doc/${subport}
    xinstall -d ${destroot}${docdir} ${destroot}${prefix}/share/examples
    xinstall -m 0644 -W ${worksrcpath} CHANGELIST COPYRIGHT README.md ${destroot}${docdir}
    copy ${worksrcpath}/examples ${destroot}${prefix}/share/examples/${name}
}
