commit: da55f04795f95f821d79563b9886f89df84d2973 Author: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org> AuthorDate: Tue Apr 10 13:22:10 2018 +0000 Commit: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org> CommitDate: Tue Apr 10 13:22:10 2018 +0000 URL: https://gitweb.gentoo.org/proj/kde-sunset.git/commit/?id=da55f047
app-crypt/qca: Import from Gentoo ebuild repo Package-Manager: Portage-2.3.28, Repoman-2.3.9 app-crypt/qca/files/qca-2.1.3-c++11.patch | 97 ++++++++++++++++++++ app-crypt/qca/files/qca-disable-pgp-test.patch | 13 +++ app-crypt/qca/metadata.xml | 10 ++ app-crypt/qca/qca-2.1.3-r1.ebuild | 122 +++++++++++++++++++++++++ 4 files changed, 242 insertions(+) diff --git a/app-crypt/qca/files/qca-2.1.3-c++11.patch b/app-crypt/qca/files/qca-2.1.3-c++11.patch new file mode 100644 index 0000000..a12f96b --- /dev/null +++ b/app-crypt/qca/files/qca-2.1.3-c++11.patch @@ -0,0 +1,97 @@ +From 5f18ebc705ec98e883aa63cb537e36e6a08b7e34 Mon Sep 17 00:00:00 2001 +From: Alon Bar-Lev <[email protected]> +Date: Tue, 21 Mar 2017 12:23:17 +0200 +Subject: [PATCH] build: fix C++11 throwing distructors + +For >=C++11, explicitly mark throwing destructors `noexcept(false)` + +Thanks: Peter-Levine <[email protected]> +--- + Doxyfile.in | 2 +- + src/botantools/botan/alloc_mmap/mmap_mem.cpp | 2 +- + src/botantools/botan/botan/allocate.h | 8 +++++++- + src/botantools/botan/botan/mem_pool.h | 2 +- + src/botantools/botan/mem_pool.cpp | 2 +- + 5 files changed, 11 insertions(+), 5 deletions(-) + +diff --git a/Doxyfile.in b/Doxyfile.in +index 59d9afe..844c234 100644 +--- a/Doxyfile.in ++++ b/Doxyfile.in +@@ -1070,7 +1070,7 @@ PREDEFINED = DOXYGEN_SHOULD_SKIP_THIS \ + # The macro definition that is found in the sources will be used. + # Use the PREDEFINED tag if you want to use a different macro definition. + +-EXPAND_AS_DEFINED = QCA_EXPORT ++EXPAND_AS_DEFINED = QCA_EXPORT QCA_NOEXCEPT + + # If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then + # doxygen's preprocessor will remove all function-like macros that are alone +diff --git a/src/botantools/botan/alloc_mmap/mmap_mem.cpp b/src/botantools/botan/alloc_mmap/mmap_mem.cpp +index 362b688..54f0d23 100644 +--- a/src/botantools/botan/alloc_mmap/mmap_mem.cpp ++++ b/src/botantools/botan/alloc_mmap/mmap_mem.cpp +@@ -107,7 +107,7 @@ void* MemoryMapping_Allocator::alloc_block(u32bit n) + umask(old_umask); + } + +- ~TemporaryFile() ++ ~TemporaryFile() QCA_NOEXCEPT(false) + { + delete[] filepath; + if(fd != -1 && close(fd) == -1) +diff --git a/src/botantools/botan/botan/allocate.h b/src/botantools/botan/botan/allocate.h +index 0ac351e..52bc397 100644 +--- a/src/botantools/botan/botan/allocate.h ++++ b/src/botantools/botan/botan/allocate.h +@@ -40,6 +40,12 @@ namespace QCA { // WRAPNS_LINE + #include <string> + namespace QCA { // WRAPNS_LINE + ++#if __cplusplus >= 201103L ++#define QCA_NOEXCEPT(x) noexcept(x) ++#else ++#define QCA_NOEXCEPT(x) ++#endif ++ + namespace Botan { + + /************************************************* +@@ -58,7 +64,7 @@ class Allocator + virtual void init() {} + virtual void destroy() {} + +- virtual ~Allocator() {} ++ virtual ~Allocator() QCA_NOEXCEPT(false) {} + }; + + /************************************************* +diff --git a/src/botantools/botan/botan/mem_pool.h b/src/botantools/botan/botan/mem_pool.h +index 32834b8..1cb903e 100644 +--- a/src/botantools/botan/botan/mem_pool.h ++++ b/src/botantools/botan/botan/mem_pool.h +@@ -63,7 +63,7 @@ class Pooling_Allocator : public Allocator + void destroy(); + + Pooling_Allocator(u32bit, bool); +- ~Pooling_Allocator(); ++ ~Pooling_Allocator() QCA_NOEXCEPT(false); + private: + void get_more_core(u32bit); + byte* allocate_blocks(u32bit); +diff --git a/src/botantools/botan/mem_pool.cpp b/src/botantools/botan/mem_pool.cpp +index 00280ec..baa47aa 100644 +--- a/src/botantools/botan/mem_pool.cpp ++++ b/src/botantools/botan/mem_pool.cpp +@@ -171,7 +171,7 @@ Pooling_Allocator::Pooling_Allocator(u32bit p_size, bool) : + /************************************************* + * Pooling_Allocator Destructor * + *************************************************/ +-Pooling_Allocator::~Pooling_Allocator() ++Pooling_Allocator::~Pooling_Allocator() QCA_NOEXCEPT(false) + { + delete mutex; + if(blocks.size()) +-- +2.10.2 + diff --git a/app-crypt/qca/files/qca-disable-pgp-test.patch b/app-crypt/qca/files/qca-disable-pgp-test.patch new file mode 100644 index 0000000..7944e3c --- /dev/null +++ b/app-crypt/qca/files/qca-disable-pgp-test.patch @@ -0,0 +1,13 @@ +diff --git a/unittest/CMakeLists.txt b/unittest/CMakeLists.txt +index f4d9eb9..67ef281 100644 +--- a/unittest/CMakeLists.txt ++++ b/unittest/CMakeLists.txt +@@ -23,7 +23,7 @@ add_subdirectory(keylengthunittest) + add_subdirectory(keystore) + add_subdirectory(macunittest) + add_subdirectory(metatype) +-add_subdirectory(pgpunittest) ++# add_subdirectory(pgpunittest) + add_subdirectory(pipeunittest) + add_subdirectory(pkits) + add_subdirectory(rsaunittest) diff --git a/app-crypt/qca/metadata.xml b/app-crypt/qca/metadata.xml index 6f49eba..04bb89d 100644 --- a/app-crypt/qca/metadata.xml +++ b/app-crypt/qca/metadata.xml @@ -2,4 +2,14 @@ <!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> <pkgmetadata> <!-- maintainer-needed --> +<use> + <flag name="botan">Enable botan plugin</flag> + <flag name="gcrypt">Enable gcrypt plugin</flag> + <flag name="gpg">Enable GnuPG plugin</flag> + <flag name="logger">Enable logger plugin</flag> + <flag name="nss">Enable NSS plugin</flag> + <flag name="pkcs11">Enable PKCS#11 plugin</flag> + <flag name="sasl">Enable SASL plugin</flag> + <flag name="softstore">Enable softstore plugin</flag> +</use> </pkgmetadata> diff --git a/app-crypt/qca/qca-2.1.3-r1.ebuild b/app-crypt/qca/qca-2.1.3-r1.ebuild new file mode 100644 index 0000000..2f074b1 --- /dev/null +++ b/app-crypt/qca/qca-2.1.3-r1.ebuild @@ -0,0 +1,122 @@ +# Copyright 1999-2018 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +inherit cmake-utils multibuild qmake-utils + +DESCRIPTION="Qt Cryptographic Architecture (QCA)" +HOMEPAGE="https://userbase.kde.org/QCA" +SRC_URI="mirror://kde/stable/${PN}/${PV}/src/${P}.tar.xz" + +LICENSE="LGPL-2.1" +SLOT="2" +KEYWORDS="alpha amd64 ~arm ~arm64 ~hppa ~ia64 ppc ~ppc64 ~sparc x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~sparc-solaris" + +IUSE="botan debug doc examples gcrypt gpg libressl logger nss pkcs11 qt4 +qt5 sasl softstore +ssl test" +REQUIRED_USE="|| ( qt4 qt5 )" + +RDEPEND=" + !app-crypt/qca-cyrus-sasl + !app-crypt/qca-gnupg + !app-crypt/qca-logger + !app-crypt/qca-ossl + !app-crypt/qca-pkcs11 + botan? ( dev-libs/botan:0 ) + gcrypt? ( dev-libs/libgcrypt:= ) + gpg? ( app-crypt/gnupg ) + nss? ( dev-libs/nss ) + pkcs11? ( + !libressl? ( dev-libs/openssl:0 ) + libressl? ( dev-libs/libressl ) + dev-libs/pkcs11-helper + ) + qt4? ( >=dev-qt/qtcore-4.8.7-r2:4 ) + qt5? ( + dev-qt/qtcore:5 + dev-qt/qtconcurrent:5 + dev-qt/qtnetwork:5 + ) + sasl? ( dev-libs/cyrus-sasl:2 ) + ssl? ( + !libressl? ( >=dev-libs/openssl-1.0.1:0= ) + libressl? ( dev-libs/libressl:= ) + ) +" +DEPEND="${RDEPEND} + doc? ( app-doc/doxygen ) + test? ( + qt4? ( dev-qt/qttest:4 ) + qt5? ( dev-qt/qttest:5 ) + ) +" + +DOCS=( README TODO ) + +PATCHES=( + "${FILESDIR}/${PN}-disable-pgp-test.patch" + "${FILESDIR}/${P}-c++11.patch" +) + +qca_plugin_use() { + echo -DWITH_${2:-$1}_PLUGIN=$(usex "$1") +} + +pkg_setup() { + MULTIBUILD_VARIANTS=( $(usev qt4) $(usev qt5) ) +} + +src_configure() { + myconfigure() { + local mycmakeargs=( + -DQCA_FEATURE_INSTALL_DIR="${EPREFIX}$(${MULTIBUILD_VARIANT}_get_mkspecsdir)/features" + -DQCA_PLUGINS_INSTALL_DIR="${EPREFIX}$(${MULTIBUILD_VARIANT}_get_plugindir)" + $(qca_plugin_use botan) + $(qca_plugin_use gcrypt) + $(qca_plugin_use gpg gnupg) + $(qca_plugin_use logger) + $(qca_plugin_use nss) + $(qca_plugin_use pkcs11) + $(qca_plugin_use sasl cyrus-sasl) + $(qca_plugin_use softstore) + $(qca_plugin_use ssl ossl) + -DBUILD_TESTS=$(usex test) + ) + + if [[ ${MULTIBUILD_VARIANT} == qt4 ]]; then + mycmakeargs+=(-DQT4_BUILD=ON) + fi + + cmake-utils_src_configure + } + + multibuild_foreach_variant myconfigure +} + +src_compile() { + multibuild_foreach_variant cmake-utils_src_compile +} + +src_test() { + mytest() { + local -x QCA_PLUGIN_PATH="${BUILD_DIR}/lib/qca" + cmake-utils_src_test + } + + multibuild_foreach_variant mytest +} + +src_install() { + multibuild_foreach_variant cmake-utils_src_install + + if use doc; then + pushd "${BUILD_DIR}" >/dev/null || die + doxygen Doxyfile.in || die + dodoc -r apidocs/html + popd >/dev/null || die + fi + + if use examples; then + dodoc -r "${S}"/examples + fi +}
