# -*- 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
PortGroup               github 1.0

github.setup            baszoetekouw pinfo 0.6.13 v
github.tarball_from     archive
revision                0
categories              textproc
maintainers             iaas.msu.ru:master
license                 GPL-2

description             Console-based info reader
long_description        {*}${description}. ${name} is a hypertext info file viewer with \
                        a user interface similar to lynx. It is based on curses/ncurses \
                        and can handle info pages as well as man pages. It also features \
                        regexp searching and user-defined colors/keys.

checksums               rmd160  e1c7f1bde730b8500c4466e0fdb9063a351c446d \
                        sha256  9dc5e848a7a86cb665a885bc5f0fdf6d09ad60e814d75e78019ae3accb42c217 \
                        size    157103

depends_build-append    path:bin/pkg-config:pkgconfig \
                        port:gettext \
                        port:texinfo

depends_lib-append      port:gettext-runtime \
                        port:ncurses \
                        port:readline

patch.pre_args-replace  -p0 -p1
patchfiles              fix-build-on-ncurses-6.3.diff
patchfiles-append       man-fallback-fix.diff
patchfiles-append       ignore-current-directory.patch
patchfiles-append       only-open-regular-files.patch

post-patch {
    reinplace "s|@PREFIX@|${prefix}|g" ${worksrcpath}/src/datatypes.c
    reinplace "s|@PREFIX@|${prefix}|g" ${worksrcpath}/doc/${name}.1.in
}

configure.args-append   --with-readline=${prefix}

use_autoreconf          yes

# See: https://trac.macports.org/wiki/WimplicitFunctionDeclaration#AddnamestowhitelistviaPortfile
configure.checks.implicit_function_declaration.whitelist-append strchr
