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

name                showkey
version             1.10
categories          sysutils
maintainers         {khindenburg @kurthindenburg} openmaintainer
license             MIT

description         echo raw keystrokes back at you in a printable form

long_description    This program puts your terminal in raw mode, eats \
                    keystrokes, and prints them back it you in a recognizable \
                    printed form (using <>-surrounded ASCII mnemonics for \
                    non-printables). \
                    This may be useful, for example, if you're not certain \
                    what your keyboard keys are sending.

homepage            http://catb.org/esr/showkey/
master_sites        ${homepage}

checksums           rmd160  8b5ae5170b7fc4a5c7792d3a58bfdde41958612a \
                    sha256  eabcba3420f969ecf9aa31233b9ac9d28c824489ba55948d3455d0a8f5680142 \
                    size    4888

use_configure       no

variant universal {}

build.target
build.args          CC="${configure.cc} [get_canonical_archflags cc]"

destroot.args       PREFIX=${prefix}

# This brings in a lot of dependencies
variant docs description {Build man documentation} {
    depends_build-append \
                port:asciidoctor
}

pre-patch {
    if {[variant_isset docs]} {
        patchfiles      patch-doc-Makefile.diff
    } else {
        patchfiles      patch-nodoc-Makefile.diff
    }
}

livecheck.type      regex
livecheck.regex     "${name}-(\[\\d.\]+)${extract.suffix}"
