diff --git a/net-im/psi/Makefile b/net-im/psi/Makefile index 48515743de2a..e1d09e0f763b 100644 --- a/net-im/psi/Makefile +++ b/net-im/psi/Makefile @@ -1,52 +1,56 @@ PORTNAME= psi PORTVERSION= 1.5 PORTREVISION= 3 CATEGORIES= net-im MASTER_SITES= SF/${PORTNAME}/Psi/${PORTVERSION} +DISTFILES= ${PORTNAME}-${PORTVERSION}${EXTRACT_SUFX} MAINTAINER= danfe@FreeBSD.org COMMENT= Qt-based Jabber (XMPP) client WWW= https://psi-im.org/ LICENSE= GPLv2+ LIB_DEPENDS= libidn.so:dns/libidn \ libqca-qt5.so:devel/qca@qt5 USES= cmake compiler:c++11-lang desktop-file-utils minizip pkgconfig \ qt:5 tar:xz xorg USE_QT= concurrent core dbus gui multimedia network svg widgets \ x11extras xml buildtools:build qmake:build imageformats:run USE_XORG= ice sm x11 xcb xext xscrnsaver CMAKE_ARGS= -DIDN_LIBRARY:FILEPATH="${LOCALBASE}/lib/libidn.so" \ -DIDN_INCLUDE_DIR:PATH="${LOCALBASE}/include" +USE_GITHUB= nodefault +GH_TUPLE= TartanLlama:optional:v1.1.0:tlo/tlo + OPTIONS_DEFINE= WEBENGINE OPTIONS_RADIO= SPELLCHECK OPTIONS_RADIO_SPELLCHECK= HUNSPELL ENCHANT SPELLCHECK_DESC= Spell checker backend OPTIONS_DEFAULT= HUNSPELL OPTIONS_SUB= yes WEBENGINE_DESC= Use QtWebEngine for chatlogs WEBENGINE_USE= QT=declarative,location,printsupport,webchannel,webengine WEBENGINE_CMAKE_BOOL= ENABLE_WEBKIT HUNSPELL_LIB_DEPENDS= libhunspell-1.7.so:textproc/hunspell HUNSPELL_CMAKE_BOOL= USE_HUNSPELL ENCHANT_DESC= Spell checking support via Enchant ENCHANT_LIB_DEPENDS= libenchant.so:textproc/enchant ENCHANT_CMAKE_BOOL= USE_ENCHANT post-patch: # Replace original Hunspell implementation with better alternative @${CP} ${FILESDIR}/hunspellchecker.* \ ${WRKSRC}/src/libpsi/tools/spellchecker # Avoid conflict with C++20 by adding .txt suffix @${MV} ${WRKSRC}/version ${WRKSRC}/version.txt @${REINPLACE_CMD} -i .c++20 's,SOURCE_DIR}/version,&.txt,' \ ${WRKSRC}/CMakeLists.txt .include diff --git a/net-im/psi/distinfo b/net-im/psi/distinfo index be15a93d7f6d..2b9ee9d361b8 100644 --- a/net-im/psi/distinfo +++ b/net-im/psi/distinfo @@ -1,3 +1,5 @@ TIMESTAMP = 1599398002 SHA256 (psi-1.5.tar.xz) = 3167350fd43fab4dc948cb5179ca10159a7aa318472d1a8a7617e41f5aa8b5b7 SIZE (psi-1.5.tar.xz) = 2125104 +SHA256 (TartanLlama-optional-v1.1.0_GH0.tar.gz) = 88ece79f3de5ccaec4191951a222f95cc80c4381dafd3163bdb1ff87cedf3118 +SIZE (TartanLlama-optional-v1.1.0_GH0.tar.gz) = 22265 diff --git a/net-im/psi/files/patch-iris_src_xmpp_xmpp-im_types.cpp b/net-im/psi/files/patch-iris_src_xmpp_xmpp-im_types.cpp new file mode 100644 index 000000000000..cb5d4c8b75c0 --- /dev/null +++ b/net-im/psi/files/patch-iris_src_xmpp_xmpp-im_types.cpp @@ -0,0 +1,58 @@ +--- iris/src/xmpp/xmpp-im/types.cpp.orig 2020-09-06 07:44:45 UTC ++++ iris/src/xmpp/xmpp-im/types.cpp +@@ -2275,8 +2275,7 @@ bool Subscription::fromString(const QString &s) + /** + * Default constructor. + */ +-CapsSpec::CapsSpec() : +- hashAlgo_(CapsSpec::invalidAlgo) ++CapsSpec::CapsSpec() + { + } + +@@ -2287,7 +2286,7 @@ CapsSpec::CapsSpec() : + * @param ven the version + * @param ext the list of extensions (separated by spaces) + */ +-CapsSpec::CapsSpec(const QString& node, QCryptographicHash::Algorithm hashAlgo, const QString& ver) ++CapsSpec::CapsSpec(const QString& node, XMPP::CapsSpec::AlgoOpt hashAlgo, const QString& ver) + : node_(node) + , ver_(ver) + , hashAlgo_(hashAlgo) +@@ -2305,7 +2304,7 @@ CapsSpec::CapsSpec(const DiscoItem &disco, QCryptograp + */ + bool CapsSpec::isValid() const + { +- return !node_.isEmpty() && !ver_.isEmpty() && (hashAlgo_ != CapsSpec::invalidAlgo); ++ return !node_.isEmpty() && !ver_.isEmpty() && hashAlgo_; + } + + +@@ -2326,7 +2325,7 @@ const QString& CapsSpec::version() const + return ver_; + } + +-QCryptographicHash::Algorithm CapsSpec::hashAlgorithm() const ++XMPP::CapsSpec::AlgoOpt CapsSpec::hashAlgorithm() const + { + return hashAlgo_; + } +@@ -2335,8 +2334,7 @@ QDomElement CapsSpec::toXml(QDomDocument *doc) const + { + QDomElement c = doc->createElement("c"); + c.setAttribute("xmlns", NS_CAPS); +- QString algo = cryptoMap().key(hashAlgo_); +- c.setAttribute("hash",algo); ++ c.setAttribute("hash", hashAlgo_ ? cryptoMap().key(*hashAlgo_) : ""); + c.setAttribute("node",node_); + c.setAttribute("ver",ver_); + return c; +@@ -2351,7 +2349,7 @@ CapsSpec CapsSpec::fromXml(const QDomElement &e) + CryptoMap &cm = cryptoMap(); + CapsSpec cs; + if (!node.isEmpty() && !ver.isEmpty()) { +- QCryptographicHash::Algorithm algo = CapsSpec::invalidAlgo; ++ tl::optional algo; + CryptoMap::ConstIterator it; + if (!hashAlgo.isEmpty() && (it = cm.constFind(hashAlgo)) != cm.constEnd()) { + algo = it.value(); diff --git a/net-im/psi/files/patch-iris_src_xmpp_xmpp-im_xmpp__caps.cpp b/net-im/psi/files/patch-iris_src_xmpp_xmpp-im_xmpp__caps.cpp new file mode 100644 index 000000000000..f66b9a105492 --- /dev/null +++ b/net-im/psi/files/patch-iris_src_xmpp_xmpp-im_xmpp__caps.cpp @@ -0,0 +1,12 @@ +--- iris/src/xmpp/xmpp-im/xmpp_caps.cpp.orig 2020-09-06 07:44:45 UTC ++++ iris/src/xmpp/xmpp-im/xmpp_caps.cpp +@@ -336,7 +336,8 @@ void CapsManager::updateDisco(const Jid &jid, const Di + if (!cs.isValid()) { + return; + } +- if (item.capsHash(cs.hashAlgorithm()) == cs.version()) { ++ auto algo = cs.hashAlgorithm(); ++ if (algo && item.capsHash(*algo) == cs.version()) { + CapsRegistry::instance()->registerCaps(cs, item); + } + } diff --git a/net-im/psi/files/patch-iris_src_xmpp_xmpp-im_xmpp__status.h b/net-im/psi/files/patch-iris_src_xmpp_xmpp-im_xmpp__status.h new file mode 100644 index 000000000000..fd0d7baf54c1 --- /dev/null +++ b/net-im/psi/files/patch-iris_src_xmpp_xmpp-im_xmpp__status.h @@ -0,0 +1,40 @@ +--- iris/src/xmpp/xmpp-im/xmpp_status.h.orig 2020-09-06 11:27:29 UTC ++++ iris/src/xmpp/xmpp-im/xmpp_status.h +@@ -27,6 +27,8 @@ + #include + #include + ++#include "../../../../tlo/include/tl/optional.hpp" ++ + #include "xmpp_muc.h" + #include "xmpp_bitsofbinary.h" + +@@ -37,16 +39,16 @@ namespace XMPP + { + public: + typedef QMap CryptoMap; +- static const QCryptographicHash::Algorithm invalidAlgo = (QCryptographicHash::Algorithm)255; ++ using AlgoOpt = tl::optional; + + CapsSpec(); +- CapsSpec(const QString& node, QCryptographicHash::Algorithm hashAlgo, const QString& ver = QString()); ++ CapsSpec(const QString& node, AlgoOpt hashAlgo, const QString& ver = QString()); + CapsSpec(const DiscoItem &disco, QCryptographicHash::Algorithm hashAlgo = QCryptographicHash::Sha1); + + bool isValid() const; + const QString& node() const; + const QString& version() const; +- QCryptographicHash::Algorithm hashAlgorithm() const; ++ AlgoOpt hashAlgorithm() const; + inline const QStringList &ext() const { return ext_; } + QString flatten() const; + +@@ -63,7 +65,7 @@ namespace XMPP + + private: + QString node_, ver_; +- QCryptographicHash::Algorithm hashAlgo_; ++ AlgoOpt hashAlgo_; + QStringList ext_; + }; +