From c7cab2ec43908adc722b7121a3582d9f916e047f Mon Sep 17 00:00:00 2001 From: samsky72 Date: Sat, 6 Jan 2018 16:43:07 +0500 Subject: [PATCH] New package: eiskaltdcpp-qt-2.2.10 Closes: #10522 [via git-merge-pr] --- srcpkgs/eiskaltdcpp-qt/patches/Util.cpp.patch | 65 +++++++++++++++++++ srcpkgs/eiskaltdcpp-qt/patches/Util.h.patch | 36 ++++++++++ srcpkgs/eiskaltdcpp-qt/patches/musl.patch | 20 ++++++ .../eiskaltdcpp-qt/patches/upnpc.cpp.patch | 30 +++++++++ srcpkgs/eiskaltdcpp-qt/template | 25 +++++++ 5 files changed, 176 insertions(+) create mode 100644 srcpkgs/eiskaltdcpp-qt/patches/Util.cpp.patch create mode 100644 srcpkgs/eiskaltdcpp-qt/patches/Util.h.patch create mode 100644 srcpkgs/eiskaltdcpp-qt/patches/musl.patch create mode 100644 srcpkgs/eiskaltdcpp-qt/patches/upnpc.cpp.patch create mode 100644 srcpkgs/eiskaltdcpp-qt/template diff --git a/srcpkgs/eiskaltdcpp-qt/patches/Util.cpp.patch b/srcpkgs/eiskaltdcpp-qt/patches/Util.cpp.patch new file mode 100644 index 00000000000..50603313aeb --- /dev/null +++ b/srcpkgs/eiskaltdcpp-qt/patches/Util.cpp.patch @@ -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 Util::getLocalIPs() { ++vector Util::getLocalIPs(unsigned short sa_family) { + vector 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 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; + diff --git a/srcpkgs/eiskaltdcpp-qt/patches/Util.h.patch b/srcpkgs/eiskaltdcpp-qt/patches/Util.h.patch new file mode 100644 index 00000000000..615f1b11aa3 --- /dev/null +++ b/srcpkgs/eiskaltdcpp-qt/patches/Util.h.patch @@ -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 + #include ++ ++#ifdef _WIN32 ++#include ++#else ++#include ++#endif ++ + #include + #include + #include +@@ -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 getLocalIPs(); ++ static string getLocalIp(unsigned short sa_family = AF_UNSPEC); ++ static std::vector getLocalIPs(unsigned short sa_family = AF_UNSPEC); + static bool isPrivateIp(string const& ip); + static string formatAdditionalInfo(const std::string& aIp, bool sIp, bool sCC); + /** diff --git a/srcpkgs/eiskaltdcpp-qt/patches/musl.patch b/srcpkgs/eiskaltdcpp-qt/patches/musl.patch new file mode 100644 index 00000000000..b26b453b382 --- /dev/null +++ b/srcpkgs/eiskaltdcpp-qt/patches/musl.patch @@ -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 + #include +-#if !defined (__HAIKU__) ++#if !defined (__HAIKU__) && defined (__GLIBC__) + #include + + #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 + diff --git a/srcpkgs/eiskaltdcpp-qt/patches/upnpc.cpp.patch b/srcpkgs/eiskaltdcpp-qt/patches/upnpc.cpp.patch new file mode 100644 index 00000000000..fa4cd62247a --- /dev/null +++ b/srcpkgs/eiskaltdcpp-qt/patches/upnpc.cpp.patch @@ -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; diff --git a/srcpkgs/eiskaltdcpp-qt/template b/srcpkgs/eiskaltdcpp-qt/template new file mode 100644 index 00000000000..475b6df1f9d --- /dev/null +++ b/srcpkgs/eiskaltdcpp-qt/template @@ -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 " +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