New package: eiskaltdcpp-qt-2.2.10

Closes: #10522 [via git-merge-pr]
This commit is contained in:
samsky72 2018-01-06 16:43:07 +05:00 committed by Jürgen Buchmüller
parent 7dd890292b
commit c7cab2ec43
5 changed files with 176 additions and 0 deletions

View File

@ -0,0 +1,65 @@
--- dcpp/Util.cpp 2015-04-20 02:57:16.000000000 +0500
+++ dcpp/Util.cpp.new 2017-10-09 15:00:00.000000000 +0500
@@ -171,8 +171,8 @@
::GetShortPathName(localePath_.c_str(), buf, sizeof(buf)/sizeof(TCHAR));
if (Util::getPath(Util::PATH_LOCALE).empty())
paths[PATH_LOCALE] = Text::fromT(buf);
- if (Util::getPath(Util::PATH_DOWNLOADS).empty())
- paths[PATH_DOWNLOADS] = getDownloadsPath(paths[PATH_USER_CONFIG]);
+ //if (Util::getPath(Util::PATH_DOWNLOADS).empty())
+ // paths[PATH_DOWNLOADS] = getDownloadsPath(paths[PATH_USER_CONFIG]);
#else
if (Util::getPath(Util::PATH_GLOBAL_CONFIG).empty())
@@ -704,7 +704,7 @@
#endif
}
-vector<string> Util::getLocalIPs() {
+vector<string> Util::getLocalIPs(unsigned short sa_family) {
vector<string> addresses;
#ifdef HAVE_IFADDRS_H
@@ -712,6 +712,9 @@
if (getifaddrs(&ifap) == 0)
{
+ bool ipv4 = (sa_family == AF_UNSPEC) || (sa_family == AF_INET);
+ bool ipv6 = (sa_family == AF_UNSPEC) || (sa_family == AF_INET6);
+
for (struct ifaddrs *i = ifap; i != NULL; i = i->ifa_next)
{
struct sockaddr *sa = i->ifa_addr;
@@ -723,14 +726,14 @@
socklen_t len;
// IPv4 address
- if (sa->sa_family == AF_INET)
+ if (ipv4 && (sa->sa_family == AF_INET))
{
struct sockaddr_in* sai = (struct sockaddr_in*)sa;
src = (void*) &(sai->sin_addr);
len = INET_ADDRSTRLEN;
}
// IPv6 address
- else if (sa->sa_family == AF_INET6)
+ else if (ipv6 && (sa->sa_family == AF_INET6))
{
struct sockaddr_in6* sai6 = (struct sockaddr_in6*)sa;
src = (void*) &(sai6->sin6_addr);
@@ -752,9 +755,13 @@
return addresses;
}
-string Util::getLocalIp() {
+string Util::getLocalIp(unsigned short as_family) {
#ifdef HAVE_IFADDRS_H
- return getLocalIPs().empty() ? "0.0.0.0" : getLocalIPs()[0];
+ vector<string> addresses = getLocalIPs(as_family);
+ if (addresses.empty())
+ return (((as_family == AF_UNSPEC) || (as_family == AF_INET)) ? "0.0.0.0" : "::");
+
+ return addresses[0];
#else
string tmp;

View File

@ -0,0 +1,36 @@
--- dcpp/Util.h 2015-04-20 02:57:16.000000000 +0500
+++ dcpp/Util.h.new 2017-10-09 15:00:00.000000000 +0500
@@ -28,6 +28,13 @@
#include <sys/stat.h>
#include <sys/types.h>
+
+#ifdef _WIN32
+#include <winsock2.h>
+#else
+#include <sys/socket.h>
+#endif
+
#include <unistd.h>
#include <cstdlib>
#include <vector>
@@ -270,7 +270,7 @@
#ifdef _WIN32
return _atoi64(aString.c_str());
#else
- #ifndef __HAIKU__
+ #if !defined(__HAIKU__) && defined(__GLIBC__)
return strtoq(aString.c_str(), (char **)NULL, 10);
#else
return strtoll(aString.c_str(), (char **)NULL, 10);
@@ -403,8 +410,8 @@
}
static string encodeURI(const string& /*aString*/, bool reverse = false);
- static string getLocalIp();
- static std::vector<string> getLocalIPs();
+ static string getLocalIp(unsigned short sa_family = AF_UNSPEC);
+ static std::vector<string> getLocalIPs(unsigned short sa_family = AF_UNSPEC);
static bool isPrivateIp(string const& ip);
static string formatAdditionalInfo(const std::string& aIp, bool sIp, bool sCC);
/**

View File

@ -0,0 +1,20 @@
--- eiskaltdcpp-qt/src/main.cpp 2015-04-20 02:57:16.000000000 +0500
+++ eiskaltdcpp-qt/src/main.cpp.new 2018-01-07 08:47:19.501488838 +0500
@@ -72,7 +72,7 @@
#if !defined(Q_WS_WIN)
#include <unistd.h>
#include <signal.h>
-#if !defined (__HAIKU__)
+#if !defined (__HAIKU__) && defined (__GLIBC__)
#include <execinfo.h>
#ifdef ENABLE_STACKTRACE
@@ -127,7 +127,7 @@
return 0;
}
-#if !defined (Q_WS_WIN) && !defined (__HAIKU__)
+#if !defined (Q_WS_WIN) && !defined (__HAIKU__) && defined (__GLIBC__)
installHandlers();
#endif

View File

@ -0,0 +1,30 @@
--- extra/upnpc.cpp 2015-04-20 02:57:16.000000000 +0500
+++ extra/upnpc.new 2017-10-09 15:00:00.000000000 +0500
@@ -41,9 +41,13 @@
bool UPnPc::init()
{
- UPNPDev *devices = upnpDiscover(5000, SettingsManager::getInstance()->isDefault(SettingsManager::BIND_ADDRESS) ? 0 : SETTING(BIND_ADDRESS).c_str(), 0, 0
-#if (MINIUPNPC_API_VERSION == 8 || defined(MINIUPNPC16))
- , 0, 0);
+ UPNPDev *devices = upnpDiscover(5000, SettingsManager::getInstance()->isDefault(SettingsManager::BIND_ADDRESS) ? 0 : SETTING(BIND_ADDRESS).c_str(), NULL, 0
+#if (MINIUPNPC_API_VERSION >= 8 || defined(MINIUPNPC16))
+ , 0
+#if (MINIUPNPC_API_VERSION >= 14)
+ , 2
+#endif
+ , NULL);
#else
);
#endif
@@ -63,8 +67,8 @@
const string port_ = Util::toString(port);
return UPNP_AddPortMapping(urls.controlURL, data.first.servicetype, port_.c_str(), port_.c_str(),
- Util::getLocalIp().c_str(), description.c_str(), protocols[protocol], NULL
-#if (MINIUPNPC_API_VERSION == 8 || defined(MINIUPNPC16))
+ Util::getLocalIp(AF_INET).c_str(), description.c_str(), protocols[protocol], NULL
+#if (MINIUPNPC_API_VERSION >= 8 || defined(MINIUPNPC16))
, 0) == UPNPCOMMAND_SUCCESS;
#else
) == UPNPCOMMAND_SUCCESS;

View File

@ -0,0 +1,25 @@
# Template file for 'eiskaltdcpp-qt'
pkgname=eiskaltdcpp-qt
version=2.2.10
revision=1
wrksrc="eiskaltdcpp-${version}"
build_style=cmake
configure_args="-DUSE_MINIUPNP=ON"
hostmakedepends="pkg-config"
makedepends="bzip2-devel zlib-devel libressl-devel libidn-devel boost-devel miniupnpc-devel qt-devel"
short_desc="EiskaltDC++ is a cross-platform Direct Connect and ADC clent"
maintainer="samsky72 <samsky72@gmail.com>"
license="GPL-3"
homepage="https://sourceforge.net/projects/eiskaltdcpp"
distfiles="https://github.com/eiskaltdcpp/eiskaltdcpp/archive/v${version}.tar.gz"
checksum=e461c8c499e459651d6382a6ded6788e5ac9a9c4ff26386c3cf073d94d606127
if [ -n "$CROSS_BUILD" ]; then
hostmakedepends+=" qt-devel"
fi
case $XBPS_TARGET_MACHINE in
*-musl) makedepends+=" gettext-libs"
configure_args+=' -DCMAKE_EXE_LINKER_FLAGS="-lintl"';;
*) configure_args+=' -DCMAKE_EXE_LINKER_FLAGS="-lpthread"';;
esac