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

checksums           rmd160  cc478e2c90d6c1e850cf25ad6bb6f20e1cbd516e \
                    sha256  57f804468f0204504b172c6b139cb05124b4263be7ad514932c7c4c5062a16e2 \
                    size    123124

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}"
