From owner-svn-ports-head@freebsd.org Thu Nov 17 13:55:49 2016 Return-Path: Delivered-To: svn-ports-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A65A3C470FF; Thu, 17 Nov 2016 13:55:49 +0000 (UTC) (envelope-from jhale@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 655D8E92; Thu, 17 Nov 2016 13:55:49 +0000 (UTC) (envelope-from jhale@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAHDtm3j040586; Thu, 17 Nov 2016 13:55:48 GMT (envelope-from jhale@FreeBSD.org) Received: (from jhale@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAHDtmuj040581; Thu, 17 Nov 2016 13:55:48 GMT (envelope-from jhale@FreeBSD.org) Message-Id: <201611171355.uAHDtmuj040581@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhale set sender to jhale@FreeBSD.org using -f From: "Jason E. Hale" Date: Thu, 17 Nov 2016 13:55:48 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r426284 - in head/security: gpgme gpgme-cpp gpgme-qt5 gpgme/files X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Nov 2016 13:55:49 -0000 Author: jhale Date: Thu Nov 17 13:55:47 2016 New Revision: 426284 URL: https://svnweb.freebsd.org/changeset/ports/426284 Log: 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 > 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 Added: head/security/gpgme/files/patch-git_b4658f6a1 (contents, props changed) head/security/gpgme/files/patch-lang_qt_src_qgpgmeencryptjob.cpp (contents, props changed) Modified: head/security/gpgme-cpp/Makefile head/security/gpgme-qt5/Makefile head/security/gpgme/Makefile Modified: head/security/gpgme-cpp/Makefile ============================================================================== --- head/security/gpgme-cpp/Makefile Thu Nov 17 11:32:45 2016 (r426283) +++ head/security/gpgme-cpp/Makefile Thu Nov 17 13:55:47 2016 (r426284) @@ -1,6 +1,6 @@ # $FreeBSD$ -PORTREVISION= 0 +PORTREVISION= 1 PKGNAMESUFFIX= -${SLAVEPORT} MAINTAINER= jhale@FreeBSD.org Modified: head/security/gpgme-qt5/Makefile ============================================================================== --- head/security/gpgme-qt5/Makefile Thu Nov 17 11:32:45 2016 (r426283) +++ head/security/gpgme-qt5/Makefile Thu Nov 17 13:55:47 2016 (r426284) @@ -1,6 +1,6 @@ # $FreeBSD$ -PORTREVISION= 1 +PORTREVISION= 2 PKGNAMESUFFIX= -${SLAVEPORT} MAINTAINER= jhale@FreeBSD.org Modified: head/security/gpgme/Makefile ============================================================================== --- head/security/gpgme/Makefile Thu Nov 17 11:32:45 2016 (r426283) +++ head/security/gpgme/Makefile Thu Nov 17 13:55:47 2016 (r426284) @@ -60,13 +60,15 @@ INSTALL_WRKSRC= ${WRKSRC}/lang/${BINDING . 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 .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" Added: head/security/gpgme/files/patch-git_b4658f6a1 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/security/gpgme/files/patch-git_b4658f6a1 Thu Nov 17 13:55:47 2016 (r426284) @@ -0,0 +1,35 @@ +From: Andras Mantia +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 +--- + +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); + } Added: head/security/gpgme/files/patch-lang_qt_src_qgpgmeencryptjob.cpp ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/security/gpgme/files/patch-lang_qt_src_qgpgmeencryptjob.cpp Thu Nov 17 13:55:47 2016 (r426284) @@ -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 &recipients, + const std::weak_ptr &plainText_, + const std::weak_ptr &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(), eflags, outputIsBsse64Encoded); ++ return do_encrypt(ctx, 0, recipients, buffer, std::shared_ptr(), eflags, outputIsBsse64Encoded); + } + + Error QGpgMEEncryptJob::start(const std::vector &recipients, const QByteArray &plainText, bool alwaysTrust) +@@ -130,7 +130,7 @@ Error QGpgMEEncryptJob::start(const std: + void QGpgMEEncryptJob::start(const std::vector &recipients, const std::shared_ptr &plainText, + const std::shared_ptr &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,