From 77c09085fe33d73f29f39b8f970892d89698e75c Mon Sep 17 00:00:00 2001 From: Samuel Tyler Date: Sun, 7 Sep 2025 23:17:14 +1000 Subject: [PATCH] Perl 5.40.3 --- .../files/Compress-Raw-Zlib_config.in | 6 ++ steps/perl-5.40.3/pass1.sh | 98 +++++++++++++++++++ .../patches/Devel-PPPort-remove-sprintf.patch | 13 +++ .../patches/fix-debugging-re.patch | 13 +++ .../patches/remove-machine-generated.patch | 19 ++++ steps/perl-5.40.3/sources | 2 + 6 files changed, 151 insertions(+) create mode 100644 steps/perl-5.40.3/files/Compress-Raw-Zlib_config.in create mode 100755 steps/perl-5.40.3/pass1.sh create mode 100644 steps/perl-5.40.3/patches/Devel-PPPort-remove-sprintf.patch create mode 100644 steps/perl-5.40.3/patches/fix-debugging-re.patch create mode 100644 steps/perl-5.40.3/patches/remove-machine-generated.patch create mode 100644 steps/perl-5.40.3/sources diff --git a/steps/perl-5.40.3/files/Compress-Raw-Zlib_config.in b/steps/perl-5.40.3/files/Compress-Raw-Zlib_config.in new file mode 100644 index 00000000..60b8dd1c --- /dev/null +++ b/steps/perl-5.40.3/files/Compress-Raw-Zlib_config.in @@ -0,0 +1,6 @@ +BUILD_ZLIB = False +ZLIB_INCLUDE = /usr/include +ZLIB_LIB = /usr/lib/i386-unknown-linux-musl +OLD_ZLIB = False +GZIP_OS_CODE = AUTO_DETECT +USE_ZLIB_NG = False diff --git a/steps/perl-5.40.3/pass1.sh b/steps/perl-5.40.3/pass1.sh new file mode 100755 index 00000000..8d133f1b --- /dev/null +++ b/steps/perl-5.40.3/pass1.sh @@ -0,0 +1,98 @@ +# SPDX-FileCopyrightText: 2025 fosslinux +# +# SPDX-License-Identifier: GPL-3.0-or-later + +src_prepare() { + default + + mv Compress-Raw-Zlib_config.in cpan/Compress-Raw-Zlib/config.in + + # Remove miscellaneous pregenerated files + rm -f Porting/Glossary \ + dist/Devel-PPPort/parts/apidoc.fnc Configure config_h.SH \ + cpan/Win32API-File/cFile.pc cpan/Sys-Syslog/win32/Win32.pm \ + dist/ExtUtils-CBuilder/Makefile.PL \ + cpan/Test-Simple/lib/Test2/Util/HashBase.pm \ + cpan/Term-Table/lib/Term/Table/HashBase.pm \ + dist/Tie-File/Makefile.PL + rm win32/perlexe.ico + rm -r cpan/Compress-Raw-Zlib/zlib-src + + # Generated tests + rm cpan/Unicode-Collate/Collate/keys.txt + + # Regenerate other prebuilt header files + # Taken from headers of regen scripts + rm -f lib/warnings.pm warnings.h regnodes.h reentr.h reentr.c \ + overload.h opcode.h opnames.h pp_proto.h \ + keywords.h embed.h embedvar.h perlapi.{c,h} \ + proto.h lib/overload/numbers.pm regcharclass.h perly.{tab,h,act} \ + mg_{raw.h,vtable.h} keywords.c l1_char_class_tab.h \ + lib/feature.pm lib/B/Op_private.pm lib/unicore/uni_keywords.pl \ + miniperlmain.c unicode_constants.h uni_keywords.h \ + charclass_invlists.h ebcdic_tables.h mg_names.inc overload.inc \ + packsizetables.inc regexp_constants.h locale_table.h scope_types.h \ + charclass_invlists.inc + perl regen.pl + perl regen_perly.pl + perl regen/keywords.pl + perl regen/mk_PL_charclass.pl + perl regen/regcharclass.pl + perl regen/genpacksizetables.pl + perl regen/ebcdic.pl + perl regen/miniperlmain.pl + perl regen/unicode_constants.pl + perl lib/unicore/mktables -C lib/unicore -P pod -maketest -makelist -p + mkdir lib_unicore + ln -s ../lib/unicore lib_unicore/ + perl -Ilib_unicore regen/mk_invlists.pl + + # regenerate configure + mconf_dir=$(echo ../metaconfig*) + ln -s "$mconf_dir"/.package . + ln -s "$mconf_dir"/U . + touch U/modified/{d_openat.U,d_vsnprintf.U,d_sched_yield.U} # null it + metaconfig -m + + # Glossary + ln -s ../perl-* "$mconf_dir"/perl + "$mconf_dir"/U/mkglossary > Porting/Glossary + + # Remove lines from MANIFEST that we have deleted + while read -r line; do + f="$(echo "${line}" | cut -d' ' -f1)" + if [ -e "${f}" ]; then + echo "${line}" + fi + done < MANIFEST > MANIFEST.new + mv MANIFEST.new MANIFEST +} + +src_configure() { + ./Configure -des \ + -Dprefix="${PREFIX}" \ + -Dcc=gcc \ + -Dusedl=false \ + -Ddate=':' \ + -Dccflags="-U__DATE__ -U__TIME__" \ + -Darchname="i386-linux" \ + -Dmyhostname="(none)" \ + -Dmaildomain="(none)" +} + +src_compile() { + make "${MAKEJOBS}" pod/perlapi.pod + + pushd dist/Devel-PPPort + perl devel/mkapidoc.pl + popd + + default +} + +src_install() { + default + + # Remove messed up manpages + rm "${DESTDIR}/"*.0 +} diff --git a/steps/perl-5.40.3/patches/Devel-PPPort-remove-sprintf.patch b/steps/perl-5.40.3/patches/Devel-PPPort-remove-sprintf.patch new file mode 100644 index 00000000..c054c1f8 --- /dev/null +++ b/steps/perl-5.40.3/patches/Devel-PPPort-remove-sprintf.patch @@ -0,0 +1,13 @@ +diff --git perl-5.40.3/dist/Devel-PPPort/PPPort_pm.PL perl-5.40.3/dist/Devel-PPPort/PPPort_pm.PL +index cfbfaeb8fa..f93e56df15 100644 +--- perl-5.40.3/dist/Devel-PPPort/PPPort_pm.PL ++++ perl-5.40.3/dist/Devel-PPPort/PPPort_pm.PL +@@ -891,8 +891,6 @@ __DATA__ + + %include snprintf + +-%include sprintf +- + %include exception + + %include strlfuncs diff --git a/steps/perl-5.40.3/patches/fix-debugging-re.patch b/steps/perl-5.40.3/patches/fix-debugging-re.patch new file mode 100644 index 00000000..4748311a --- /dev/null +++ b/steps/perl-5.40.3/patches/fix-debugging-re.patch @@ -0,0 +1,13 @@ +diff --git perl-5.40.3/ext/re/Makefile.PL perl-5.40.3/ext/re/Makefile.PL +index 01786e1ec2..cc4619bfc3 100644 +--- perl-5.40.3/ext/re/Makefile.PL ++++ perl-5.40.3/ext/re/Makefile.PL +@@ -27,7 +27,7 @@ foreach my $tuple (@files) { + } + } + +-my $defines = '-DPERL_EXT_RE_BUILD -DPERL_EXT_RE_DEBUG -DPERL_EXT'; ++my $defines = '-DPERL_EXT_RE_BUILD -DPERL_EXT_RE_DEBUG -DPERL_EXT -DDEBUGGING'; + my %args; + for my $arg (@ARGV) { + $args{$1} = $2 if $arg =~ /^(\w+)=(.*)$/; diff --git a/steps/perl-5.40.3/patches/remove-machine-generated.patch b/steps/perl-5.40.3/patches/remove-machine-generated.patch new file mode 100644 index 00000000..2dd00179 --- /dev/null +++ b/steps/perl-5.40.3/patches/remove-machine-generated.patch @@ -0,0 +1,19 @@ +There is no way to regenerate this easily. It is merely a fallback for when the +previous fails and it will not fail with our perl. + +diff --color -ru perl-5.40.3/cpan/Pod-Simple/lib/Pod/Simple/BlackBox.pm perl-5.40.3/cpan/Pod-Simple/lib/Pod/Simple/BlackBox.pm +--- perl-5.40.3/cpan/Pod-Simple/lib/Pod/Simple/BlackBox.pm 2025-07-23 21:56:14.121284638 +1000 ++++ perl-5.40.3/cpan/Pod-Simple/lib/Pod/Simple/BlackBox.pm 2025-07-23 22:05:05.990255330 +1000 +@@ -74,13 +74,6 @@ + my $script_run_re = eval 'no warnings "experimental::script_run"; + qr/(*script_run: ^ .* $ )/x'; + my $latin_re = my_qr('[\p{IsLatin}\p{IsInherited}\p{IsCommon}]', "\x{100}"); +-unless ($latin_re) { +- # This was machine generated to be the ranges of the union of the above +- # three properties, with things that were undefined by Unicode 4.1 filling +- # gaps. That is the version in use when Perl advanced enough to +- # successfully compile and execute the above pattern. +- $latin_re = my_qr('[\x00-\x{02E9}\x{02EC}-\x{0374}\x{037E}\x{0385}\x{0387}\x{0485}\x{0486}\x{0589}\x{060C}\x{061B}\x{061F}\x{0640}\x{064B}-\x{0655}\x{0670}\x{06DD}\x{0951}-\x{0954}\x{0964}\x{0965}\x{0E3F}\x{10FB}\x{16EB}-\x{16ED}\x{1735}\x{1736}\x{1802}\x{1803}\x{1805}\x{1D00}-\x{1D25}\x{1D2C}-\x{1D5C}\x{1D62}-\x{1D65}\x{1D6B}-\x{1D77}\x{1D79}-\x{1DBE}\x{1DC0}-\x{1EF9}\x{2000}-\x{2125}\x{2127}-\x{27FF}\x{2900}-\x{2B13}\x{2E00}-\x{2E1D}\x{2FF0}-\x{3004}\x{3006}\x{3008}-\x{3020}\x{302A}-\x{302D}\x{3030}-\x{3037}\x{303C}-\x{303F}\x{3099}-\x{309C}\x{30A0}\x{30FB}\x{30FC}\x{3190}-\x{319F}\x{31C0}-\x{31CF}\x{3220}-\x{325F}\x{327F}-\x{32CF}\x{3358}-\x{33FF}\x{4DC0}-\x{4DFF}\x{A700}-\x{A716}\x{FB00}-\x{FB06}\x{FD3E}\x{FD3F}\x{FE00}-\x{FE6B}\x{FEFF}-\x{FF65}\x{FF70}\x{FF9E}\x{FF9F}\x{FFE0}-\x{FFFD}\x{10100}-\x{1013F}\x{1D000}-\x{1D1DD}\x{1D300}-\x{1D7FF}]', "\x{100}"); +-} + + my $every_char_is_latin_re = my_qr("^(?:$latin_re)*\\z", "A"); diff --git a/steps/perl-5.40.3/sources b/steps/perl-5.40.3/sources new file mode 100644 index 00000000..09051037 --- /dev/null +++ b/steps/perl-5.40.3/sources @@ -0,0 +1,2 @@ +http://www.cpan.org/src/5.0/perl-5.40.3.tar.xz 65f63b4763ab6cb9bb3d5731dd10369e1705be3c59be9847d453eb60b349ab43 +git://github.com/Perl/metaconfig~5.42.0 https://github.com/Perl/metaconfig/archive/5.42.0.tar.gz ac3948bd684a3c017a241b6fc7b899c901f814b36d030ee79887374884e30301