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

# GitHub version lags behind.
R.setup             cran ropensci pdftools 3.7.0
revision            2
categories-append   print
maintainers         {@barracuda156 macos-powerpc.org:barracuda} openmaintainer
license             MIT
description         Text extraction, rendering and converting of PDF documents
long_description    {*}${description}
checksums           rmd160  ea271ff4d1e04c52b51e5f3f6ae0cab641186c3a \
                    sha256  07f7ef60086c63e98324835072435861bd2e94b0ebf5df5d68d11412f9cf6e0d \
                    size    935572

depends_build-append \
                    path:bin/pkg-config:pkgconfig

depends_lib-append  path:lib/pkgconfig/poppler.pc:poppler \
                    port:R-qpdf \
                    port:R-Rcpp

# As of now, libstdc++ in MacPorts uses old ABI.
if {${os.platform} eq "darwin" && ${configure.cxx_stdlib} ne "libc++"} {
    # Symbol not found: __ZNK7poppler13embedded_file9mime_typeB5cxx11Ev
    patchfiles      patch-Makevars.diff
}

depends_test-append port:R-png \
                    port:R-tesseract \
                    port:R-testthat \
                    port:R-webp

test.run            yes
