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

# std::optional
legacysupport.use_mp_libcxx \
                    yes
legacysupport.newest_darwin_requires_legacy \
                    16

name                gpgmepp
version             2.0.0
revision            1

checksums           rmd160  170e6d2fb3250991c2591c855f2b7e77311da2ef \
                    sha256  d4796049c06708a26f3096f748ef095347e1a3c1e570561701fe952c3f565382 \
                    size    118304

categories          devel security crypto
license             {LGPL-2.1+ GPL-3+}
maintainers         nomaintainer
description         C++ bindings for GPGME
long_description    GPGME++ is a C++ wrapper (or C++ bindings) for the GnuPG project's \
                    GPGME (GnuPG Made Easy) library, version 0.4.4 and later.

homepage            https://www.gnupg.org/related_software/gpgme/
master_sites        gnupg
use_xz              yes

depends_build-append    path:bin/pkg-config:pkgconfig
depends_lib         port:gpgme

compiler.cxx_standard 2017

# run-genrandom.cpp:114:31: error: 'value' is
# unavailable: introduced in macOS 10.13
# std::optional<T>::value is missing from the libc++ system
# library, and Clang reports this error even with
# macports-libcxx (except for <Lion), so pass this flag.
if {${os.platform} eq "darwin" && ${os.major} < 17 && ${os.major} > 10} {
     if {[string match *clang* ${configure.compiler}]} {
          configure.cxxflags-append \
                    -D_LIBCPP_DISABLE_AVAILABILITY
     }
}

livecheck.type      regex
livecheck.url       https://gnupg.org/ftp/gcrypt/gpgmepp/
livecheck.regex     "${name}-(\\d+(?:\\.\\d+)*)${extract.suffix}"
