Gentoo Archives: gentoo-commits

From: David Seifert <soap@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-p2p/airdcpp-webclient/, net-p2p/airdcpp-webclient/files/
Date: Thu, 26 Jan 2017 22:40:46
Message-Id: 1485470339.32d49f7d930a0112b5281ebb75e4fdb5c2cd9275.soap@gentoo
1 commit: 32d49f7d930a0112b5281ebb75e4fdb5c2cd9275
2 Author: Louis Sautier <sautier.louis <AT> gmail <DOT> com>
3 AuthorDate: Wed Jan 25 20:38:05 2017 +0000
4 Commit: David Seifert <soap <AT> gentoo <DOT> org>
5 CommitDate: Thu Jan 26 22:38:59 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=32d49f7d
7
8 net-p2p/airdcpp-webclient: fix an issue with zlib >= 1.2.10
9
10 Package-Manager: Portage-2.3.3, Repoman-2.3.1
11 Closes: https://github.com/gentoo/gentoo/pull/3651
12
13 .../airdcpp-webclient-1.4.1-r1.ebuild | 70 ++++++++++++++++++++++
14 .../airdcpp-webclient-1.4.1-fix-zlib-errors.patch | 23 +++++++
15 2 files changed, 93 insertions(+)
16
17 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
18 new file mode 100644
19 index 00000000..8d68bde
20 --- /dev/null
21 +++ b/net-p2p/airdcpp-webclient/airdcpp-webclient-1.4.1-r1.ebuild
22 @@ -0,0 +1,70 @@
23 +# Copyright 1999-2017 Gentoo Foundation
24 +# Distributed under the terms of the GNU General Public License v2
25 +# $Id$
26 +
27 +EAPI=6
28 +PYTHON_COMPAT=( python{2_7,3_4,3_5} pypy{,3} )
29 +
30 +inherit cmake-utils user python-any-r1
31 +
32 +DESCRIPTION="Cross-platform Direct Connect client"
33 +HOMEPAGE="https://airdcpp-web.github.io/"
34 +SRC_URI="https://github.com/airdcpp-web/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
35 +
36 +KEYWORDS="~amd64 ~x86"
37 +LICENSE="GPL-2+"
38 +SLOT="0"
39 +IUSE="nat-pmp +tbb +webui"
40 +
41 +RDEPEND="
42 + app-arch/bzip2
43 + dev-cpp/websocketpp
44 + dev-libs/boost:=
45 + dev-libs/geoip
46 + dev-libs/leveldb
47 + dev-libs/openssl:0=[-bindist]
48 + net-libs/miniupnpc:=
49 + sys-libs/zlib
50 + virtual/libiconv
51 + nat-pmp? ( net-libs/libnatpmp )
52 + tbb? ( dev-cpp/tbb )
53 +"
54 +DEPEND="
55 + virtual/pkgconfig
56 + ${PYTHON_DEPS}
57 + ${RDEPEND}
58 +"
59 +PDEPEND="webui? ( www-apps/airdcpp-webui )"
60 +
61 +# Fix errors with zlib >= 1.2.10
62 +# https://bugs.launchpad.net/dcplusplus/+bug/1656050
63 +# https://github.com/airdcpp/airdcpp-core/commit/5b48aa785a2d6248971423fd5b7e07af32a6c289
64 +# https://github.com/airdcpp/airdcpp-core/commit/e80e3d2f6492b5c4f56489338bc2825583526831
65 +PATCHES=( "${FILESDIR}/${P}-fix-zlib-errors.patch" )
66 +
67 +pkg_setup() {
68 + python-any-r1_pkg_setup
69 + enewgroup airdcppd
70 + enewuser airdcppd -1 -1 /var/lib/airdcppd airdcppd
71 +}
72 +
73 +src_configure() {
74 + local mycmakeargs=(
75 + -DINSTALL_WEB_UI=OFF
76 + )
77 + cmake-utils_src_configure
78 +}
79 +
80 +src_install() {
81 + newconfd "${FILESDIR}/airdcppd.confd" airdcppd
82 + newinitd "${FILESDIR}/airdcppd.initd" airdcppd
83 + keepdir /var/lib/airdcppd
84 + fowners airdcppd:airdcppd /var/lib/airdcppd
85 + cmake-utils_src_install
86 +}
87 +
88 +pkg_postinst() {
89 + if [[ -z "${REPLACING_VERSIONS}" ]]; then
90 + elog "Run 'airdcppd --configure' to set up ports and authentication"
91 + fi
92 +}
93
94 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
95 new file mode 100644
96 index 00000000..ad5a379
97 --- /dev/null
98 +++ b/net-p2p/airdcpp-webclient/files/airdcpp-webclient-1.4.1-fix-zlib-errors.patch
99 @@ -0,0 +1,23 @@
100 +diff --git a/airdcpp-core/airdcpp/ZUtils.cpp b/airdcpp-core/airdcpp/ZUtils.cpp
101 +index 73217f71..8dbbf293 100644
102 +--- a/airdcpp-core/airdcpp/ZUtils.cpp
103 ++++ b/airdcpp-core/airdcpp/ZUtils.cpp
104 +@@ -33,7 +33,7 @@ const double ZFilter::MIN_COMPRESSION_LEVEL = 0.9;
105 + ZFilter::ZFilter() : totalIn(0), totalOut(0), compressing(true) {
106 + memset(&zs, 0, sizeof(zs));
107 +
108 +- if(deflateInit(&zs, 3) != Z_OK) {
109 ++ if(deflateInit(&zs, SETTING(MAX_COMPRESSION)) != Z_OK) {
110 + throw Exception(STRING(COMPRESSION_ERROR));
111 + }
112 + }
113 +@@ -54,7 +54,8 @@ bool ZFilter::operator()(const void* in, size_t& insize, void* out, size_t& outs
114 + if(compressing && insize > 0 && outsize > 16 && (totalIn > (64*1024)) && ((static_cast<double>(totalOut) / totalIn) > 0.95)) {
115 + zs.avail_in = 0;
116 + zs.avail_out = outsize;
117 +- if(deflateParams(&zs, 0, Z_DEFAULT_STRATEGY) != Z_OK) {
118 ++ auto err = ::deflateParams(&zs, 0, Z_DEFAULT_STRATEGY);
119 ++ if (err == Z_STREAM_ERROR) {
120 + throw Exception(STRING(COMPRESSION_ERROR));
121 + }
122 + zs.avail_in = insize;