diff options
author | jhale <jhale@FreeBSD.org> | 2016-11-17 21:55:47 +0800 |
---|---|---|
committer | jhale <jhale@FreeBSD.org> | 2016-11-17 21:55:47 +0800 |
commit | b548bf8873741fbf2aae8a14c2528fad8460a850 (patch) | |
tree | 09b570ae92b5c6b25893a06857d6bdc845cb5a00 /security/gpgme | |
parent | b823ad3269db1a5d710db9b2276381e00e4271f5 (diff) | |
download | freebsd-ports-gnome-b548bf8873741fbf2aae8a14c2528fad8460a850.tar.gz freebsd-ports-gnome-b548bf8873741fbf2aae8a14c2528fad8460a850.tar.zst freebsd-ports-gnome-b548bf8873741fbf2aae8a14c2528fad8460a850.zip |
Using ports libc++ on non-leaf ports is problematic, as the requirement
basically flows to all ports that depend on gpgme-{cpp,qt5}. In particular,
sysutils/kf5-kwallet was breaking in FreeBSD 9.x because mismatches between
libc++ and libstdc++ from gcc48 were causing a gpgme symbol not to be found:
backendpersisthandler.cpp:(.text+0xf61): undefined reference to
`GpgME::Context::encrypt(std::vector<GpgME::Key, std::allocator<GpgME::Key> >
const&, GpgME::Data const&, GpgME::Data&, GpgME::Context::EncryptionFlags)'
Switch the build of both ports to lang/gcc on FreeBSD 9 and the system compiler
on FreeBSD 10:
* Use USES:compiler-c++11-lib instead of compiler-c++11-lang, as we do need a
C++11-compatible standard library. This causes the right compiler to be chosen
as described above.
* Set _GLIBCXX_USE_C99 so that gpgme-cpp builds with GCC 4.8 (std::to_string()
is not exposed by default on FreeBSD). Several other ports need to do the same.
* Add a few patches to fix the gpgme-qt5:
** patch-git_b4658f6a1 is a backport from an upstream commit to make the port
build with GCC 4.8 without errors.
** patch-lang_qt_src_qgpgmeencryptjob.cpp is a local workaround for the
std::bind() bug mentioned in ports r424451.
PR: 214575
Submitted by: rakuco
Diffstat (limited to 'security/gpgme')
-rw-r--r-- | security/gpgme/Makefile | 18 | ||||
-rw-r--r-- | security/gpgme/files/patch-git_b4658f6a1 | 35 | ||||
-rw-r--r-- | security/gpgme/files/patch-lang_qt_src_qgpgmeencryptjob.cpp | 45 |
3 files changed, 84 insertions, 14 deletions
diff --git a/security/gpgme/Makefile b/security/gpgme/Makefile index 5e4720bf4b29..fdcef245ed63 100644 --- a/security/gpgme/Makefile +++ b/security/gpgme/Makefile @@ -60,13 +60,15 @@ INSTALL_WRKSRC= ${WRKSRC}/lang/${BINDING_NAME} . if ${SLAVEPORT} == "cpp" CONFIGURE_ARGS+=--enable-languages="cpp" -USES+= compiler:c++11-lang +USES+= compiler:c++11-lib +# Unhide std::to_string() to fix build with GCC 4.8 (ports/193528). +CXXFLAGS+= -D_GLIBCXX_USE_C99 . endif . if ${SLAVEPORT} == "qt5" LIB_DEPENDS+= libgpgmepp.so:security/gpgme-cpp CONFIGURE_ARGS+=--enable-languages="cpp qt" -USES+= compiler:c++11-lang pkgconfig +USES+= compiler:c++11-lib pkgconfig USE_QT5= buildtools_build core testlib CONFLICTS_INSTALL= kdepimlibs-4.* . endif @@ -86,18 +88,6 @@ CONFLICTS_INSTALL= py*-pyme-[0-9]* .include <bsd.port.pre.mk> .if defined(SLAVEPORT) -. if ${SLAVEPORT} == "cpp" -. if ${OPSYS} == FreeBSD && ${OSVERSION} < 1001000 -BUILD_DEPENDS+= ${LOCALBASE}/lib/c++/libstdc++.so:devel/libc++ -CXXFLAGS+= -stdlib=libc++ -isystem ${LOCALBASE}/include/c++/v1 -. endif -. endif -. if ${SLAVEPORT} == "qt5" -. if ${OPSYS} == FreeBSD && (${OSVERSION} < 1001000 || (${OSVERSION} >= 1001507 && ${OSVERSION} < 1100080)) -BUILD_DEPENDS+= ${LOCALBASE}/lib/c++/libstdc++.so:devel/libc++ -CXXFLAGS+= -stdlib=libc++ -isystem ${LOCALBASE}/include/c++/v1 -. endif -. endif . if ${SLAVEPORT} == "python" . if ${PYTHON_REL} >= 3000 CONFIGURE_ARGS+=--enable-languages="python3" diff --git a/security/gpgme/files/patch-git_b4658f6a1 b/security/gpgme/files/patch-git_b4658f6a1 new file mode 100644 index 000000000000..4017878fd83a --- /dev/null +++ b/security/gpgme/files/patch-git_b4658f6a1 @@ -0,0 +1,35 @@ +From: Andras Mantia <andras@kdab.com> +Date: Wed, 2 Nov 2016 09:23:42 +0000 (+0200) +Subject: qt: Fix build with g++ 4.8.x +X-Git-Tag: gpgme-1.8.0~36 +X-Git-Url: http://git.gnupg.org/cgi-bin/gitweb.cgi?p=gpgme.git;a=commitdiff_plain;h=b4658f6a1110bb0b54bd5dfc9df8e8b390e38d61 + +qt: Fix build with g++ 4.8.x + +* lang/qt/src/defaultkeygenerationjob.cpp +(DefaultKeyGenerationJob::start): Explicitly connect pointer +in the QPointer. + +-- +Commit message written by Andre Heinecke <aheinecke@intevation.de> +--- + +diff --git a/lang/qt/src/defaultkeygenerationjob.cpp b/lang/qt/src/defaultkeygenerationjob.cpp +index d26e824..020f4d2 100644 +--- lang/qt/src/defaultkeygenerationjob.cpp ++++ lang/qt/src/defaultkeygenerationjob.cpp +@@ -105,11 +105,11 @@ GpgME::Error DefaultKeyGenerationJob::start(const QString &email, const QString + + d->job = openpgp()->keyGenerationJob(); + d->job->installEventFilter(this); +- connect(d->job, &KeyGenerationJob::result, ++ connect(d->job.data(), &KeyGenerationJob::result, + this, &DefaultKeyGenerationJob::result); +- connect(d->job, &KeyGenerationJob::done, ++ connect(d->job.data(), &KeyGenerationJob::done, + this, &DefaultKeyGenerationJob::done); +- connect(d->job, &KeyGenerationJob::done, ++ connect(d->job.data(), &KeyGenerationJob::done, + this, &QObject::deleteLater); + return d->job->start(args); + } diff --git a/security/gpgme/files/patch-lang_qt_src_qgpgmeencryptjob.cpp b/security/gpgme/files/patch-lang_qt_src_qgpgmeencryptjob.cpp new file mode 100644 index 000000000000..a9b639d79a73 --- /dev/null +++ b/security/gpgme/files/patch-lang_qt_src_qgpgmeencryptjob.cpp @@ -0,0 +1,45 @@ +Rename encrypt() so that the code builds with FreeBSD 10.2/10.3's libc++, which +has a bug that causes std::bind() to fail with the original function name: + +qgpgmeencryptjob.cpp:133:9: error: no matching function for call to 'bind' + run(std::bind(&encrypt, + ^~~~~~~~~ +/usr/include/c++/v1/functional:2184:1: note: candidate template ignored: +couldn't infer template argument '_Fp' +bind(_Fp&& __f, _BoundArgs&&... __bound_args) +^ +/usr/include/c++/v1/functional:2193:1: note: candidate template ignored: +couldn't infer template argument '_Rp' +bind(_Fp&& __f, _BoundArgs&&... __bound_args) +^ +1 error generated. + +--- lang/qt/src/qgpgmeencryptjob.cpp.orig 2016-10-18 17:22:02 UTC ++++ lang/qt/src/qgpgmeencryptjob.cpp +@@ -65,7 +65,7 @@ void QGpgMEEncryptJob::setOutputIsBase64 + mOutputIsBase64Encoded = on; + } + +-static QGpgMEEncryptJob::result_type encrypt(Context *ctx, QThread *thread, ++static QGpgMEEncryptJob::result_type do_encrypt(Context *ctx, QThread *thread, + const std::vector<Key> &recipients, + const std::weak_ptr<QIODevice> &plainText_, + const std::weak_ptr<QIODevice> &cipherText_, +@@ -117,7 +117,7 @@ static QGpgMEEncryptJob::result_type enc + if (!buffer->open(QIODevice::ReadOnly)) { + assert(!"This should never happen: QBuffer::open() failed"); + } +- return encrypt(ctx, 0, recipients, buffer, std::shared_ptr<QIODevice>(), eflags, outputIsBsse64Encoded); ++ return do_encrypt(ctx, 0, recipients, buffer, std::shared_ptr<QIODevice>(), eflags, outputIsBsse64Encoded); + } + + Error QGpgMEEncryptJob::start(const std::vector<Key> &recipients, const QByteArray &plainText, bool alwaysTrust) +@@ -130,7 +130,7 @@ Error QGpgMEEncryptJob::start(const std: + void QGpgMEEncryptJob::start(const std::vector<Key> &recipients, const std::shared_ptr<QIODevice> &plainText, + const std::shared_ptr<QIODevice> &cipherText, const Context::EncryptionFlags eflags) + { +- run(std::bind(&encrypt, ++ run(std::bind(&do_encrypt, + std::placeholders::_1, std::placeholders::_2, + recipients, + std::placeholders::_3, std::placeholders::_4, |