PortSystem                  1.0

name                        jed
version                     0.99-19
revision                    1
checksums                   rmd160  c6182d918322c30922f7590c7e8b15a1da0ba22f \
                            sha256  97a339ce2fb0a446767ee550786e6914fa2e8cdbad39a402e48368cd0d6b5763 \
                            size    884198

categories                  editors
license                     GPL-2+
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

depends_lib                 port:slang2

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

configure.args              --disable-gpm \
                            --disable-xft \
                            --mandir=${prefix}/share/man \
                            --with-slang=${prefix} \
                            --without-x

configure.env               JED_ROOT=${prefix}/share/jed

destroot {
    xinstall ${worksrcpath}/src/objs/jed ${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 {
    depends_build-append    path:bin/pkg-config:pkgconfig

    depends_lib-append      port:Xft2 \
                            port:xorg-libXt

    configure.args-replace  --disable-xft --enable-xft \
                            --without-x --with-x

    build.target-append xjed

    post-destroot {
        xinstall ${worksrcpath}/src/objs/xjed ${destroot}${prefix}/bin
    }
}

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