# $Id: Portfile 54531 2009-07-29 09:59:49Z macsforever2000@macports.org $

PortSystem 1.0

name             nedit
version          5.5
revision         1
categories       editors
maintainers      nomaintainer
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     sourceforge \
                 ftp://ftp.nedit.org/pub/NEdit/v${xversion}/
distname         ${name}-${version}-src
use_bzip2        yes
checksums        md5 48cb3dce52d44988f3a4d7c6f47b6bbe

depends_lib      lib:libXm:openmotif \
                 port:xpm

worksrcdir       ${name}-${version}

use_configure    no

build.args      MOTIFLINK="${configure.ldflags} -lXm" \
                MOTIFDIR=${prefix} \
                LDFLAGS="${configure.ldflags}" \
                CFLAGS="${configure.cppflags} ${configure.cflags} -DBUILD_UNTESTED_NEDIT" \
                CPPFLAGS="${configure.cppflags}" \
                CC="${configure.cc}"

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
}
