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

name                xscreensaver
version             6.08
revision            0
categories          x11
platforms           darwin
maintainers         nomaintainer
license             X11
description         X11 screen saver
long_description    The xscreensaver program waits until the keyboard and \
                    mouse have been idle for a period, and then runs a graphics \
                    demo chosen at random.

homepage            https://www.jwz.org/xscreensaver
master_sites        ${homepage}

checksums           rmd160  468c8385b25ec16b85ab5b6b29d06373d40b786d \
                    sha256  5cf52ba525ceecf94b2f2bd63485ebdf318e12fcc0f2adad7d4c106d855e76a3 \
                    size    19990058

depends_build       port:pkgconfig \
                    port:intltool \
                    port:gettext

depends_lib         path:lib/pkgconfig/gtk+-3.0.pc:gtk3 \
                    port:xorg-libXi \
                    port:xorg-libXt \
                    port:mesa \
                    port:libGLU

depends_run         port:font-bh-ttf

require_active_variants path:lib/pkgconfig/gtk+-3.0.pc:gtk3 x11

# Fix "No GL visuals" when running in fullscreen
patchfiles          patch-driver-subprocs.diff

configure.args      --with-app-defaults=${prefix}/share/X11/app-defaults \
                    --with-fontdir=${prefix}/share/fonts/TTF

destroot.destdir    install_prefix=${destroot}

post-destroot {
    # get it from font-bh-ttf
    delete ${destroot}${prefix}/share/fonts/TTF/luximr.ttf
}

livecheck.type      regex
livecheck.url       https://www.jwz.org/xscreensaver/download.html
livecheck.regex     xscreensaver-(\[0-9\.\]+).tar.gz
