# $Id: Portfile 82022 2011-08-06 20:30:39Z jmr@macports.org $

PortSystem  1.0

name        icewm
version     1.2.37
categories  x11 x11-wm
maintainers saispo
platforms   darwin

description Lightweight window manager with a Windows or OS/2 look and feel
long_description    Nice and fast window manager with the look and feel \
            from Windows (95, 98) or OS/2 (Warp 3, Warp 4).

homepage    http://www.icewm.org
master_sites    http://downloads.sourceforge.net/icewm
checksums   md5     970a21588d26eb361020fd60a61a482c \
            sha1    bee1ca66d2282888807551bc28a65b08e4108027 \
            rmd160  1e28eb750fd07321cf66bcaa617fc782acbb82f1

patchfiles  01-fix_leopard_deprecated_in_stdlib.patch

depends_build \
        port:pkgconfig
depends_lib \
        port:xorg-libice \
        port:xorg-libsm \
        port:xorg-libX11 \
        port:xorg-libXau \
        port:xorg-libXdmcp \
        port:xorg-libXext \
        port:Xft2 \
        port:xorg-libXinerama \
        port:xpm \
        port:xorg-libXrandr \
        port:xrender \
        port:fontconfig \
        port:freetype

configure.args  --mandir=${prefix}/share/man \
                --with-cfgdir=${prefix}/etc/icewm \
                --with-xpm --without-icesound \
                --disable-i18n --disable-nls \
                --disable-debug

destroot {
    system "cd ${worksrcpath} && make install-docs DESTDIR=${destroot}"
    system "cd ${worksrcpath} && make install-man DESTDIR=${destroot}"
    if {[variant_isset gnome1] || [variant_isset gnome2]} {
        system "cd ${worksrcpath} && make install-gnome DESTDIR=${destroot}"
    }
    system "cd ${worksrcpath} && make install DESTDIR=${destroot}"
}

post-destroot {
    ui_msg ""
    ui_msg "To start icewm put \"exec icewm-session\" in your \".xinitrc\" file."
    ui_msg "Don't forget to add the MacPorts Environment to the X Environment too!"
    ui_msg ""
}

variant lite description {Use the lightweight IceWM} {
	configure.args-append  --enable-lite \
	                       --disable-xinerama --disable-xrandr
}

variant imlib description {Use Imlib for images instead of libxpm (does not work yet)} {
	configure.args-delete  --with-xpm
	configure.args-append  --with-imlib
	depends_lib-append     port:imlib
}

variant nls description {Use internationalized messages (does not work correct yet)} {
    configure.args-delete  --disable-i18n --disable-nls
#    configure.args-append  --enable-i18n --enable-nls
	depends_lib-append     port:gettext port:libiconv
}

variant debug description {Use this option if you want to debug IceWM} {
	configure.args-delete  --disable-debug
	configure.args-append  --enable-debug
}

# not tested: can't install esound, help2man
variant esound description {Use sound support (untested)} {
	configure.args-delete  --without-icesound
	configure.args-append  --with-icesound=esound --enable-guievents
	depends_lib-append     port:audiofile port:esound
}

# not tested, can't install gnome
variant gnome1 conflicts gnome2 description {Use the GNOME menus with IceWM} {
	configure.args-append  --enable-menus-gnome1
}

variant gnome2 conflicts gnome1 description {Use the KDE/GNOME2 menus with IceWM} {
	configure.args-append  --enable-menus-gnome2
}

