From 0807cb0834ddf9236818bf7b227ad90c64383cb4 Mon Sep 17 00:00:00 2001 From: Samuel Tyler Date: Thu, 28 Aug 2025 13:58:12 +1000 Subject: [PATCH] Clean up perl 5.18.4 --- .../files/Compress-Raw-Zlib_config.in | 4 ++ steps/perl-5.18.4/pass1.sh | 12 ++--- ...-Allow-internal-properties-in-invmap.patch | 52 +++++++++++++++++++ .../Revert-regen-mk_PL_charclass-pl.patch | 8 +++ steps/perl-5.18.4/patches/a2p-c-bison.patch | 7 +++ steps/perl-5.18.4/reenable-regcharclass.patch | 17 ------ 6 files changed, 77 insertions(+), 23 deletions(-) create mode 100644 steps/perl-5.18.4/patches/0001-Unicode-UCD-Allow-internal-properties-in-invmap.patch delete mode 100644 steps/perl-5.18.4/reenable-regcharclass.patch diff --git a/steps/perl-5.18.4/files/Compress-Raw-Zlib_config.in b/steps/perl-5.18.4/files/Compress-Raw-Zlib_config.in index 3bbcf2f4..cbad2f99 100644 --- a/steps/perl-5.18.4/files/Compress-Raw-Zlib_config.in +++ b/steps/perl-5.18.4/files/Compress-Raw-Zlib_config.in @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2025 fosslinux +# +# SPDX-License-Identifier: MIT + BUILD_ZLIB = False INCLUDE = /usr/include LIB = /usr/lib/i386-unknown-linux-musl diff --git a/steps/perl-5.18.4/pass1.sh b/steps/perl-5.18.4/pass1.sh index 38e29c8a..d4c4d7af 100755 --- a/steps/perl-5.18.4/pass1.sh +++ b/steps/perl-5.18.4/pass1.sh @@ -8,7 +8,7 @@ src_prepare() { mv Compress-Raw-Zlib_config.in cpan/Compress-Raw-Zlib/config.in # Remove miscellaneous pregenerated files - rm -f Porting/Glossary \ + rm Porting/Glossary \ cpan/Devel-PPPort/parts/apidoc.fnc Configure config_h.SH \ x2p/a2p.c cpan/Win32API-File/cFile.pc cpan/Sys-Syslog/win32/Win32.pm \ utils/Makefile @@ -18,12 +18,9 @@ src_prepare() { # Generated tests rm cpan/Devel-PPPort/t/*.t cpan/Unicode-Collate/Collate/keys.txt - # Partially generated file - #sed -i '/GENERATED CODE/q' utf8.h - # Regenerate other prebuilt header files # Taken from headers of regen scripts - rm -f lib/warnings.pm warnings.h regnodes.h reentr.h reentr.c \ + rm lib/warnings.pm warnings.h regnodes.h reentr.h reentr.c \ overload.h overload.c opcode.h opnames.h pp_proto.h \ keywords.h embed.h embedvar.h perlapi.c perlapi.h \ proto.h lib/overload/numbers.pm regcharclass.h perly.{tab,h,act} \ @@ -90,7 +87,10 @@ src_compile() { popd # The Revert-regen-mk_PL_charclass-pl.patch breaks building some - # modules for reasons that are not exactly clear. + # modules. The error messages are fairly cryptic. It seems probable that + # the symbols have been used elsewhere in the codebase or there is a + # reliance on different behaviour. + # # We will build miniperl, revert the patch, regenerate l1_char_class_tab.h, # (using miniperl), and then go again diff --git a/steps/perl-5.18.4/patches/0001-Unicode-UCD-Allow-internal-properties-in-invmap.patch b/steps/perl-5.18.4/patches/0001-Unicode-UCD-Allow-internal-properties-in-invmap.patch new file mode 100644 index 00000000..61f0b0b9 --- /dev/null +++ b/steps/perl-5.18.4/patches/0001-Unicode-UCD-Allow-internal-properties-in-invmap.patch @@ -0,0 +1,52 @@ +SPDX-FileCopyrightText: 2012 Karl Williamson +SPDX-FileCopyrightText: 2025 fosslinux + +SPDX-License-Identifier: Artistic-1.0 + +In a similar way to the patch in 5.17.2, future versions rely on the +existance of the invmap internal properties, so backport it to this +version. + +From 443e0d0dd92c8ed574a7845b0927346bb8f521e4 Mon Sep 17 00:00:00 2001 +From: Karl Williamson +Date: Sat, 19 Jul 2014 11:35:34 -0600 +Subject: [PATCH] Unicode::UCD: Allow internal properties in invmap() + +This adds an undocumented way to get invmap() to return internal +properties, like invlist(). This is intended only for Perl-core +use. +--- + lib/Unicode/UCD.pm | 10 ++++++++-- + 1 file changed, 8 insertions(+), 2 deletions(-) + +diff --git perl-5.18.4/lib/Unicode/UCD.pm perl-5.18.4/lib/Unicode/UCD.pm +index 9c3dd7c710..93ae110a5d 100644 +--- perl-5.18.4/lib/Unicode/UCD.pm ++++ perl-5.18.4/lib/Unicode/UCD.pm +@@ -2802,15 +2802,21 @@ our @algorithmic_named_code_points; + our $HANGUL_BEGIN; + our $HANGUL_COUNT; + +-sub prop_invmap ($) { ++sub prop_invmap ($;$) { + + croak __PACKAGE__, "::prop_invmap: must be called in list context" unless wantarray; + + my $prop = $_[0]; + return unless defined $prop; + ++ # Undocumented way to get at Perl internal properties; it may be changed ++ # or removed without notice at any time. It currently also changes the ++ # output to use the format specified in the file rather than the one we ++ # normally compute and return ++ my $internal_ok = defined $_[1] && $_[1] eq '_perl_core_internal_ok'; ++ + # Fail internal properties +- return if $prop =~ /^_/; ++ return if $prop =~ /^_/ && ! $internal_ok; + + # The values returned by this function. + my (@invlist, @invmap, $format, $missing); +-- +2.49.1 + diff --git a/steps/perl-5.18.4/patches/Revert-regen-mk_PL_charclass-pl.patch b/steps/perl-5.18.4/patches/Revert-regen-mk_PL_charclass-pl.patch index 8e28d30b..456171dd 100644 --- a/steps/perl-5.18.4/patches/Revert-regen-mk_PL_charclass-pl.patch +++ b/steps/perl-5.18.4/patches/Revert-regen-mk_PL_charclass-pl.patch @@ -1,3 +1,11 @@ +SPDX-FileCopyrightText: 2025 fosslinux +SPDX-FileCopyrightText: 2012 Karl Williamson + +SPDX-License-Identifier: Artistic-1.0 + +Both of these commits remove use of symbols that were added and then +immediately used in the regeneration script. + From 6f1d133ec238228c656fcd05d6b42f562aaa92b3 Mon Sep 17 00:00:00 2001 From: Samuel Tyler Date: Thu, 21 Aug 2025 19:28:54 +1000 diff --git a/steps/perl-5.18.4/patches/a2p-c-bison.patch b/steps/perl-5.18.4/patches/a2p-c-bison.patch index ae1d1fb9..7edd2292 100644 --- a/steps/perl-5.18.4/patches/a2p-c-bison.patch +++ b/steps/perl-5.18.4/patches/a2p-c-bison.patch @@ -1,3 +1,10 @@ +SPDX-FileCopyrightText: 2025 fosslinux + +SPDX-License-Identifier: Artistic-1.0 + +Older versions of Bison produced 4 spaces before `goto yyerrlab`, +but ours produces more. + --- perl-5.18.4/x2p/Makefile.SH 2025-07-17 18:07:55.350717970 +1000 +++ perl-5.18.4/x2p/Makefile.SH 2025-07-17 18:09:02.340711269 +1000 @@ -123,7 +123,7 @@ diff --git a/steps/perl-5.18.4/reenable-regcharclass.patch b/steps/perl-5.18.4/reenable-regcharclass.patch deleted file mode 100644 index 30af8f15..00000000 --- a/steps/perl-5.18.4/reenable-regcharclass.patch +++ /dev/null @@ -1,17 +0,0 @@ -diff --git perl-5.18.4/regen/regcharclass.pl perl-5.18.4/regen/regcharclass.pl -index f5cf315a54..81dcdc578d 100755 ---- perl-5.18.4/regen/regcharclass.pl -+++ perl-5.18.4/regen/regcharclass.pl -@@ -1468,9 +1468,9 @@ GCB_V: Grapheme_Cluster_Break=V - # million code points. The results would not change unless utf8.h decides it - # wants a maximum other than 4 bytes, or this program creates better - # optimizations --#UTF8_CHAR: Matches utf8 from 1 to 4 bytes --#=> UTF8 :safe only_ascii_platform --#0x0 - 0x1FFFFF -+UTF8_CHAR: Matches utf8 from 1 to 4 bytes -+=> UTF8 :safe only_ascii_platform -+0x0 - 0x1FFFFF - - # This hasn't been commented out, because we haven't an EBCDIC platform to run - # it on, and the 3 types of EBCDIC allegedly supported by Perl would have