Building perl 5.18.4

This commit is contained in:
Samuel Tyler 2025-08-23 22:35:38 +10:00
parent 77392fa5ab
commit 1a07149847
6 changed files with 207 additions and 0 deletions

View file

@ -0,0 +1,5 @@
BUILD_ZLIB = False
INCLUDE = /usr/include
LIB = /usr/lib/i386-unknown-linux-musl
OLD_ZLIB = False
GZIP_OS_CODE = AUTO_DETECT

111
steps/perl-5.18.4/pass1.sh Executable file
View file

@ -0,0 +1,111 @@
# SPDX-FileCopyrightText: 2025 fosslinux <fosslinux@aussies.space>
#
# 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 \
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
rm win32/perlexe.ico
rm -r cpan/Compress-Raw-Zlib/zlib-src
# 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 \
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} \
mg_{raw.h,vtable.h,names.c} keywords.c l1_char_class_tab.h \
lib/feature.pm unicode_constants.h charclass_invlists.h
perl regen.pl
perl regen_perly.pl -b bison-2.3
perl regen/keywords.pl
perl regen/mk_PL_charclass.pl
perl regen/mk_invlists.pl
perl regen/unicode_constants.pl
perl regen/regcharclass.pl
# regenerate configure
ln -s ../metaconfig*/.package .
ln -s ../metaconfig*/U .
metaconfig -m
# Glossary
pushd Porting
ln -s /usr/lib/perl5/5.6.2/U .
makegloss
popd
bash cpan/Devel-PPPort/devel/mkapidoc.sh . \
cpan/Devel-PPPort/parts/apidoc.fnc \
cpan/Devel-PPPort/parts/embed.fnc
# 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)"
# Remains unclear why this is necessary
pushd x2p
./Makefile.SH
make depend
popd
pushd utils
bash Makefile.SH
popd
}
src_compile() {
pushd x2p
make BYACC=yacc run_byacc
popd
# The Revert-regen-mk_PL_charclass-pl.patch breaks building some
# modules for reasons that are not exactly clear.
# We will build miniperl, revert the patch, regenerate l1_char_class_tab.h,
# (using miniperl), and then go again
make "${MAKEJOBS}" miniperl lib/unicore/Name.pm
patch -Np1 -R -i ../../patches/Revert-regen-mk_PL_charclass-pl.patch
rm l1_char_class_tab.h
./miniperl -Ilib regen/mk_PL_charclass.pl
# there are concurrency issues
make -j1 PREFIX="${PREFIX}"
}
src_install() {
default
# Remove messed up manpages
rm "${DESTDIR}/"*.0
}

View file

@ -0,0 +1,61 @@
From 6f1d133ec238228c656fcd05d6b42f562aaa92b3 Mon Sep 17 00:00:00 2001
From: Samuel Tyler <fosslinux@aussies.space>
Date: Thu, 21 Aug 2025 19:28:54 +1000
Subject: [PATCH 1/4] Revert "regen/mk_PL_charclass.pl: Use mktables table for
charname"
This reverts commit 699ffc5e6f6d1426d23e60b98f7935ec76291935.
---
regen/mk_PL_charclass.pl | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git perl-5.18.4/regen/mk_PL_charclass.pl perl-5.18.4/regen/mk_PL_charclass.pl
index 63c06bc9f6..bfa4f7e3e6 100644
--- perl-5.18.4/regen/mk_PL_charclass.pl
+++ perl-5.18.4/regen/mk_PL_charclass.pl
@@ -185,7 +185,7 @@ for my $ord (0..255) {
# just \pP outside it.
$re = qr/\p{Punct}|[^\P{Symbol}\P{ASCII}]/;
} elsif ($name eq 'CHARNAME_CONT') {;
- $re = qr/\p{_Perl_Charname_Continue}/,
+ $re = qr/[-\p{XPosixWord} ():\xa0]/;
} elsif ($name eq 'SPACE') {;
$re = qr/\p{XPerlSpace}/;
} elsif ($name eq 'IDFIRST') {
--
2.49.1
From 66aada8c22c0005e8d76a71589a3218b8cb16d19 Mon Sep 17 00:00:00 2001
From: Samuel Tyler <fosslinux@aussies.space>
Date: Thu, 21 Aug 2025 19:37:33 +1000
Subject: [PATCH 3/4] Revert "regen/mk_PL_charclass.pl: Add bit for if
character folds"
This reverts commit f79937459278f854cb4aa2d3b88400156a7a51ca.
---
regen/mk_PL_charclass.pl | 3 ---
1 file changed, 3 deletions(-)
diff --git perl-5.18.4/regen/mk_PL_charclass.pl perl-5.18.4/regen/mk_PL_charclass.pl
index c944f10a87..51c13766e3 100644
--- perl-5.18.4/regen/mk_PL_charclass.pl
+++ perl-5.18.4/regen/mk_PL_charclass.pl
@@ -43,7 +43,6 @@ my @properties = qw(
WORDCHAR
XDIGIT
VERTSPACE
- IS_IN_SOME_FOLD
BACKSLASH_FOO_LBRACE_IS_META
);
@@ -200,8 +199,6 @@ for my $ord (0..255) {
$re = qr/\p{Is_Non_Latin1_Fold}/;
} elsif ($name eq 'NON_FINAL_FOLD') {
$re = qr/\p{Is_Non_Final_Fold}/;
- } elsif ($name eq 'IS_IN_SOME_FOLD') {
- $re = qr/\p{_Perl_Any_Folds}/;
} elsif ($name eq 'BACKSLASH_FOO_LBRACE_IS_META') {
# This is true for FOO where FOO is the varying character in:
--
2.49.1

View file

@ -0,0 +1,11 @@
--- 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 @@
sed -e 's/(yyn = yydefred\[yystate\])/((yyn = yydefred[yystate]))/' \
-e 's/(yys = getenv("YYDEBUG"))/((yys = getenv("YYDEBUG")))/' \
-e 's/^yyerrlab://' \
- -e 's/^ goto yyerrlab;//' \
+ -e 's/^ *goto yyerrlab;//' \
-e 's/^yynewerror://' \
-e 's/^ goto yynewerror;//' \
-e 's|^static char yysccsid\(.*\)|/* static char yysccsid\1 */|' \

View file

@ -0,0 +1,17 @@
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

View file

@ -0,0 +1,2 @@
https://www.cpan.org/src/5.0/perl-5.18.4.tar.bz2 1fb4d27b75cd244e849f253320260efe1750641aaff4a18ce0d67556ff1b96a5
git://github.com/Perl/metaconfig~79b14e84d83fb88c2b1a07e0dec3b62ccb9a388c https://github.com/Perl/metaconfig/archive/79b14e84d83fb88c2b1a07e0dec3b62ccb9a388c.tar.gz 857e295a3e3ff3121339b348fd295e03459ce8dc3a382870e94f98c2da99a573