# $Id: Portfile,v 1.10 2006/01/29 16:03:22 olegb Exp $

PortSystem 1.0
name             nedit
version          5.4
revision         1
categories       editors
maintainers      toby@opendarwin.org
homepage         http://www.nedit.org/
description      A multi-purpose text editor for the X Window System.
long_description \
    NEdit is a multi-purpose text editor for the X Window System, which \
    combines a standard, easy to use, graphical user interface with the \
    thorough functionality and stability required by users who edit text \
    eight hours a day. It provides intensive support for development in a \
    wide variety of languages, text processors, and other tools, but at \
    the same time can be used productively by just about anyone who needs \
    to edit text.
platforms        darwin

regsub -all      \\. $version _ xversion
master_sites     ftp://ftp.nedit.org/pub/NEdit/v${xversion}/
distname         ${name}-${version}-source
use_bzip2        yes
checksums        md5 b71afab27f07def3121a8c6f319697ca

depends_lib      lib:libXm.4:openmotif

worksrcdir       ${name}-${version}

configure        {}

build.args		MOTIFLINK="-L${prefix}/lib -lXm.4" LDFLAGS=-L${prefix}/lib \
                CFLAGS="-I${prefix}/include -DBUILD_UNTESTED_NEDIT"

destroot {
    xinstall -s -m 555 ${worksrcpath}/source/nedit \
        ${destroot}${prefix}/bin/nedit
    xinstall -m 444 ${worksrcpath}/doc/nedit.man \
        ${destroot}${prefix}/share/man/man1/nedit.1

    xinstall -s -m 555 ${worksrcpath}/source/nc \
        ${destroot}${prefix}/bin/nedit-nc
    xinstall -m 444 ${worksrcpath}/doc/nc.man \
        ${destroot}${prefix}/share/man/man1/nedit-nc.1
}

platform darwin {
    patchfiles   patch-Makefile.macosx
    build.target macosx
}

platform darwin 8 {
	build.args-append CC=/usr/bin/gcc-4.0
}
