From d644ed9cbbef28448deb9304de5a82e78e941dc9 Mon Sep 17 00:00:00 2001 From: yangmingtaip Date: Tue, 17 Jan 2023 18:10:30 +0800 Subject: [PATCH] fix compile failed caused by zlib update --- backport-fix-zlib-test-failed.patch | 95 +++++++++++++++++++++++++++++ perl.spec | 6 +- 2 files changed, 100 insertions(+), 1 deletion(-) create mode 100644 backport-fix-zlib-test-failed.patch diff --git a/backport-fix-zlib-test-failed.patch b/backport-fix-zlib-test-failed.patch new file mode 100644 index 0000000..ab2810c --- /dev/null +++ b/backport-fix-zlib-test-failed.patch @@ -0,0 +1,95 @@ +From e03bbd44e45aa58a8979703000b99228d45717d5 Mon Sep 17 00:00:00 2001 +From: Zach van Rijn +Date: Tue, 19 Apr 2022 12:35:20 -0500 +Subject: [PATCH] system/perl: bump { 5.34.0 --> 5.34.1 }. patch zlib +tests. + +Reference:https://git.adelielinux.org/adelie/packages/-/blob/ea11274c74787796bb0cdb0a7a97a9e07e2a7c05/system/perl/zlib-test.patch +--- + cpan/Compress-Raw-Zlib/t/02zlib.t | 24 ++++++++++++++++++++++-- + cpan/IO-Compress/t/cz-03zlib-v1.t | 13 ++++++++++++- + 2 files changed, 34 insertions(+), 3 deletions(-) + +diff --git a/cpan/Compress-Raw-Zlib/t/02zlib.t b/cpan/Compress-Raw-Zlib/t/02zlib.t +index 64c8944..9b2e9cb 100644 +--- a/cpan/Compress-Raw-Zlib/t/02zlib.t ++++ b/cpan/Compress-Raw-Zlib/t/02zlib.t +@@ -13,6 +13,7 @@ use bytes; + use Test::More ; + use CompTestUtils; + ++use constant ZLIB_1_2_12_0 => 0x12C0; + + BEGIN + { +@@ -490,7 +491,16 @@ SKIP: + last if $status == Z_STREAM_END or $status != Z_OK ; + } + +- cmp_ok $status, '==', Z_DATA_ERROR ; ++ # Z_STREAM_END returned by 1.12.2, Z_DATA_ERROR for older zlib ++ if (ZLIB_VERNUM >= ZLIB_1_2_12_0) ++ { ++ cmp_ok $status, '==', Z_STREAM_END ; ++ } ++ else ++ { ++ cmp_ok $status, '==', Z_DATA_ERROR ; ++ } ++ + is $GOT, $goodbye ; + + +@@ -514,7 +524,17 @@ SKIP: + is length($rest), $len2, "expected compressed output"; + + $GOT = ''; +- cmp_ok $k->inflate($rest, $GOT), '==', Z_DATA_ERROR, "inflate returns Z_DATA_ERROR"; ++ $status = $k->inflate($rest, $GOT); ++ # Z_STREAM_END returned by 1.12.2, Z_DATA_ERROR for older zlib ++ if (ZLIB_VERNUM >= ZLIB_1_2_12_0) ++ { ++ cmp_ok $status, '==', Z_STREAM_END ; ++ } ++ else ++ { ++ cmp_ok $status, '==', Z_DATA_ERROR ; ++ } ++ + is $GOT, $goodbye ; + } + +diff --git a/cpan/IO-Compress/t/cz-03zlib-v1.t b/cpan/IO-Compress/t/cz-03zlib-v1.t +index 9b75f9b..41734d0 100644 +--- a/cpan/IO-Compress/t/cz-03zlib-v1.t ++++ b/cpan/IO-Compress/t/cz-03zlib-v1.t +@@ -14,6 +14,8 @@ use Test::More ; + use CompTestUtils; + use Symbol; + ++use constant ZLIB_1_2_12_0 => 0x12C0; ++ + BEGIN + { + # use Test::NoWarnings, if available +@@ -700,7 +702,16 @@ EOM + + ($GOT, $status) = $k->inflate($rest) ; + +- ok $status == Z_DATA_ERROR ; ++ # Z_STREAM_END returned by 1.12.2, Z_DATA_ERROR for older zlib ++ if (ZLIB_VERNUM >= ZLIB_1_2_12_0) ++ { ++ cmp_ok $status, '==', Z_STREAM_END ; ++ } ++ else ++ { ++ cmp_ok $status, '==', Z_DATA_ERROR ; ++ } ++ + ok $Z . $GOT eq $goodbye ; + } + +-- +2.33.0 + diff --git a/perl.spec b/perl.spec index d2c9d5b..d15d7ce 100644 --- a/perl.spec +++ b/perl.spec @@ -24,7 +24,7 @@ Name: perl License: (GPL+ or Artistic) and (GPLv2+ or Artistic) and MIT and UCD and Public Domain and BSD Epoch: 4 Version: %{perl_version} -Release: 3 +Release: 4 Summary: A highly capable, feature-rich programming language Url: https://www.perl.org/ Source0: https://www.cpan.org/src/5.0/%{name}-%{version}.tar.xz @@ -37,6 +37,7 @@ Patch5: perl-5.35.1-Fix-GDBM_File-to-compile-with-version-1.20-and-earli.patch Patch6: perl-5.35.1-Raise-version-number-in-ext-GDBM_File-GDBM_File.pm.patch Patch7: change-lib-to-lib64.patch Patch8: disable-rpath-by-default.patch +Patch9: backport-fix-zlib-test-failed.patch Patch6000: backport-CVE-2021-36770.patch @@ -501,6 +502,9 @@ make test_harness %{_mandir}/man3/* %changelog +* Tue Jan 18 2023 4:5.34.0-4 +- fix compile failed caused by zlib update + * Fri Jul 01 2022 dongyuzhen 4:5.34.0-3 - Type:bugfix - ID:NA -- Gitee