# -*- 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           gitlab 1.0

gitlab.setup        grobian html2text 2.4.0 v
set upload_id       8526650dd42218b3493ce7ca0a3eeb1e
revision            1
checksums           rmd160  b99bb417faaa8ff38223f1786628780469a73c1d \
                    sha256  9d0a7174cacbb3f050b60facd8cba6e138944ec5020b16d1cee70cf91a59f132 \
                    size    385497

categories          textproc
maintainers         {ryandesign @ryandesign} openmaintainer
license             GPL-2+

description         Utility to convert HTML documents into plain text.

long_description    ${name} is a command line utility, written in C++, \
                    that converts HTML documents into plain text. Each \
                    HTML document is loaded from a location indicated \
                    by a URI or read from standard input, and \
                    formatted into a stream of plain text characters \
                    that is written to standard output or into an \
                    output file. The input URI may specify a remote \
                    site from which the documents are loaded via the \
                    Hypertext Transfer Protocol (HTTP).

master_sites        https://gitlab.com/-/project/48313341/uploads/${upload_id}/

# Override "use_bzip2 yes" set by gitlab.setup.
if {[vercmp [macports_version] >= 2.12]} {
#use_gzip            yes
use_bzip2           no
} else {
    # https://trac.macports.org/ticket/64960
    depends_extract-delete \
                    bin:lbzip2:lbzip2
    extract.suffix  .tar.gz
    extract {
        foreach distfile ${distfiles} {
            system -W ${workpath} "[findBinary tar ${portutil::autoconf::tar_command}] -xzf [shellescape ${distpath}/${distfile}]"
        }
    }
}

depends_build       bin:bison:bison

depends_lib         port:curl \
                    port:libiconv

patchfiles          version.patch

compiler.cxx_standard 2011

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

test.run            yes
test.target         check
