PortSystem                  1.0

name                        jed
version                     0.99-19
revision                    1
categories                  editors
license                     GPL-2+
platforms                   darwin
maintainers                 nomaintainer

description                 JED is a powerful editor for programmers.

long_description            JED is a powerful editor designed for use by \
                            programmers, its drop-down menu facility make it \
                            one of the friendliest text editors around. Hence \
                            it is ideal for composing simple email messages \
                            as well as editing complex programs in a variety \
                            of computer languages.

homepage                    http://www.jedsoft.org/jed/
master_sites                ftp://space.mit.edu/pub/davis/jed/v0.99/ \
                            ftp://space.mit.edu/pub/davis/jed/v0.99/old/
use_bzip2                   yes

checksums                   md5     c9b2f58a3defc6f61faa1ce7d6d629ea \
                            sha1    7783ac9035c7221575e74b544902151309d0d0ef \
                            rmd160  c6182d918322c30922f7590c7e8b15a1da0ba22f

depends_lib                 port:slang2

patchfiles                  patch-pty.c \
                            patch-unix.c

configure.args              --mandir=${prefix}/share/man \
                            --with-slang=${prefix}
configure.cppflags-append   -L${prefix}/lib
configure.env               JED_ROOT=${prefix}/share/jed

destroot {
    xinstall ${worksrcpath}/src/objs/jed ${destroot}${prefix}/bin
    if {[variant_isset x11]} {
        xinstall ${worksrcpath}/src/objs/xjed ${destroot}${prefix}/bin
    }

    xinstall ${worksrcpath}/doc/manual/jed.1 ${destroot}${prefix}/share/man/man1/

    xinstall -d ${destroot}${prefix}/share/jed/lib
    foreach f [glob -nocomplain [file join ${worksrcpath}/lib *]] {
        if {![file isdirectory $f] } {
            xinstall $f ${destroot}${prefix}/share/jed/lib/
        }
    }

    xinstall -d ${destroot}${prefix}/share/jed/lib/colors
    foreach f [glob -nocomplain [file join ${worksrcpath}/lib/colors *]] {
        if {![file isdirectory $f] } {
            xinstall $f ${destroot}${prefix}/share/jed/lib/colors/
        }
    }

    xinstall -d ${destroot}${prefix}/share/jed/lib/colors/Xjed
    foreach f [glob -nocomplain [file join ${worksrcpath}/lib/colors/Xjed *]] {
        if {![file isdirectory $f] } {
            xinstall $f ${destroot}${prefix}/share/jed/lib/colors/Xjed/
        }
    }
}

variant x11 description {Build xjed} {
    depends_lib-append port:Xft2
    configure.args-append --with-x
    build.target-append xjed
}

livecheck.type              regex
livecheck.url               ${homepage}download.html
livecheck.regex             { is ([0-9.-]+) }