Make 5.22.4 able to build 5.24

This commit is contained in:
Samuel Tyler 2025-09-01 11:00:48 +10:00
parent 073b7d0b54
commit 654e317725
4 changed files with 115 additions and 0 deletions

View file

@ -3,6 +3,12 @@
# SPDX-License-Identifier: GPL-3.0-or-later
src_prepare() {
# change unicode files to 5.24 version, in particular mktables
# This is required to have the necessary tables for the 5.24 build
mv ../perl-5.24.4/lib/unicore/{version,mktables,*.txt} lib/unicore/
mv ../perl-5.24.4/lib/unicore/auxiliary/*.txt lib/unicore/auxiliary/
mv ../perl-5.24.4/lib/unicore/extracted/*.txt lib/unicore/extracted/
default
mv Compress-Raw-Zlib_config.in cpan/Compress-Raw-Zlib/config.in

View file

@ -0,0 +1,77 @@
SPDX-FileCopyrightText: 2015 Karl Williamson <public@khwilliamson.com>
SPDX-FileCopyrightText: 2025 fosslinux <fosslinux@aussies.space>
SPDX-License-Identifier: Artistic-1.0
Partial backport of this commit. This support is required to use the
tables from 5.24.
From a6a212f8e678308557ffd57c2aa98ac504468b0e Mon Sep 17 00:00:00 2001
From: Karl Williamson <khw@cpan.org>
Date: Fri, 26 Jun 2015 11:50:18 -0600
Subject: [PATCH 1/1] mktables: Allow strictly named map tables
There are several types of tables generated by mktables. Most are
binary (match) tables, but another class is mapping tables. The names
for these may be loosely matched, but until this commit only the match
tables could have strict matching applied.
Strict matching is used for certain table names where loose could be
ambiguous, and for all names that aren't to be used by anything except
the perl core.
---
lib/utf8_heavy.pl | 22 ++++++++++++++++++----
2 files changed, 51 insertions(+), 9 deletions(-)
diff --git perl-5.22.4/lib/utf8_heavy.pl perl-5.22.4/lib/utf8_heavy.pl
index e0c3d5ed63..b595028460 100644
--- perl-5.22.4/lib/utf8_heavy.pl
+++ perl-5.22.4/lib/utf8_heavy.pl
@@ -404,7 +404,11 @@ sub _loose_name ($) {
# If didn't find it, try again with looser matching by editing
# out the applicable characters on the rhs and looking up
# again.
+ my $strict_property_and_table;
if (! defined $file) {
+
+ # This isn't used unless the name begins with 'to'
+ $strict_property_and_table = $property_and_table =~ s/^to//r;
$table = _loose_name($table);
$property_and_table = "$prefix$table";
print STDERR __LINE__, ": $property_and_table\n" if DEBUG;
@@ -444,10 +448,19 @@ sub _loose_name ($) {
##
# Only check if caller wants non-binary
my $retried = 0;
- if ($minbits != 1 && $property_and_table =~ s/^to//) {{
+ if ($minbits != 1) {
+ if ($property_and_table =~ s/^to//) {
# Look input up in list of properties for which we have
- # mapping files.
- if (defined ($file =
+ # mapping files. First do it with the strict approach
+ if (defined ($file =
+ $utf8::strict_property_to_file_of{$strict_property_and_table}))
+ {
+ $type = $utf8::file_to_swash_name{$file};
+ print STDERR __LINE__, ": type set to $type\n" if DEBUG;
+ $file = "$unicore_dir/$file.pl";
+ last GETFILE;
+ }
+ elsif (defined ($file =
$utf8::loose_property_to_file_of{$property_and_table}))
{
$type = $utf8::file_to_swash_name{$file};
@@ -497,7 +510,8 @@ sub _loose_name ($) {
$file = "$unicore_dir/lib/$file.pl" unless $file =~ m!^#/!;
last GETFILE;
}
- } }
+ }
+ }
##
## If we reach this line, it's because we couldn't figure
--
2.49.1

View file

@ -0,0 +1,31 @@
SPDX-FileCopyrightText: 2025 fosslinux <fosslinux@aussies.space>
SPDX-License-Identifier: Artistic-1.0
This diff is really on the 5.24 version of mktables, which we use in this
version to get the required tables to build 5.24. These changes are required
for the 5.24 mktables to run under 5.22.
diff --git perl-5.22.4/lib/unicore/mktables perl-5.22.4/lib/unicore/mktables
index 0566d8713d..00def69d7f 100644
--- perl-5.22.4/lib/unicore/mktables
+++ perl-5.22.4/lib/unicore/mktables
@@ -33,6 +33,7 @@ use File::Spec;
use Text::Tabs;
use re "/aa";
use feature 'state';
+use feature 'postderef';
sub DEBUG () { 0 } # Set to 0 for production; 1 for development
my $debugging_build = $Config{"ccflags"} =~ /-DDEBUGGING/;
@@ -549,6 +550,7 @@ my $MAX_LINE_WIDTH = 78;
# before normal completion.
my $debug_skip = 0;
+my $Assigned;
# Normally these are suppressed.
my $write_Unicode_deprecated_tables = 0;
--
2.49.1

View file

@ -1,2 +1,3 @@
http://www.cpan.org/src/5.0/perl-5.22.4.tar.xz 713243dce27d7aa0bdbf52b2070de5ce449f9ffbcc14a93efbc6f2beff0f5ce8
http://www.cpan.org/src/5.0/perl-5.24.4.tar.xz 7f080287ff64750270689843ae945f02159a33cb8f2fc910248c15befba5db84
git://github.com/Perl/metaconfig~5.26.1 https://github.com/Perl/metaconfig/archive/5.26.1.tar.gz 4641f5127a55cf2e1e8f9253ec27fba10b5b77076b4163e7f4bdc7f670d1aaf0