# $Id: Portfile 67212 2010-05-02 22:36:45Z jeremyhu@macports.org $

PortSystem          1.0

name                xterm
version             258
categories          x11
platforms           darwin
maintainers         jeremyhu openmaintainer
description         the ubiquitous X terminal emulator, stand-alone
long_description    The xterm program is a terminal emulator for the X \
                    Window System. It supports a plethora of features, \
                    including colors, Unicode, etc.

homepage            http://invisible-island.net/xterm/
master_sites        ftp://invisible-island.net/xterm/
checksums           md5     bcf4f0ba51f5f58fd5bef76b3d05e40e \
                    sha1    d3357fc88917e23210eea2db32b185799bb2d22e \
                    rmd160  35ff38a715ebfc43eae68f0aa7a006742d1800e8
extract.suffix      .tgz

depends_build \
	port:xorg-xproto

depends_run \
	bin:luit:luit

depends_lib \
	port:ncurses \
	port:expat \
	port:zlib \
	port:xorg-libXaw \
	port:Xft2

configure.args      --mandir=${prefix}/share/man --enable-luit \
                    --enable-logging --enable-wide-chars \
                    --enable-256-color --enable-load-vt-fonts \
                    --x-include=${prefix}/include --x-lib=${prefix}/lib \
                    --with-app-defaults=${prefix}/share/X11/app-defaults

# If -ltermcap stays in the LDFLAGS, xterm is linked against both
# /usr/lib's and ${prefix}/lib's libncurses.
post-configure {
    reinplace "s|-ltermcap|-lncurses|" ${worksrcpath}/Makefile
}

livecheck.type      regex
livecheck.url       ${master_sites}
livecheck.regex     "${name}\\.tar\\.gz -> ${name}-(\\d+)\\.tgz"

variant utmp description {Support updating utmp/utmpx database
                          (installs setgid daemon)} {
   configure.args-append   --with-utmp-setgid=daemon --with-utempter
}

platform darwin 8 {
    configure.args-append cf_cv_xopen_source=no cf_cv_posix_c_source=no
}
