# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4

PortSystem      1.0

name            nvi
version         1.81.6
revision        6
categories      editors
license         BSD
maintainers     nomaintainer
description     A vi/ex clone

long_description \
    Nvi is an implementation of the ex/vi text editor originally \
    distributed as part of the Fourth Berkeley Software Distribution \
    (4BSD), by the University of California, Berkeley.

homepage        http://www.bostic.com/vi/
master_sites    ftp://ftp.stack.nl/pub/users/johans/nvi/
checksums       md5 88d1e23115ee9f2961186b62e55f5704 \
                rmd160 0db8568bea96392d9a027044177c60317c8ade36 \
                sha256 3441b8e3247b2b6dd19b5fd38355fe6593b2a92e960ecb3dd00d676f63d06b59 \
                size 1758309
use_bzip2       yes

configure.dir   ${worksrcpath}/dist
build.dir       ${configure.dir}

set my_db_version db48

depends_lib     port:ncurses port:${my_db_version}

patchfiles \
    dynamic_lookup-11.patch \
    patch-cl_cl.h.diff \
    patch-common_conv.h.diff \
    patch-common_db.h.diff \
    patch-common_key.h.diff \
    patch-dist_port.h.in.diff \
    patch-ex_script.c.diff \
    patch-includes.diff \
    patch-common_msg.c.diff \
    patch-powerof2.diff

# https://trac.macports.org/ticket/69888
compiler.blacklist-append \
                {*gcc-[34].*}

configure.args \
    --program-prefix=n \
    --without-x \
    --mandir=${prefix}/share/man \
    vi_cv_path_preserve=/var/tmp/vi.recover

configure.cppflags-append \
    -I${prefix}/include/${my_db_version}
configure.ldflags-append \
    -L${prefix}/lib/${my_db_version}

variant x11 {
    configure.args-delete --without-x
    configure.args-append --with-x
}
