# -*- 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        fvwmorg fvwm 2.7.0
revision            0
github.tarball_from releases
# consider renaming this to fvwm
name                fvwm2
categories          x11 x11-wm
license             GPL-2+
maintainers         nomaintainer

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.

checksums           rmd160  b8863400aa98bb177a2b52b3f0d0836c7a69e63c \
                    sha256  66826dd60b774447170037d9078fd43e75f7230a49acfb84a988eebce7e3418b \
                    size    3933529

depends_build-append    path:bin/pkg-config:pkgconfig \
                        port:libxslt

depends_lib-append  port:xorg-libsm \
                    port:xorg-libXinerama \
                    port:xorg-libXcursor \
                    port:xpm \
                    port:Xft2 \
                    port:libpng \
                    path:lib/pkgconfig/librsvg-2.0.pc:librsvg \
                    port:readline

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

# error: incompatible integer to pointer conversion assigning to 'int *' from 'char' [-Wint-conversion]
if {${os.platform} eq "darwin" && ${os.major} > 22} {
    configure.cflags-append \
                    -Wno-error=int-conversion
}

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

notes "
If this is your first install of an alternative WM, these steps
may be helpful:
    $ mkdir ~/.xinitrc.d
    $ cat >~/.xinitrc.d/99-wm.sh
    #!/bin/sh
    exec fvwm
    ^D
    $ chmod +x ~/.xinitrc.d/99-wm.sh
    $ open ${applications_dir}/X11.app
"
