summaryrefslogtreecommitdiff
path: root/sys-libs/zlib
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2022-04-06 22:33:41 +0100
committerV3n3RiX <venerix@koprulu.sector>2022-04-06 22:33:41 +0100
commite68d405c5d712af4387159df07e226217bdda049 (patch)
tree009ab0f3d427f0813e62930d71802cb054c07e30 /sys-libs/zlib
parent401101f9c8077911929d3f2b60a37098460a5d89 (diff)
gentoo resync : 06.04.2022
Diffstat (limited to 'sys-libs/zlib')
-rw-r--r--sys-libs/zlib/Manifest13
-rw-r--r--sys-libs/zlib/files/zlib-1.2.11-fix-deflateParams-usage.patch2
-rw-r--r--sys-libs/zlib/files/zlib-1.2.12-CRC-buggy-input.patch50
-rw-r--r--sys-libs/zlib/files/zlib-1.2.12-fix-CC-logic-in-configure.patch45
-rw-r--r--sys-libs/zlib/files/zlib-1.2.12-use-LDFLAGS-in-configure.patch71
-rw-r--r--sys-libs/zlib/zlib-1.2.11-r4.ebuild3
-rw-r--r--sys-libs/zlib/zlib-1.2.11-r5.ebuild1
-rw-r--r--sys-libs/zlib/zlib-1.2.12-r1.ebuild188
-rw-r--r--sys-libs/zlib/zlib-1.2.12-r2.ebuild196
9 files changed, 565 insertions, 4 deletions
diff --git a/sys-libs/zlib/Manifest b/sys-libs/zlib/Manifest
index b8a5bc0a5939..1046c0aac3e8 100644
--- a/sys-libs/zlib/Manifest
+++ b/sys-libs/zlib/Manifest
@@ -1,9 +1,16 @@
AUX zlib-1.2.11-configure-fix-AR-RANLIB-NM-detection.patch 3209 BLAKE2B 26e9fd2d68534c6b2d5d88c5dc8150d63dede949ab71d454d94c13736c3f02c8e01201d39ccaa7fe189db0a272a315aa01a6a214f0cc7e25030b2c96b5fbe0ce SHA512 e5db2181e21d6fe7ef4d36b99fd80f4df576dabb7cbf3d205b30abd6760fdc33efaa3668fd927efe2c27a019c419b769b721760d9eb2f10d5d6955adf7a751bf
-AUX zlib-1.2.11-fix-deflateParams-usage.patch 2937 BLAKE2B 42fcb91b99b004921dce12b4e71c12c62e80d50243a1cec97522dbaa1cf5fb09cf701e9f988bddd0470c3dafe743d42e60b9ac6903afb2185859d62b1fdf78bc SHA512 9b949d894be2bbb60d687820e79d7a02e733e8426e6602482f3a3902fca3571bbfba38ddd84a88f5a093fdb25ac90e4076905d19b86ab70ebce6e250fd118286
+AUX zlib-1.2.11-fix-deflateParams-usage.patch 3017 BLAKE2B 2bb882ea0a7052d4fd10e999451f5358dd180d46098cc67289b370a7ef97a7f6b5c88eb375f6e7476ad96a18b1db34e6e545e7817327766d682d70e946ba0194 SHA512 ad962af0c723ce9dfd76e3f7b0a11f2972a7d7f997514e919010dc43c7d6538c30ed9216498c96b026f503c32a73502690426214f45d73107d377880557f6393
AUX zlib-1.2.11-minizip-drop-crypt-header.patch 997 BLAKE2B a964dfb26d05045507cb2ebf1154b890782d9952288627dd5093eeeaed9265a6041922e9fef378333ad3b9ac2333d692b06db1d6425df25d6062b9fc42ec8c50 SHA512 158c4b711e8afc248cbd55f2057dede18540ad35ec1a47d0cfb0fe9bf10b1507bb1b4525badcc0a8b6505062d838ee4fb2d4ebfbf9c9d1694336a704bc0b690e
+AUX zlib-1.2.12-CRC-buggy-input.patch 1673 BLAKE2B a45b5c36dc4519f785b29981eaa47de7763fe8a1e65593ad9fd18f4d217e0c9108089ff1b12284728193f76a5cd0cdf3e1e98311cf59302f12eca3143ca3b82e SHA512 a5c5915024c5faca090312500b56c4876bc5b1d7c56253c8b5c192ae499f04cce301dc77d69b2674086366842726552f3a25c3962d26f53e9b5942ce5fb26054
+AUX zlib-1.2.12-fix-CC-logic-in-configure.patch 1427 BLAKE2B 7e76e07dc8aef1ee0f38a237a4a37f8c8fa22e1dffe70407781320a325634bc92a0485de7e0de492354672e008f3a689c16087b87c15b1c893f120f5916f906f SHA512 8cdc6fa6754d5d752ae6e59b491cf6f652feb2ea4839d8debf778bbffb0c5dcd1f952a1e7cdb2e01d6e96fe67197db1ad7908c4d9d4f654932cf3deb97cddb16
+AUX zlib-1.2.12-use-LDFLAGS-in-configure.patch 2593 BLAKE2B da920b443437d2f912a3c49c2db7478b19268418f94dd70c083ff44640c71b752f84763392300fc3e843a4025910375c058a0648bef65c5ca0db419297d32be8 SHA512 d884348c96da593e3abc7f14f3eea19369c9105c9814e38012e68c53c01a51e260439d18bc7a2bb121965ad1636c774f6cb701c062eba5e79eca4f199005b859
DIST zlib-1.2.11-cygwin-gzopen_w.patch 1170 BLAKE2B fe351436716634bd823da8c2811d332327d335d450d89bee85d7713b09dd454fe6aee264b044a41bf3be603aa36d67943ba6c7d8b46470e180e9b639728b5274 SHA512 14cc63a17fbf6afb6c8a8dd0b92df9807b48e0faf09c88f952083f10716ae62be8de2a0e1424b77fb538605b88898b381160521f2872afdda59e12bd27535c5a
DIST zlib-1.2.11.tar.gz 607698 BLAKE2B 6bfc4bca5dcadba8a0d4121a2b3ed0bfe440c261003521862c8e6381f1a6f0a72d3fc037351d30afd7ef321e8e8d2ec817c046ac749f2ca0c97fbdc2f7e840b7 SHA512 73fd3fff4adeccd4894084c15ddac89890cd10ef105dd5e1835e1e9bbb6a49ff229713bd197d203edfa17c2727700fce65a2a235f07568212d820dca88b528ae
+DIST zlib-1.2.12.tar.gz 1490071 BLAKE2B 76e7b26f8dc761b0eae6276cc32bc36fa74a88197699c95d158c1548f97b80db5e39d21144ecd6ee3eb90c42730aa5f387f9952d9a3f0930b56e9dfcd12f1e67 SHA512 cc2366fa45d5dfee1f983c8c51515e0cff959b61471e2e8d24350dea22d3f6fcc50723615a911b046ffc95f51ba337d39ae402131a55e6d1541d3b095d6c0a14
+DIST zlib-1.2.12.tar.gz.asc 235 BLAKE2B bb1efc89b10b894ebc8e8008ee3e98104348f197fae54d298d62057a2d8b8d7246de937962b531189f80ad64a803112300a73862cba121cbf6a6d5ac5f9bc40c SHA512 5c1144371a83b83f9f1d008aa9297e23c0db992cab6c4a8966f9320e70c6186867d62753511d6a663b0fe181cd37fe256c53586358a42ea348ccc0747b1a7153
DIST zlib-1.2.7-cygwin-minizip.patch 2626 BLAKE2B 885f1fda877c0b783618b163702fb46126b7db572767cd4edb86bd92db1f432c887ef1724e70c8319c26886368dba3a962af5284ec0875c20ec8ad2245fd100a SHA512 e372f1e06311e843eca2092e182c41abb009b5e9880b60292d708e4bc0de5a9e4c43d49b25b0c09df4784bc46a1254472bc5cdbdd8d6c762a9f6a145a555bfe7
-EBUILD zlib-1.2.11-r4.ebuild 4376 BLAKE2B 80381188e72cf38e6207c661d021caa3bc99f03fc93d5fedccaf208f9f265f6d1299991864c54b03ebcda215c8cb8a09b8f280119d1f30de62b72d525a629ae9 SHA512 3a5dc0b7742c63a83e5b5d4251eaf6c38bdfe740a32633066897f6eaad843c26aecafadd84ef4390d963cea60fb9e0fa3ebf35d4a0fbeba3f967ea0584414f1e
-EBUILD zlib-1.2.11-r5.ebuild 4463 BLAKE2B 91acff69f138dc553dfea727b5dd0277aab3a5c46607b5b8286e0eb5d875e4b93c8876dc33ef986f9f6139ff1906c48bed9a7cba24a66e3cd4f357499043eade SHA512 b45406144b34e87b204313f4c6ef2db92cf9daa4cff459fe8df128b5524e2f41e7274464508756a699e1b76663dd7ed6970fd0e64112ad27c3680e32c5918750
+EBUILD zlib-1.2.11-r4.ebuild 4414 BLAKE2B 28fff60b4ea6e23298dd32bd782c7a174c0c8fac1395f010b3e93769c3de32e7b26cb2a1fdd631c5dafb86d5a2f4f1e87a1833032d2043b629515254eeaccc5f SHA512 eef5a1d3f41a60a672a8432d6ca514d712dbd227c4e74c461193e35482bb47953a905e513f8a67571621e3f68bf12cc201c3a28a6a418f5c8e2b9f3debdc6acb
+EBUILD zlib-1.2.11-r5.ebuild 4501 BLAKE2B a1162467779ba8a5d0d3f23c95fd7afeddd427ab1c351472bcc6d0f40efab1ff989682f3963f3428fe28ca77f20cb5f19520c85a43025211dfd8de5a2917cf9f SHA512 7dd887d89dd54f6833d31e7de5095c36e9d312a2fed601b077119ee37da5ac53b69ae56755eaed578bb44f2026a34dfcf125d107e7dee311b842bdad0b9992ca
+EBUILD zlib-1.2.12-r1.ebuild 4713 BLAKE2B e83aae3a8cb7740767f9aeb5f9a3674be993b3221e1b7c378bf9a31117c065de9a87714caccbd685de4e05bd7c6b2ada0c56128f9d65db0c79d6444a089c6a1c SHA512 796fd9ac95620f09143f78a8f9718efda188020a2c077283cc9885b332578d93f800b39318918525f11ecaad128a69e7f0145f77ba238308361acce24d5b6a50
+EBUILD zlib-1.2.12-r2.ebuild 5152 BLAKE2B 40fdb3b4136568c9452f67a04e4571478d962d34b03ca84c912bc5dddee5d8e59570fa3ee21bb940a0045791c315692c29691af082cac83f9f448f68e31220b1 SHA512 0a8750556f9d96d5eafd79be8062c53a73706cd9bdebf1c9ff09cda22f4e2c47714f7f535c29307c286480d25f9eb99ef6b69a044d7f9b5a4c12a2babaddb608
MISC metadata.xml 494 BLAKE2B a4a57a4153aefc189e407bcb8ce84f7c94581cc66967f69097087da7e6ff48d2de683b919fb00445d095c47ef39d31e01590f8c989ce0e5e01474e73ee2a0565 SHA512 a7e0160c127b3c2a6afe99e95992d9dbd017061303759c299ec38800efd6a9e11a35ae850c23c77c09c8833cd9d61ac1267f6becadf9c22437ee35e4304400c9
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
index 18764849b945..59d4a0919c77 100644
--- 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
@@ -1,3 +1,5 @@
+https://github.com/madler/zlib/commit/f9694097dd69354b03cb8af959094c7f260db0a1
+
From f9694097dd69354b03cb8af959094c7f260db0a1 Mon Sep 17 00:00:00 2001
From: Mark Adler <madler@alumni.caltech.edu>
Date: Mon, 16 Jan 2017 09:49:35 -0800
diff --git a/sys-libs/zlib/files/zlib-1.2.12-CRC-buggy-input.patch b/sys-libs/zlib/files/zlib-1.2.12-CRC-buggy-input.patch
new file mode 100644
index 000000000000..083634929bbe
--- /dev/null
+++ b/sys-libs/zlib/files/zlib-1.2.12-CRC-buggy-input.patch
@@ -0,0 +1,50 @@
+https://github.com/madler/zlib/commit/ec3df00224d4b396e2ac6586ab5d25f673caa4c2
+https://github.com/madler/zlib/issues/613
+https://bugs.gentoo.org/836370
+
+From ec3df00224d4b396e2ac6586ab5d25f673caa4c2 Mon Sep 17 00:00:00 2001
+From: Mark Adler <madler@alumni.caltech.edu>
+Date: Wed, 30 Mar 2022 11:14:53 -0700
+Subject: [PATCH] Correct incorrect inputs provided to the CRC functions.
+
+The previous releases of zlib were not sensitive to incorrect CRC
+inputs with bits set above the low 32. This commit restores that
+behavior, so that applications with such bugs will continue to
+operate as before.
+--- a/crc32.c
++++ b/crc32.c
+@@ -630,7 +630,7 @@ unsigned long ZEXPORT crc32_z(crc, buf, len)
+ #endif /* DYNAMIC_CRC_TABLE */
+
+ /* Pre-condition the CRC */
+- crc ^= 0xffffffff;
++ crc = (~crc) & 0xffffffff;
+
+ /* Compute the CRC up to a word boundary. */
+ while (len && ((z_size_t)buf & 7) != 0) {
+@@ -749,7 +749,7 @@ unsigned long ZEXPORT crc32_z(crc, buf, len)
+ #endif /* DYNAMIC_CRC_TABLE */
+
+ /* Pre-condition the CRC */
+- crc ^= 0xffffffff;
++ crc = (~crc) & 0xffffffff;
+
+ #ifdef W
+
+@@ -1077,7 +1077,7 @@ uLong ZEXPORT crc32_combine64(crc1, crc2, len2)
+ #ifdef DYNAMIC_CRC_TABLE
+ once(&made, make_crc_table);
+ #endif /* DYNAMIC_CRC_TABLE */
+- return multmodp(x2nmodp(len2, 3), crc1) ^ crc2;
++ return multmodp(x2nmodp(len2, 3), crc1) ^ (crc2 & 0xffffffff);
+ }
+
+ /* ========================================================================= */
+@@ -1112,5 +1112,5 @@ uLong crc32_combine_op(crc1, crc2, op)
+ uLong crc2;
+ uLong op;
+ {
+- return multmodp(op, crc1) ^ crc2;
++ return multmodp(op, crc1) ^ (crc2 & 0xffffffff);
+ }
+
diff --git a/sys-libs/zlib/files/zlib-1.2.12-fix-CC-logic-in-configure.patch b/sys-libs/zlib/files/zlib-1.2.12-fix-CC-logic-in-configure.patch
new file mode 100644
index 000000000000..7fb13325b114
--- /dev/null
+++ b/sys-libs/zlib/files/zlib-1.2.12-fix-CC-logic-in-configure.patch
@@ -0,0 +1,45 @@
+https://github.com/madler/zlib/pull/607
+
+From 80d086357a55b94a13e43756cf3e131f25eef0e4 Mon Sep 17 00:00:00 2001
+From: Sam James <sam@gentoo.org>
+Date: Mon, 28 Mar 2022 08:40:45 +0100
+Subject: [PATCH] Fix CC logic in configure
+
+In https://github.com/madler/zlib/commit/e9a52aa129efe3834383e415580716a7c4027f8d,
+the logic was changed to try check harder for GCC, but it dropped
+the default setting of cc=${CC}. It was throwing away any pre-set CC value as
+a result.
+
+The rest of the script then cascades down a bad path because it's convinced
+it's not GCC or a GCC-like compiler.
+
+This led to e.g. misdetection of inability to build shared libs
+for say, multilib cases (w/ CC being one thing from the environment being used
+for one test (e.g. x86_64-unknown-linux-gnu-gcc -m32 and then 'cc' used for
+shared libs (but missing "-m32"!)). Obviously just one example of how
+the old logic could break.
+
+This restores the old default of 'CC' if nothing overrides it later
+in configure.
+
+Bug: https://bugs.gentoo.org/836308
+Signed-off-by: Sam James <sam@gentoo.org>
+---
+ configure | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/configure b/configure
+index 52ff4a04e..3fa3e8618 100755
+--- a/configure
++++ b/configure
+@@ -174,7 +174,10 @@ if test -z "$CC"; then
+ else
+ cc=${CROSS_PREFIX}cc
+ fi
++else
++ cc=${CC}
+ fi
++
+ cflags=${CFLAGS-"-O3"}
+ # to force the asm version use: CFLAGS="-O3 -DASMV" ./configure
+ case "$cc" in
diff --git a/sys-libs/zlib/files/zlib-1.2.12-use-LDFLAGS-in-configure.patch b/sys-libs/zlib/files/zlib-1.2.12-use-LDFLAGS-in-configure.patch
new file mode 100644
index 000000000000..752a473eac22
--- /dev/null
+++ b/sys-libs/zlib/files/zlib-1.2.12-use-LDFLAGS-in-configure.patch
@@ -0,0 +1,71 @@
+https://github.com/madler/zlib/pull/599
+
+From 37c9730ba474d274f4cc6a974943eef95087b9f6 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 8 Mar 2022 22:38:47 -0800
+Subject: [PATCH] configure: Pass LDFLAGS to link tests
+
+LDFLAGS can contain critical flags without which linking wont succeed
+therefore ensure that all configure tests involving link time checks are
+using LDFLAGS on compiler commandline along with CFLAGS to ensure the
+tests perform correctly. Without this some tests may fail resulting in
+wrong confgure result, ending in miscompiling the package
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+--- a/configure
++++ b/configure
+@@ -410,7 +410,7 @@ if test $shared -eq 1; then
+ echo Checking for shared library support... | tee -a configure.log
+ # we must test in two steps (cc then ld), required at least on SunOS 4.x
+ if try $CC -w -c $SFLAGS $test.c &&
+- try $LDSHARED $SFLAGS -o $test$shared_ext $test.o; then
++ try $LDSHARED $SFLAGS $LDFLAGS -o $test$shared_ext $test.o; then
+ echo Building shared library $SHAREDLIBV with $CC. | tee -a configure.log
+ elif test -z "$old_cc" -a -z "$old_cflags"; then
+ echo No shared library support. | tee -a configure.log
+@@ -492,7 +492,7 @@ int main(void) {
+ }
+ EOF
+ fi
+- if try $CC $CFLAGS -o $test $test.c; then
++ if try $CC $CFLAGS $LDFLAGS -o $test $test.c; then
+ sizet=`./$test`
+ echo "Checking for a pointer-size integer type..." $sizet"." | tee -a configure.log
+ else
+@@ -530,7 +530,7 @@ int main(void) {
+ return 0;
+ }
+ EOF
+- if try $CC $CFLAGS -o $test $test.c; then
++ if try $CC $CFLAGS $LDFLAGS -o $test $test.c; then
+ echo "Checking for fseeko... Yes." | tee -a configure.log
+ else
+ CFLAGS="${CFLAGS} -DNO_FSEEKO"
+@@ -547,7 +547,7 @@ cat > $test.c <<EOF
+ #include <errno.h>
+ int main() { return strlen(strerror(errno)); }
+ EOF
+-if try $CC $CFLAGS -o $test $test.c; then
++if try $CC $CFLAGS $LDFLAGS -o $test $test.c; then
+ echo "Checking for strerror... Yes." | tee -a configure.log
+ else
+ CFLAGS="${CFLAGS} -DNO_STRERROR"
+@@ -654,7 +654,7 @@ int main()
+ return (mytest("Hello%d\n", 1));
+ }
+ EOF
+- if try $CC $CFLAGS -o $test $test.c; then
++ if try $CC $CFLAGS $LDFLAGS -o $test $test.c; then
+ echo "Checking for vsnprintf() in stdio.h... Yes." | tee -a configure.log
+
+ echo >> configure.log
+@@ -744,7 +744,7 @@ int main()
+ }
+ EOF
+
+- if try $CC $CFLAGS -o $test $test.c; then
++ if try $CC $CFLAGS $LDFLAGS -o $test $test.c; then
+ echo "Checking for snprintf() in stdio.h... Yes." | tee -a configure.log
+
+ echo >> configure.log
+
diff --git a/sys-libs/zlib/zlib-1.2.11-r4.ebuild b/sys-libs/zlib/zlib-1.2.11-r4.ebuild
index bc2fe9834ee2..f81dba33f73c 100644
--- a/sys-libs/zlib/zlib-1.2.11-r4.ebuild
+++ b/sys-libs/zlib/zlib-1.2.11-r4.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
@@ -14,6 +14,7 @@ CYGWINPATCHES=(
DESCRIPTION="Standard (de)compression library"
HOMEPAGE="https://zlib.net/"
SRC_URI="https://zlib.net/${P}.tar.gz
+ https://zlib.net/fossils/${P}.tar.gz
http://www.gzip.org/zlib/${P}.tar.gz
http://www.zlib.net/current/beta/${P}.tar.gz
elibc_Cygwin? ( ${CYGWINPATCHES[*]} )"
diff --git a/sys-libs/zlib/zlib-1.2.11-r5.ebuild b/sys-libs/zlib/zlib-1.2.11-r5.ebuild
index 5173a430e69f..c24cdc4a3552 100644
--- a/sys-libs/zlib/zlib-1.2.11-r5.ebuild
+++ b/sys-libs/zlib/zlib-1.2.11-r5.ebuild
@@ -14,6 +14,7 @@ CYGWINPATCHES=(
DESCRIPTION="Standard (de)compression library"
HOMEPAGE="https://zlib.net/"
SRC_URI="https://zlib.net/${P}.tar.gz
+ https://zlib.net/fossils/${P}.tar.gz
http://www.gzip.org/zlib/${P}.tar.gz
http://www.zlib.net/current/beta/${P}.tar.gz
elibc_Cygwin? ( ${CYGWINPATCHES[*]} )"
diff --git a/sys-libs/zlib/zlib-1.2.12-r1.ebuild b/sys-libs/zlib/zlib-1.2.12-r1.ebuild
new file mode 100644
index 000000000000..425c0f30bdb5
--- /dev/null
+++ b/sys-libs/zlib/zlib-1.2.12-r1.ebuild
@@ -0,0 +1,188 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+AUTOTOOLS_AUTO_DEPEND="no"
+VERIFY_SIG_OPENPGP_KEY_PATH="${BROOT}"/usr/share/openpgp-keys/madler.asc
+inherit autotools multilib-minimal usr-ldscript verify-sig
+
+CYGWINPATCHES=(
+ "https://github.com/cygwinports/zlib/raw/22a3462cae33a82ad966ea0a7d6cbe8fc1368fec/1.2.11-gzopen_w.patch -> ${PN}-1.2.11-cygwin-gzopen_w.patch"
+ "https://github.com/cygwinports/zlib/raw/22a3462cae33a82ad966ea0a7d6cbe8fc1368fec/1.2.7-minizip-cygwin.patch -> ${PN}-1.2.7-cygwin-minizip.patch"
+)
+
+DESCRIPTION="Standard (de)compression library"
+HOMEPAGE="https://zlib.net/"
+SRC_URI="https://zlib.net/${P}.tar.gz
+ https://zlib.net/fossils/${P}.tar.gz
+ https://www.gzip.org/zlib/${P}.tar.gz
+ https://www.zlib.net/current/beta/${P}.tar.gz
+ verify-sig? ( https://zlib.net/${P}.tar.gz.asc )
+ elibc_Cygwin? ( ${CYGWINPATCHES[*]} )"
+
+LICENSE="ZLIB"
+SLOT="0/1" # subslot = SONAME
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris ~x86-winnt"
+IUSE="minizip static-libs"
+
+RDEPEND="!sys-libs/zlib-ng[compat]"
+DEPEND="${RDEPEND}"
+BDEPEND="minizip? ( ${AUTOTOOLS_DEPEND} )
+ verify-sig? ( sec-keys/openpgp-keys-madler )"
+
+PATCHES=(
+ # bug #658536
+ "${FILESDIR}"/${PN}-1.2.11-minizip-drop-crypt-header.patch
+
+ # bug #831628
+ "${FILESDIR}"/${PN}-1.2.11-configure-fix-AR-RANLIB-NM-detection.patch
+
+ # Fix broken CC logic
+ "${FILESDIR}"/${PN}-1.2.12-fix-CC-logic-in-configure.patch
+)
+
+src_prepare() {
+ default
+
+ if use elibc_Cygwin ; then
+ local p
+ for p in "${CYGWINPATCHES[@]}" ; do
+ # Strip out the "... -> " from the array
+ eapply -p2 "${DISTDIR}/${p#*> }"
+ done
+ fi
+
+ if use minizip ; then
+ cd contrib/minizip || die
+ eautoreconf
+ fi
+
+ case ${CHOST} in
+ *-cygwin*)
+ # Do not use _wopen, it's a mingw-only symbol
+ sed -i -e '/define WIDECHAR/d' "${S}"/gzguts.h || die
+
+ # zlib1.dll is the mingw name, need cygz.dll
+ # cygz.dll is loaded by toolchain, put into subdir
+ sed -i -e 's|zlib1.dll|win32/cygz.dll|' win32/Makefile.gcc || die
+
+ ;;
+ esac
+
+ case ${CHOST} in
+ *-mingw*|mingw*|*-cygwin*)
+ # Uses preconfigured Makefile rather than configure script
+ multilib_copy_sources
+
+ ;;
+ esac
+}
+
+echoit() { echo "$@"; "$@"; }
+
+multilib_src_configure() {
+ case ${CHOST} in
+ *-mingw*|mingw*|*-cygwin*)
+ ;;
+
+ *)
+ # bug #347167
+ local uname=$("${BROOT}"/usr/share/gnuconfig/config.sub "${CHOST}" | cut -d- -f3)
+
+ local myconf=(
+ --shared
+ --prefix="${EPREFIX}/usr"
+ --libdir="${EPREFIX}/usr/$(get_libdir)"
+ ${uname:+--uname=${uname}}
+ )
+
+ # Not an autoconf script, so can't use econf
+ echoit "${S}"/configure "${myconf[@]}" || die
+
+ ;;
+ esac
+
+ if use minizip ; then
+ local minizipdir="contrib/minizip"
+ mkdir -p "${BUILD_DIR}/${minizipdir}" || die
+
+ cd ${minizipdir} || die
+ ECONF_SOURCE="${S}/${minizipdir}" econf $(use_enable static-libs static)
+ fi
+}
+
+multilib_src_compile() {
+ case ${CHOST} in
+ *-mingw*|mingw*|*-cygwin*)
+ emake -f win32/Makefile.gcc STRIP=true PREFIX=${CHOST}-
+ sed \
+ -e 's|@prefix@|'"${EPREFIX}"'/usr|g' \
+ -e 's|@exec_prefix@|${prefix}|g' \
+ -e 's|@libdir@|${exec_prefix}/'$(get_libdir)'|g' \
+ -e 's|@sharedlibdir@|${exec_prefix}/'$(get_libdir)'|g' \
+ -e 's|@includedir@|${prefix}/include|g' \
+ -e 's|@VERSION@|'${PV}'|g' \
+ zlib.pc.in > zlib.pc || die
+ ;;
+
+ *)
+ emake
+
+ ;;
+ esac
+
+ use minizip && emake -C contrib/minizip
+}
+
+sed_macros() {
+ # Clean up namespace a little, bug #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*|*-cygwin*)
+ 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, bug #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
+
+ if use minizip; then
+ # This might not exist if slibtool is used.
+ # bug #816756
+ rm -f "${ED}"/usr/$(get_libdir)/libminizip.la || die
+ fi
+
+ if ! use static-libs ; then
+ # bug #419645
+ rm "${ED}"/usr/$(get_libdir)/libz.a || die
+ fi
+}
+
+multilib_src_install_all() {
+ dodoc FAQ README ChangeLog doc/*.txt
+ use minizip && dodoc contrib/minizip/*.txt
+}
diff --git a/sys-libs/zlib/zlib-1.2.12-r2.ebuild b/sys-libs/zlib/zlib-1.2.12-r2.ebuild
new file mode 100644
index 000000000000..166bfbad0465
--- /dev/null
+++ b/sys-libs/zlib/zlib-1.2.12-r2.ebuild
@@ -0,0 +1,196 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+# Worth keeping an eye on 'develop' branch upstream for possible backports.
+AUTOTOOLS_AUTO_DEPEND="no"
+VERIFY_SIG_OPENPGP_KEY_PATH="${BROOT}"/usr/share/openpgp-keys/madler.asc
+inherit autotools multilib-minimal usr-ldscript verify-sig
+
+CYGWINPATCHES=(
+ "https://github.com/cygwinports/zlib/raw/22a3462cae33a82ad966ea0a7d6cbe8fc1368fec/1.2.11-gzopen_w.patch -> ${PN}-1.2.11-cygwin-gzopen_w.patch"
+ "https://github.com/cygwinports/zlib/raw/22a3462cae33a82ad966ea0a7d6cbe8fc1368fec/1.2.7-minizip-cygwin.patch -> ${PN}-1.2.7-cygwin-minizip.patch"
+)
+
+DESCRIPTION="Standard (de)compression library"
+HOMEPAGE="https://zlib.net/"
+SRC_URI="https://zlib.net/${P}.tar.gz
+ https://zlib.net/fossils/${P}.tar.gz
+ https://www.gzip.org/zlib/${P}.tar.gz
+ https://www.zlib.net/current/beta/${P}.tar.gz
+ verify-sig? ( https://zlib.net/${P}.tar.gz.asc )
+ elibc_Cygwin? ( ${CYGWINPATCHES[*]} )"
+
+LICENSE="ZLIB"
+SLOT="0/1" # subslot = SONAME
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris ~x86-winnt"
+IUSE="minizip static-libs"
+
+RDEPEND="!sys-libs/zlib-ng[compat]"
+DEPEND="${RDEPEND}"
+BDEPEND="minizip? ( ${AUTOTOOLS_DEPEND} )
+ verify-sig? ( sec-keys/openpgp-keys-madler )"
+
+PATCHES=(
+ # Don't install unexpected & unused crypt.h header (which would clash with other pkgs)
+ # Pending upstream. bug #658536
+ "${FILESDIR}"/${PN}-1.2.11-minizip-drop-crypt-header.patch
+
+ # Respect AR, RANLIB, NM during build. Pending upstream. bug #831628
+ "${FILESDIR}"/${PN}-1.2.11-configure-fix-AR-RANLIB-NM-detection.patch
+
+ # Respect LDFLAGS during configure tests. Pending upstream
+ "${FILESDIR}"/${PN}-1.2.12-use-LDFLAGS-in-configure.patch
+
+ # Fix broken CC logic
+ "${FILESDIR}"/${P}-fix-CC-logic-in-configure.patch
+
+ # Backport for Java (and others), bug #836370
+ "${FILESDIR}"/${P}-CRC-buggy-input.patch
+)
+
+src_prepare() {
+ default
+
+ if use elibc_Cygwin ; then
+ local p
+ for p in "${CYGWINPATCHES[@]}" ; do
+ # Strip out the "... -> " from the array
+ eapply -p2 "${DISTDIR}/${p#*> }"
+ done
+ fi
+
+ if use minizip ; then
+ cd contrib/minizip || die
+ eautoreconf
+ fi
+
+ case ${CHOST} in
+ *-cygwin*)
+ # Do not use _wopen, it's a mingw-only symbol
+ sed -i -e '/define WIDECHAR/d' "${S}"/gzguts.h || die
+
+ # zlib1.dll is the mingw name, need cygz.dll
+ # cygz.dll is loaded by toolchain, put into subdir
+ sed -i -e 's|zlib1.dll|win32/cygz.dll|' win32/Makefile.gcc || die
+
+ ;;
+ esac
+
+ case ${CHOST} in
+ *-mingw*|mingw*|*-cygwin*)
+ # Uses preconfigured Makefile rather than configure script
+ multilib_copy_sources
+
+ ;;
+ esac
+}
+
+echoit() { echo "$@"; "$@"; }
+
+multilib_src_configure() {
+ case ${CHOST} in
+ *-mingw*|mingw*|*-cygwin*)
+ ;;
+
+ *)
+ # bug #347167
+ local uname=$("${BROOT}"/usr/share/gnuconfig/config.sub "${CHOST}" | cut -d- -f3)
+
+ local myconf=(
+ --shared
+ --prefix="${EPREFIX}/usr"
+ --libdir="${EPREFIX}/usr/$(get_libdir)"
+ ${uname:+--uname=${uname}}
+ )
+
+ # Not an autoconf script, so can't use econf
+ echoit "${S}"/configure "${myconf[@]}" || die
+
+ ;;
+ esac
+
+ if use minizip ; then
+ local minizipdir="contrib/minizip"
+ mkdir -p "${BUILD_DIR}/${minizipdir}" || die
+
+ cd ${minizipdir} || die
+ ECONF_SOURCE="${S}/${minizipdir}" econf $(use_enable static-libs static)
+ fi
+}
+
+multilib_src_compile() {
+ case ${CHOST} in
+ *-mingw*|mingw*|*-cygwin*)
+ emake -f win32/Makefile.gcc STRIP=true PREFIX=${CHOST}-
+ sed \
+ -e 's|@prefix@|'"${EPREFIX}"'/usr|g' \
+ -e 's|@exec_prefix@|${prefix}|g' \
+ -e 's|@libdir@|${exec_prefix}/'$(get_libdir)'|g' \
+ -e 's|@sharedlibdir@|${exec_prefix}/'$(get_libdir)'|g' \
+ -e 's|@includedir@|${prefix}/include|g' \
+ -e 's|@VERSION@|'${PV}'|g' \
+ zlib.pc.in > zlib.pc || die
+ ;;
+
+ *)
+ emake
+
+ ;;
+ esac
+
+ use minizip && emake -C contrib/minizip
+}
+
+sed_macros() {
+ # Clean up namespace a little, bug #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*|*-cygwin*)
+ 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, bug #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
+
+ if use minizip; then
+ # This might not exist if slibtool is used.
+ # bug #816756
+ rm -f "${ED}"/usr/$(get_libdir)/libminizip.la || die
+ fi
+
+ if ! use static-libs ; then
+ # bug #419645
+ rm "${ED}"/usr/$(get_libdir)/libz.a || die
+ fi
+}
+
+multilib_src_install_all() {
+ dodoc FAQ README ChangeLog doc/*.txt
+ use minizip && dodoc contrib/minizip/*.txt
+}