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

name                py-poppler-qt4
python.rootname     python-poppler-qt4
version             0.24.0
revision            4
license             LGPL-2.1+
maintainers         {gmail.com:davide.liessi @dliessi} openmaintainer

description         Python binding for Poppler-Qt4
long_description    ${python.rootname} is a Python binding for Poppler-Qt4 \
                    that aims for completeness \
                    and for being actively maintained. \
                    Using this module you can access \
                    the contents of PDF files \
                    inside PyQt4 applications.

homepage            https://github.com/wbsoft/${python.rootname}

checksums           rmd160  8674296b8e224e181537e798cd219aeb30ff7561 \
                    sha256  29ad1d2246a4733d8fdc8f640a470733c61eea98f923af061c98cc497db4c374 \
                    size    18085

python.versions     37

# find poppler-qt4-mac headers and libraries instead of poppler headers and libraries
configure.env-append PKG_CONFIG_PATH=${prefix}/libexec/poppler-qt4-mac/lib/pkgconfig
build.env-append PKG_CONFIG_PATH=${prefix}/libexec/poppler-qt4-mac/lib/pkgconfig

if {${name} ne ${subport}} {
    depends_build-append    port:pkgconfig

    depends_lib-append      port:poppler-qt4-mac \
                            port:qt4-mac \
                            port:py${python.version}-sip4 \
                            port:py${python.version}-pyqt4

    patchfiles              patch-types.sip.diff

    compiler.cxx_standard   2011

    post-destroot {
        set doc_dir ${destroot}${prefix}/share/doc/${subport}
        xinstall -d ${doc_dir}
        xinstall -m 644 -W ${worksrcpath} \
            ChangeLog \
            LICENSE \
            README.rst \
            ${doc_dir}
        set examples_dir ${destroot}${prefix}/share/examples/${subport}
        xinstall -d ${examples_dir}
        xinstall -m 644 -W ${worksrcpath} demo.py ${examples_dir}
    }
}
