# -*- 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-pikepdf
version             10.18.2
revision            0

categories-append   graphics
license             MPL-2
maintainers         {mps @Schamschula} openmaintainer
description         pikepdf is based on QPDF, a powerful PDF manipulation and repair \
                    library.
long_description    {*}${description}
homepage            https://github.com/pikepdf/pikepdf

python.versions     310 311 312 313 314 315

checksums           rmd160  216531fd5250750b5e7c27e2361a1951be4dad6f \
                    sha256  b32ee8b0ffe606059dbf3386ebe1dae6e2601098277e22e8c75c2ee982436b43 \
                    size    10085857

python.pep517_backend \
                    scikit

if {${name} ne ${subport}} {
    if {${python.version} < 312} {
        version     10.13.0.post1
        revision    0
        checksums   rmd160  4b4fe6322b085aac638c4cbf24fc936730f350a7 \
                    sha256  4b73f926ebae81f04bf14527af330bd00bb268be767e0f189f7c4c3e4ad7ae0a \
                    size    4973186
    }

    # Explicitly call for py-trove-classifiers
    # See: https://trac.macports.org/ticket/73559
    depends_build-append \
                    port:py${python.version}-nanobind \
                    port:py${python.version}-trove-classifiers

    depends_lib-append  \
                    port:py${python.version}-deprecated \
                    port:py${python.version}-lxml \
                    port:py${python.version}-packaging \
                    port:py${python.version}-Pillow \
                    port:qpdf

    compiler.cxx_standard \
                    2020
    # fatal error: 'ranges' file not found
    compiler.blacklist-append {clang < 900}

    # workaround for CMAKE_CXX_COMPILER_CLANG_SCAN_DEPS-NOTFOUND
    # See: https://www.kitware.com/import-cmake-the-experiment-is-over/
    patchfiles      patch-CMakeLists.txt.diff
}
