swiften: use vendored Boost

Because of old Boost.Asio usage
This commit is contained in:
Đoàn Trần Công Danh 2025-08-07 05:35:51 +07:00
parent e0f0b1ec89
commit c2115eb673
4 changed files with 13 additions and 81 deletions

View file

@ -1,42 +0,0 @@
--- a/Swiften/Component/CoreComponent.cpp
+++ b/Swiften/Component/CoreComponent.cpp
@@ -19,12 +19,26 @@
#include <Swiften/TLS/PKCS12Certificate.h>
#include <Swiften/TLS/TLSOptions.h>
+
namespace Swift {
+namespace {
+
+void CoreComponent_onMessageReceived(CoreComponent *self, std::shared_ptr<Message> msg)
+{
+ self->onMessageReceived(msg);
+}
+
+void CoreComponent_onPresenceReceived(CoreComponent *self, std::shared_ptr<Presence> p)
+{
+ self->onPresenceReceived(p);
+}
+}
+
CoreComponent::CoreComponent(const JID& jid, const std::string& secret, NetworkFactories* networkFactories) : networkFactories(networkFactories), jid_(jid), secret_(secret), disconnectRequested_(false) {
stanzaChannel_ = new ComponentSessionStanzaChannel();
- stanzaChannel_->onMessageReceived.connect(boost::ref(onMessageReceived));
- stanzaChannel_->onPresenceReceived.connect(boost::ref(onPresenceReceived));
+ stanzaChannel_->onMessageReceived.connect(boost::bind(&CoreComponent_onMessageReceived, this, _1));
+ stanzaChannel_->onPresenceReceived.connect(boost::bind(&CoreComponent_onPresenceReceived, this, _1));
stanzaChannel_->onAvailableChanged.connect(boost::bind(&CoreComponent::handleStanzaChannelAvailableChanged, this, _1));
iqRouter_ = new IQRouter(stanzaChannel_);
@@ -38,8 +52,8 @@ CoreComponent::~CoreComponent() {
delete iqRouter_;
stanzaChannel_->onAvailableChanged.disconnect(boost::bind(&CoreComponent::handleStanzaChannelAvailableChanged, this, _1));
- stanzaChannel_->onMessageReceived.disconnect(boost::ref(onMessageReceived));
- stanzaChannel_->onPresenceReceived.disconnect(boost::ref(onPresenceReceived));
+ stanzaChannel_->onMessageReceived.disconnect(boost::bind(&CoreComponent_onMessageReceived, this, _1));
+ stanzaChannel_->onPresenceReceived.disconnect(boost::bind(&CoreComponent_onPresenceReceived, this, _1));
delete stanzaChannel_;
}

View file

@ -1,15 +0,0 @@
--- a/Swiften/Base/Platform.h
+++ b/Swiften/Base/Platform.h
@@ -43,9 +43,9 @@
#endif
// Endianness
-#include <boost/detail/endian.hpp>
-#if defined(BOOST_LITTLE_ENDIAN)
+#include <boost/predef/other/endian.h>
+#if BOOST_ENDIAN_LITTLE_BYTE
#define SWIFTEN_LITTLE_ENDIAN
-#elif defined(BOOST_BIG_ENDIAN)
+#elif BOOST_ENDIAN_BIG_BYTE
#define SWIFTEN_BIG_ENDIAN
#endif

View file

@ -1,10 +0,0 @@
--- a/Swiften/Network/PlatformNATTraversalWorker.cpp 2020-10-24 22:55:12.152288582 +0700
+++ b/Swiften/Network/PlatformNATTraversalWorker.cpp 2020-10-24 22:55:31.022346592 +0700
@@ -14,6 +14,7 @@
#include <memory>
+#include <boost/logic/tribool_io.hpp>
#include <boost/numeric/conversion/cast.hpp>
#include <Swiften/Base/Log.h>

View file

@ -1,9 +1,10 @@
# Template file for 'swiften' # Template file for 'swiften'
pkgname=swiften pkgname=swiften
version=4.0.3 version=4.0.3
revision=6 revision=7
hostmakedepends="scons pkg-config" hostmakedepends="pkg-config python2"
makedepends="boost-devel openssl-devel libxml2-devel libidn-devel # Use old version of Boost.Asio
makedepends="openssl-devel libxml2-devel libidn-devel libnatpmp-devel
lua51-devel miniupnpc-devel sqlite-devel hunspell-devel" lua51-devel miniupnpc-devel sqlite-devel hunspell-devel"
short_desc="XMPP library for C++" short_desc="XMPP library for C++"
maintainer="Orphaned <orphan@voidlinux.org>" maintainer="Orphaned <orphan@voidlinux.org>"
@ -24,21 +25,19 @@ case "$XBPS_TARGET_MACHINE" in
ppc*) CXXFLAGS+=" -fPIC";; ppc*) CXXFLAGS+=" -fPIC";;
esac esac
post_patch() { pre_patch() {
rm -rf 3rdParty/Boost/src # Use old version of Boost.Asio
# rm -rf 3rdParty/Boost/src
rm -rf 3rdParty/Expat/src rm -rf 3rdParty/Expat/src
rm -rf 3rdParty/LibIDN/src rm -rf 3rdParty/LibIDN/src
rm -rf 3rdParty/LibMiniUPnPc/src rm -rf 3rdParty/LibMiniUPnPc/src
# rm -rf 3rdParty/LibNATPMP/src rm -rf 3rdParty/LibNATPMP/src
rm -rf 3rdParty/Lua/src rm -rf 3rdParty/Lua/src
rm -rf 3rdParty/SCons # rm -rf 3rdParty/SCons
rm -rf 3rdParty/SQLite/sqlite* rm -rf 3rdParty/SQLite/sqlite*
rm -rf 3rdParty/ZLib/src rm -rf 3rdParty/ZLib/src
find . \( \
-name '*.py' -o -name SConscript -o -name SConstruct \
\) -exec 2to3 -w {} +
if [ "$CROSS_BUILD" ]; then if [ "$CROSS_BUILD" ]; then
vsed -i -e "s,/usr/include,$XBPS_CROSS_BASE&," \ sed -i -e "s,/usr/include,$XBPS_CROSS_BASE&," \
BuildTools/SCons/SConstruct BuildTools/SCons/SConstruct
fi fi
} }
@ -48,13 +47,13 @@ do_build() {
do do
if [[ "$_llib" = -llua* ]]; then if [[ "$_llib" = -llua* ]]; then
lua_libname=${_llib#-l} lua_libname=${_llib#-l}
vsed -i -e " sed -i -e "
/lua_libname/s/\"lua\"/\"$lua_libname\"/ /lua_libname/s/\"lua\"/\"$lua_libname\"/
" BuildTools/SCons/SConscript.boot " BuildTools/SCons/SConscript.boot
fi fi
done done
CXXFLAGS+=" $($PKG_CONFIG --cflags lua)" CXXFLAGS+=" $($PKG_CONFIG --cflags lua)"
scons \ ./scons \
cc="${CC}" \ cc="${CC}" \
cxx="${CXX}" \ cxx="${CXX}" \
linkflags="${LDFLAGS}" \ linkflags="${LDFLAGS}" \
@ -65,7 +64,7 @@ do_build() {
do_install() { do_install() {
CXXFLAGS+=" $($PKG_CONFIG --cflags lua)" CXXFLAGS+=" $($PKG_CONFIG --cflags lua)"
scons \ ./scons \
cc="${CC}" \ cc="${CC}" \
cxx="${CXX}" \ cxx="${CXX}" \
linkflags="${LDFLAGS}" \ linkflags="${LDFLAGS}" \