From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id E79E31396D0 for ; Fri, 22 Sep 2017 21:53:29 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id E7EF82043F1; Fri, 22 Sep 2017 21:53:28 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id AF4BB2043F1 for ; Fri, 22 Sep 2017 21:53:28 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 70620341646 for ; Fri, 22 Sep 2017 21:53:27 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id E4C788F9D for ; Fri, 22 Sep 2017 21:53:25 +0000 (UTC) From: "Thomas Deutschmann" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Thomas Deutschmann" Message-ID: <1506117199.f4965144f442ee530185ad7106c30079ac3cacb5.whissi@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: sys-libs/zlib/files/, sys-libs/zlib/ X-VCS-Repository: repo/gentoo X-VCS-Files: sys-libs/zlib/files/zlib-1.2.11-fix-deflateParams-usage.patch sys-libs/zlib/zlib-1.2.11-r1.ebuild X-VCS-Directories: sys-libs/zlib/files/ sys-libs/zlib/ X-VCS-Committer: whissi X-VCS-Committer-Name: Thomas Deutschmann X-VCS-Revision: f4965144f442ee530185ad7106c30079ac3cacb5 X-VCS-Branch: master Date: Fri, 22 Sep 2017 21:53:25 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 7f336391-28d8-46a7-a7bb-fed229ff8865 X-Archives-Hash: 85553a26ea02d5d92813d4fd1ce12619 commit: f4965144f442ee530185ad7106c30079ac3cacb5 Author: Thomas Deutschmann gentoo org> AuthorDate: Fri Sep 22 21:53:04 2017 +0000 Commit: Thomas Deutschmann gentoo org> CommitDate: Fri Sep 22 21:53:19 2017 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f4965144 sys-libs/zlib: Fix deflateParams() usage (bug #631550) Package-Manager: Portage-2.3.8, Repoman-2.3.3 .../zlib-1.2.11-fix-deflateParams-usage.patch | 67 +++++++++++ sys-libs/zlib/zlib-1.2.11-r1.ebuild | 126 +++++++++++++++++++++ 2 files changed, 193 insertions(+) diff --git a/sys-libs/zlib/files/zlib-1.2.11-fix-deflateParams-usage.patch b/sys-libs/zlib/files/zlib-1.2.11-fix-deflateParams-usage.patch new file mode 100644 index 00000000000..18764849b94 --- /dev/null +++ b/sys-libs/zlib/files/zlib-1.2.11-fix-deflateParams-usage.patch @@ -0,0 +1,67 @@ +From f9694097dd69354b03cb8af959094c7f260db0a1 Mon Sep 17 00:00:00 2001 +From: Mark Adler +Date: Mon, 16 Jan 2017 09:49:35 -0800 +Subject: [PATCH] Permit a deflateParams() parameter change as soon as + possible. + +This commit allows a parameter change even if the input data has +not all been compressed and copied to the application output +buffer, so long as all of the input data has been compressed to +the internal pending output buffer. This also allows an immediate +deflateParams change so long as there have been no deflate calls +since initialization or reset. +--- + deflate.c | 6 +++--- + zlib.h | 11 ++++++----- + 2 files changed, 9 insertions(+), 8 deletions(-) + +diff --git a/deflate.c b/deflate.c +index b63311a5..20bda4f6 100644 +--- a/deflate.c ++++ b/deflate.c +@@ -494,7 +494,7 @@ int ZEXPORT deflateResetKeep (strm) + s->wrap == 2 ? crc32(0L, Z_NULL, 0) : + #endif + adler32(0L, Z_NULL, 0); +- s->last_flush = Z_NO_FLUSH; ++ s->last_flush = -2; + + _tr_init(s); + +@@ -587,12 +587,12 @@ int ZEXPORT deflateParams(strm, level, strategy) + func = configuration_table[s->level].func; + + if ((strategy != s->strategy || func != configuration_table[level].func) && +- s->high_water) { ++ s->last_flush != -2) { + /* Flush the last buffer: */ + int err = deflate(strm, Z_BLOCK); + if (err == Z_STREAM_ERROR) + return err; +- if (strm->avail_out == 0) ++ if (strm->avail_in || (s->strstart - s->block_start) + s->lookahead) + return Z_BUF_ERROR; + } + if (s->level != level) { +diff --git a/zlib.h b/zlib.h +index 5daf4f28..577d81e3 100644 +--- a/zlib.h ++++ b/zlib.h +@@ -712,11 +712,12 @@ ZEXTERN int ZEXPORT deflateParams OF((z_streamp strm, + used to switch between compression and straight copy of the input data, or + to switch to a different kind of input data requiring a different strategy. + If the compression approach (which is a function of the level) or the +- strategy is changed, and if any input has been consumed in a previous +- deflate() call, then the input available so far is compressed with the old +- level and strategy using deflate(strm, Z_BLOCK). There are three approaches +- for the compression levels 0, 1..3, and 4..9 respectively. The new level +- and strategy will take effect at the next call of deflate(). ++ strategy is changed, and if there have been any deflate() calls since the ++ state was initialized or reset, then the input available so far is ++ compressed with the old level and strategy using deflate(strm, Z_BLOCK). ++ There are three approaches for the compression levels 0, 1..3, and 4..9 ++ respectively. The new level and strategy will take effect at the next call ++ of deflate(). + + If a deflate(strm, Z_BLOCK) is performed by deflateParams(), and it does + not have enough output space to complete, then the parameter change will not diff --git a/sys-libs/zlib/zlib-1.2.11-r1.ebuild b/sys-libs/zlib/zlib-1.2.11-r1.ebuild new file mode 100644 index 00000000000..c2edb5daec9 --- /dev/null +++ b/sys-libs/zlib/zlib-1.2.11-r1.ebuild @@ -0,0 +1,126 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=5 +AUTOTOOLS_AUTO_DEPEND="no" + +inherit autotools toolchain-funcs multilib multilib-minimal + +DESCRIPTION="Standard (de)compression library" +HOMEPAGE="https://zlib.net/" +SRC_URI="https://zlib.net/${P}.tar.gz + http://www.gzip.org/zlib/${P}.tar.gz + http://www.zlib.net/current/beta/${P}.tar.gz" + +LICENSE="ZLIB" +SLOT="0/1" # subslot = SONAME +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd" +IUSE="minizip static-libs" + +DEPEND="minizip? ( ${AUTOTOOLS_DEPEND} )" +RDEPEND="abi_x86_32? ( + !<=app-emulation/emul-linux-x86-baselibs-20130224 + !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)] + ) + ! zlib.pc || die + ;; + *) + emake + ;; + esac + use minizip && emake -C contrib/minizip +} + +sed_macros() { + # clean up namespace a little #383179 + # we do it here so we only have to tweak 2 files + sed -i -r 's:\<(O[FN])\>:_Z_\1:g' "$@" || die +} + +multilib_src_install() { + case ${CHOST} in + *-mingw*|mingw*) + emake -f win32/Makefile.gcc install \ + BINARY_PATH="${ED}/usr/bin" \ + LIBRARY_PATH="${ED}/usr/$(get_libdir)" \ + INCLUDE_PATH="${ED}/usr/include" \ + SHARED_MODE=1 + # overwrites zlib.pc created from win32/Makefile.gcc #620136 + insinto /usr/$(get_libdir)/pkgconfig + doins zlib.pc + ;; + + *) + emake install DESTDIR="${D}" LDCONFIG=: + gen_usr_ldscript -a z + ;; + esac + sed_macros "${ED}"/usr/include/*.h + + if use minizip ; then + emake -C contrib/minizip install DESTDIR="${D}" + sed_macros "${ED}"/usr/include/minizip/*.h + fi + + use static-libs || rm -f "${ED}"/usr/$(get_libdir)/lib{z,minizip}.{a,la} #419645 +} + +multilib_src_install_all() { + dodoc FAQ README ChangeLog doc/*.txt + use minizip && dodoc contrib/minizip/*.txt +}