# -*- 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
PortGroup           active_variants 1.1

name                py-pdftl
version             0.23.0
revision            0

categories-append   textproc
platforms           {darwin any}
supported_archs     noarch
license             MPL-2.0
maintainers         {reneeotten @reneeotten} openmaintainer

description         A capable CLI tool for PDF manipulation inspired by pdftk.
long_description    pdftl (PDF tackle) is a standalone CLI utility and Python library \
                    for manipulating PDF files.

homepage            https://github.com/pdftl/pdftl

checksums           rmd160  0a4e730fb7353f677fca729014680a7f10960a60 \
                    sha256  9b3edbd189e2a3e3e1e3d967eca144272211fc2c49849769f8177c1c09288249 \
                    size    3422546

python.versions     310 311 312 313 314

if {${subport} ne ${name}} {
    depends_build-append \
                    port:py${python.version}-setuptools_scm

    depends_lib-append \
                    port:py${python.version}-defusedxml \
                    port:py${python.version}-pikepdf \
                    port:py${python.version}-rich

    # extra dependencies
    depends_run-append \
                    port:py${python.version}-cloudpickle \
                    port:py${python.version}-fonttools \
                    port:py${python.version}-hanko \
                    port:py${python.version}-lark \
                    port:py${python.version}-numpy \
                    port:py${python.version}-reportlab \
                    port:py${python.version}-yaml

    variant optimize_images description {Support for optimizing images} {
        depends_run-append \
                    port:ocrmypdf

        require_active_variants ocrmypdf python${python.version}
    }
}
