# $Id: Portfile 87641 2011-11-29 23:45:18Z ryandesign@macports.org $

PortSystem          1.0

name                fvwm2
conflicts           fvwm
version             2.6.3
description         Version 2.x of FVWM, an X11 window manager.
long_description    FVWM 2.x is an extremely powerful ICCCM-compliant multiple \
                    virtual desktop window manager for the X Window system.
homepage            http://www.fvwm.org/
maintainers         nomaintainer
categories          x11 x11-wm
platforms           darwin
master_sites        ftp://ftp.fvwm.org/pub/fvwm/version-2/ \
                    http://ftp.lyx.org/pub/X11/fvwm/version-2/
distname            fvwm-${version}
use_bzip2           yes

checksums           rmd160  850f906ceaab88a383f01ec00489bd42a8b1374e \
                    sha256  8299b8f8d712f95305e51d8e416e3788e35805adcc0bb2e5bcb6cc33db126152

depends_build       port:pkgconfig \
                    port:libxslt

depends_lib         port:xorg-libsm \
                    port:xorg-libXinerama \
                    port:xorg-libXcursor \
                    port:xpm \
                    port:Xft2 \
                    port:libpng \
                    port:librsvg \
                    port:readline

configure.args      --x-includes=${prefix}/include \
                    --x-libraries=${prefix}/lib \
                    --disable-gtk \
                    --without-gnome \
                    --disable-bidi \
                    --disable-nls \
                    --with-ncurses-library=yes \
                    --without-rplay-library \
                    --without-stroke-library

# port:gtk1 is not universal

if {[variant_isset gtk] || [variant_isset gnome]} {
        universal_variant   no
}

variant gtk description {Enable support for outdated GTK+ 1.x} {
    configure.args-delete --disable-gtk
    configure.args-append --enable-gtk
    depends_lib-append port:gtk1
}

variant gnome requires gtk description {Enable support for outdated GNOME 1.x} {
    configure.args-delete --without-gnome
    configure.args-append --with-gnome
    depends_lib-append port:gnome-libs
}

variant bidi description {Enable support for bidirection text handling} {
    configure.args-delete --disable-bidi
    depends_lib-append port:fribidi
}

livecheck.type      regexm
livecheck.url       ${homepage}
livecheck.regex     {Latest Release: &nbsp; </td>\s+.*?<a href="download" >([^<]*)</a>}
