# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:filetype=tcl:et:sw=4:ts=4:sts=4

PortSystem          1.0
PortGroup           github 1.0
PortGroup           legacysupport 1.1

github.setup        p11-glue p11-kit 0.25.5
revision            0
license             Permissive
description         PKCS#11 module discovery and loading
long_description    Provides a way to load and enumerate PKCS#11 modules and a standard \
                    configuration setup for installing PKCS#11 modules in such a way that \
                    they are discoverable.
maintainers         nomaintainer
categories          security

github.tarball_from releases
use_xz              yes

checksums           rmd160  30c45c68d4d0adc308f28883d5be967b50e11f35 \
                    sha256  04d0a86450cdb1be018f26af6699857171a188ac6d5b8c90786a60854e1198e5 \
                    size    1002056

depends_build       port:gettext \
                    path:bin/pkg-config:pkgconfig \
                    port:python311

depends_lib         port:gettext-runtime \
                    port:libtasn1 \
                    port:libffi \
                    port:libxslt

depends_run         path:share/curl/curl-ca-bundle.crt:curl-ca-bundle

configure.args      --disable-doc \
                    --disable-silent-rules \
                    --with-trust-paths=${prefix}/share/curl/curl-ca-bundle.crt:${prefix}/etc/openssl

# /usr/bin/python is Python 2.7 for older systems, and
# /usr/bin/python3 is too old (< 3.6) on older systems
# https://trac.macports.org/ticket/68739
configure.env       PYTHON=${prefix}/bin/python3.11

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

variant doc description {Build man pages and documentation} {
    depends_build-append    port:gtk-doc
    configure.args-replace  --disable-doc --enable-doc
}

test.run            yes
test.target         check