commit:     32d49f7d930a0112b5281ebb75e4fdb5c2cd9275
Author:     Louis Sautier <sautier.louis <AT> gmail <DOT> com>
AuthorDate: Wed Jan 25 20:38:05 2017 +0000
Commit:     David Seifert <soap <AT> gentoo <DOT> org>
CommitDate: Thu Jan 26 22:38:59 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=32d49f7d

net-p2p/airdcpp-webclient: fix an issue with zlib >= 1.2.10

Package-Manager: Portage-2.3.3, Repoman-2.3.1
Closes: https://github.com/gentoo/gentoo/pull/3651

 .../airdcpp-webclient-1.4.1-r1.ebuild              | 70 ++++++++++++++++++++++
 .../airdcpp-webclient-1.4.1-fix-zlib-errors.patch  | 23 +++++++
 2 files changed, 93 insertions(+)

diff --git a/net-p2p/airdcpp-webclient/airdcpp-webclient-1.4.1-r1.ebuild 
b/net-p2p/airdcpp-webclient/airdcpp-webclient-1.4.1-r1.ebuild
new file mode 100644
index 00000000..8d68bde
--- /dev/null
+++ b/net-p2p/airdcpp-webclient/airdcpp-webclient-1.4.1-r1.ebuild
@@ -0,0 +1,70 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=6
+PYTHON_COMPAT=( python{2_7,3_4,3_5} pypy{,3} )
+
+inherit cmake-utils user python-any-r1
+
+DESCRIPTION="Cross-platform Direct Connect client"
+HOMEPAGE="https://airdcpp-web.github.io/";
+SRC_URI="https://github.com/airdcpp-web/${PN}/archive/${PV}.tar.gz -> 
${P}.tar.gz"
+
+KEYWORDS="~amd64 ~x86"
+LICENSE="GPL-2+"
+SLOT="0"
+IUSE="nat-pmp +tbb +webui"
+
+RDEPEND="
+       app-arch/bzip2
+       dev-cpp/websocketpp
+       dev-libs/boost:=
+       dev-libs/geoip
+       dev-libs/leveldb
+       dev-libs/openssl:0=[-bindist]
+       net-libs/miniupnpc:=
+       sys-libs/zlib
+       virtual/libiconv
+       nat-pmp? ( net-libs/libnatpmp )
+       tbb? ( dev-cpp/tbb )
+"
+DEPEND="
+       virtual/pkgconfig
+       ${PYTHON_DEPS}
+       ${RDEPEND}
+"
+PDEPEND="webui? ( www-apps/airdcpp-webui )"
+
+# Fix errors with zlib >= 1.2.10
+# https://bugs.launchpad.net/dcplusplus/+bug/1656050
+# 
https://github.com/airdcpp/airdcpp-core/commit/5b48aa785a2d6248971423fd5b7e07af32a6c289
+# 
https://github.com/airdcpp/airdcpp-core/commit/e80e3d2f6492b5c4f56489338bc2825583526831
+PATCHES=( "${FILESDIR}/${P}-fix-zlib-errors.patch" )
+
+pkg_setup() {
+       python-any-r1_pkg_setup
+       enewgroup airdcppd
+       enewuser airdcppd -1 -1 /var/lib/airdcppd airdcppd
+}
+
+src_configure() {
+       local mycmakeargs=(
+               -DINSTALL_WEB_UI=OFF
+       )
+       cmake-utils_src_configure
+}
+
+src_install() {
+       newconfd "${FILESDIR}/airdcppd.confd" airdcppd
+       newinitd "${FILESDIR}/airdcppd.initd" airdcppd
+       keepdir /var/lib/airdcppd
+       fowners airdcppd:airdcppd /var/lib/airdcppd
+       cmake-utils_src_install
+}
+
+pkg_postinst() {
+       if [[ -z "${REPLACING_VERSIONS}" ]]; then
+               elog "Run 'airdcppd --configure' to set up ports and 
authentication"
+       fi
+}

diff --git 
a/net-p2p/airdcpp-webclient/files/airdcpp-webclient-1.4.1-fix-zlib-errors.patch 
b/net-p2p/airdcpp-webclient/files/airdcpp-webclient-1.4.1-fix-zlib-errors.patch
new file mode 100644
index 00000000..ad5a379
--- /dev/null
+++ 
b/net-p2p/airdcpp-webclient/files/airdcpp-webclient-1.4.1-fix-zlib-errors.patch
@@ -0,0 +1,23 @@
+diff --git a/airdcpp-core/airdcpp/ZUtils.cpp b/airdcpp-core/airdcpp/ZUtils.cpp
+index 73217f71..8dbbf293 100644
+--- a/airdcpp-core/airdcpp/ZUtils.cpp
++++ b/airdcpp-core/airdcpp/ZUtils.cpp
+@@ -33,7 +33,7 @@ const double ZFilter::MIN_COMPRESSION_LEVEL = 0.9;
+ ZFilter::ZFilter() : totalIn(0), totalOut(0), compressing(true) {
+       memset(&zs, 0, sizeof(zs));
+ 
+-      if(deflateInit(&zs, 3) != Z_OK) {
++      if(deflateInit(&zs, SETTING(MAX_COMPRESSION)) != Z_OK) {
+               throw Exception(STRING(COMPRESSION_ERROR));
+       }
+ }
+@@ -54,7 +54,8 @@ bool ZFilter::operator()(const void* in, size_t& insize, 
void* out, size_t& outs
+       if(compressing && insize > 0 && outsize > 16 && (totalIn > (64*1024)) 
&& ((static_cast<double>(totalOut) / totalIn) > 0.95)) {
+               zs.avail_in = 0;
+               zs.avail_out = outsize;
+-              if(deflateParams(&zs, 0, Z_DEFAULT_STRATEGY) != Z_OK) {
++              auto err = ::deflateParams(&zs, 0, Z_DEFAULT_STRATEGY);
++              if (err == Z_STREAM_ERROR) {
+                       throw Exception(STRING(COMPRESSION_ERROR));
+               }
+               zs.avail_in = insize;

Reply via email to