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

github.setup        abishekvashok cmatrix 2.0 v
# Change github.tarball_from to 'releases' or 'archive' next update
github.tarball_from tarball
revision            0
categories          games x11
license             GPL-3
maintainers         nomaintainer
description         Console Matrix
long_description    Console Matrix simulates the display from "The Matrix"
homepage            https://www.asty.org/cmatrix/

checksums           rmd160  73e38f7f1e903a738e98724bcc326b4c71034b44 \
                    sha256  456d8097cb4724a69337e9803dd9b7079fa10684d22e35fc2bdd88655c03925a \
                    size    205672

depends_build       port:autoconf port:automake
depends_lib         port:ncurses

use_autoreconf      yes
autoreconf.args     -i
configure.args      --mandir=${prefix}/share/man

variant x11font description {Install matrix font for X11} {
    depends_lib-append  port:fontconfig port:mkfontscale
    pre-destroot {
        xinstall -d ${destroot}${prefix}/share/fonts/misc
        xinstall ${worksrcpath}/mtx.pcf ${destroot}${prefix}/share/fonts/misc
    }
    post-activate {
        system "mkfontscale ${prefix}/share/fonts/misc"
        system "mkfontdir ${prefix}/share/fonts/misc"
        system "fc-cache ${prefix}/share/fonts/misc"
    }
    post-deactivate {
        system "mkfontscale ${prefix}/share/fonts/misc"
        system "mkfontdir ${prefix}/share/fonts/misc"
        system "fc-cache ${prefix}/share/fonts/misc"
    }
}
