gpgme-1.8.0 (and by a quick test also 1.9.0) does not compile with gcc-7
The reason are two missing "include <functional>" directives (to provide
std::function and similar things).
The following link contains the (trivial) patch to add these directives:
https://bugs.gentoo.org/show_bug.cgi?id=617884