File qbittorrent-fix_boost_1.75_build.patch of Package qbittorrent
Index: qBittorrent-release-5.0.0rc1/CMakeLists.txt
===================================================================
--- qBittorrent-release-5.0.0rc1.orig/CMakeLists.txt
+++ qBittorrent-release-5.0.0rc1/CMakeLists.txt
@@ -7,7 +7,7 @@ project(qBittorrent
)
# version requirements - older versions may work, but you are on your own
-set(minBoostVersion 1.76)
+set(minBoostVersion 1.75)
set(minQt6Version 6.5.0)
set(minOpenSSLVersion 3.0.2)
set(minLibtorrent1Version 1.2.19)
Index: qBittorrent-release-5.0.0rc1/src/app/stacktrace.cpp
===================================================================
--- qBittorrent-release-5.0.0rc1.orig/src/app/stacktrace.cpp
+++ qBittorrent-release-5.0.0rc1/src/app/stacktrace.cpp
@@ -30,7 +30,16 @@
#include <boost/stacktrace.hpp>
+#include <sstream>
+#include <boost/version.hpp>
+
std::string getStacktrace()
{
+#if BOOST_VERSION > 107500
return boost::stacktrace::to_string(boost::stacktrace::stacktrace());
+#else
+ std::ostringstream out;
+ out << boost::stacktrace::stacktrace();
+ return out.str();
+#endif
}
Index: qBittorrent-release-5.0.0rc1/src/base/bittorrent/sessionimpl.cpp
===================================================================
--- qBittorrent-release-5.0.0rc1.orig/src/base/bittorrent/sessionimpl.cpp
+++ qBittorrent-release-5.0.0rc1/src/base/bittorrent/sessionimpl.cpp
@@ -42,7 +42,10 @@
#include <iphlpapi.h>
#endif
+#include <boost/version.hpp>
+#if BOOST_VERSION > 107500
#include <boost/asio/ip/tcp.hpp>
+#endif
#include <libtorrent/add_torrent_params.hpp>
#include <libtorrent/address.hpp>
@@ -96,6 +99,9 @@
#include "extensiondata.h"
#include "filesearcher.h"
#include "filterparserthread.h"
+#if BOOST_VERSION == 107500
+#include "hash.h"
+#endif
#include "loadtorrentparams.h"
#include "lttypecast.h"
#include "nativesessionextension.h"
Index: qBittorrent-release-5.0.0rc1/src/base/bittorrent/hash.h
===================================================================
--- /dev/null
+++ qBittorrent-release-5.0.0rc1/src/base/bittorrent/hash.h
@@ -0,0 +1,72 @@
+#pragma once
+
+#include <boost/asio/ip/tcp.hpp>
+#include <functional>
+
+namespace std {
+
+template <>
+struct hash<boost::asio::ip::address_v4>
+{
+ std::size_t operator()(const boost::asio::ip::address_v4& addr)
+ const BOOST_ASIO_NOEXCEPT
+ {
+ return std::hash<unsigned int>()(addr.to_uint());
+ }
+};
+
+template <>
+struct hash<boost::asio::ip::address_v6>
+{
+ std::size_t operator()(const boost::asio::ip::address_v6& addr)
+ const BOOST_ASIO_NOEXCEPT
+ {
+ const boost::asio::ip::address_v6::bytes_type bytes = addr.to_bytes();
+ std::size_t result = static_cast<std::size_t>(addr.scope_id());
+ combine_4_bytes(result, &bytes[0]);
+ combine_4_bytes(result, &bytes[4]);
+ combine_4_bytes(result, &bytes[8]);
+ combine_4_bytes(result, &bytes[12]);
+ return result;
+ }
+
+private:
+ static void combine_4_bytes(std::size_t& seed, const unsigned char* bytes)
+ {
+ const std::size_t bytes_hash =
+ (static_cast<std::size_t>(bytes[0]) << 24) |
+ (static_cast<std::size_t>(bytes[1]) << 16) |
+ (static_cast<std::size_t>(bytes[2]) << 8) |
+ (static_cast<std::size_t>(bytes[3]));
+ seed ^= bytes_hash + 0x9e3779b9 + (seed << 6) + (seed >> 2);
+ }
+};
+
+template <>
+struct hash<boost::asio::ip::address>
+{
+ std::size_t operator()(const boost::asio::ip::address& addr)
+ const BOOST_ASIO_NOEXCEPT
+ {
+ return addr.is_v4()
+ ? std::hash<boost::asio::ip::address_v4>()(addr.to_v4())
+ : std::hash<boost::asio::ip::address_v6>()(addr.to_v6());
+ }
+};
+
+template <typename InternetProtocol>
+struct hash<boost::asio::ip::basic_endpoint<InternetProtocol> >
+{
+ std::size_t operator()(
+ const boost::asio::ip::basic_endpoint<InternetProtocol>& ep)
+ const BOOST_ASIO_NOEXCEPT
+ {
+ std::size_t hash1 = std::hash<boost::asio::ip::address>()(ep.address());
+ std::size_t hash2 = std::hash<unsigned short>()(ep.port());
+ return hash1 ^ (hash2 + 0x9e3779b9 + (hash1 << 6) + (hash1 >> 2));
+ }
+};
+
+} // namespace std
+
+
Index: qBittorrent-release-5.0.0rc1/src/base/bittorrent/torrentimpl.h
===================================================================
--- qBittorrent-release-5.0.0rc1.orig/src/base/bittorrent/torrentimpl.h
+++ qBittorrent-release-5.0.0rc1/src/base/bittorrent/torrentimpl.h
@@ -49,6 +49,10 @@
#include "base/path.h"
#include "base/tagset.h"
+#include <boost/version.hpp>
+#if BOOST_VERSION == 107500
+#include "hash.h"
+#endif
#include "infohash.h"
#include "speedmonitor.h"
#include "sslparameters.h"