Add perl 5.10.1

Used as an intermediate before perl 5.32.
This commit is contained in:
fosslinux 2021-04-12 10:39:18 +10:00
parent d943b37962
commit cd361e63f7
12 changed files with 648 additions and 0 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -66,3 +66,4 @@ de23af78fca90ce32dff2dd45b3432b2334740bb9bb7b05bf60fdbfc396ceb9c tcc-0.9.27.tar
c40385e142989c91989413f3c5a31282b2ffdca16b69cd3ecfde537b8a474921 flex-2.5.33.tar.gz
b10d7e9e354be72aee4e4911cf19dd27b5c527d4e7200857365b5fcdeea0dffb bison-2.3.tar.bz2
0190f28cb155fedd22bf8558c3e8705eed9eacfb7ae29e7508d025a68eb90899 gnulib-b28236b.tar.gz
9385f2c8c2ca8b1dc4a7c31903f1f8dc8f2ba867dc2a9e5c93012ed6b564e826 perl-5.10.1.tar.bz2

View File

@ -645,3 +645,11 @@ bison 2.3
This is an older version of bison required for the bison files in perl 5.10.1.
We backwards-bootstrap this from 3.4.1, using 3.4.1 to compile the bison files
in 2.3. This parser works sufficiently well for perl 5.10.5.
perl 5.10.1
===========
Perl 5.10.1 is an intermediate version used before Perl 5.32. We require this
version as it adds a couple of modules into lib/ required to regenerate files in
Perl 5.32. We still use the Makefile instead of the metaconfig strategy, as
metaconfig history becomes poor more than a few years back.

View File

@ -467,3 +467,6 @@ class SysA:
# bison 2.3
self.get_file(["https://mirrors.kernel.org/gnu/bison/bison-2.3.tar.bz2",
"https://git.savannah.gnu.org/cgit/gnulib.git/snapshot/gnulib-b28236b.tar.gz"])
# perl 5.10.5
self.get_file("https://www.cpan.org/src/5.0/perl-5.10.1.tar.bz2")

View File

@ -0,0 +1 @@
2d311726e861cc74d1e3e0b329f49be20e1b1832f02518bea201a927ec3c4c6c /after/bin/perl

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,20 @@
# SPDX-FileCopyrightText: 2021 Andrius Štikonas <andrius@stikonas.eu>
# SPDX-FileCopyrightText: 2021 fosslinux <fosslinux@aussies.space>
# SPDX-License-Identifier: GPL-3.0-or-later
ar='ar'
cc='gcc'
ldlibpthname='LD_LIBRARY_PATH'
libpth='/after/lib'
path_sep=':'
archname='i386'
osvers=''
byteorder='12345678'
x=''
ivsize='4'
ivtype='long'
lib_ext='.a'
_a='.a'
PERL_CONFIG_SH=true

137
sysa/perl-5.10.1/mk/main.mk Normal file
View File

@ -0,0 +1,137 @@
# SPDX-FileCopyrightText: 2021 fosslinux <fosslinux@aussies.space>
# SPDX-FileCopyrightText: 2021 Andrius Štikonas <andrius@stikonas.eu>
# SPDX-License-Identifier: GPL-3.0-or-later
# Note: This makefile is not currently parallel-safe.
VERSION=5.10.1
PRIVLIB_EXP=$(PREFIX)/lib/perl5/$(VERSION)
CC = gcc
AR = ar
CFLAGS = -DPRIVLIB_EXP=\"$(PRIVLIB_EXP)\" \
-DPERL_CORE=1 \
-I. \
-DVERSION=\"$(VERSION)\" \
-DNO_PPPORT_H
MINICFLAGS = -DPERL_EXTERNAL_GLOB
.PHONY: all
LIBPERL_SRC = av scope op doop doio dump gv hv mg reentr mro perl perly pp \
pp_hot pp_ctl pp_sys regcomp regexec utf8 sv taint toke util \
deb run universal xsutils pad globals perlio perlapi numeric \
mathoms locale pp_pack pp_sort
LIBPERL_OBJ = $(addsuffix .o, $(LIBPERL_SRC))
EXTENSIONS = File/Glob Digest/SHA Data/Dumper Cwd
EXTENSIONS_A := $(foreach f,$(EXTENSIONS), lib/auto/$f/$(notdir $f).a)
EXTENSIONS_PM = ext/File/Glob/Glob.pm ext/Digest/SHA/lib/Digest/SHA.pm \
ext/Data/Dumper/Dumper.pm
all: perl
# miniperl
opmini.c: op.c
cp op.c opmini.c
perlmini.c: perl.c
cp perl.c perlmini.c
generate_uudmap: generate_uudmap.o
$(CC) $(CFLAGS) $^ $(LDFLAGS) -o $@
uudmap.h: generate_uudmap
./generate_uudmap > $@
git_version.h: lib/Config_git.pl
lib/Config_git.pl:
perl make_patchnum.pl
globals.o: uudmap.h
perl.o: git_version.h
perlmini.o: git_version.h
libperl.a: $(LIBPERL_OBJ)
$(AR) cr $@ $^
miniperl: miniperlmain.o opmini.o perlmini.o libperl.a
$(CC) $(CFLAGS) $(MINICFLAGS) $^ $(LDFLAGS) -o $@
# An extremely dodgy hack
sed -i 's/va\.a\.a/v5.8.1/' miniperl
chmod +x miniperl
# full perl
lib/re.pm:
cp ext/re/re.pm lib/re.pm
lib/Config.pm: config.sh miniperl configpm lib/re.pm
./miniperl -Ilib configpm
writemain: writemain.SH
spitshell=cat eunicefix=true ./$<
perlmain.c: writemain $(EXTENSIONS_A)
./writemain $(EXTENSIONS_A) > $@
perl: perlmain.o libperl.a $(EXTENSIONS_A) lib/File/Glob.pm lib/Digest/SHA.pm \
lib/DynaLoader.pm lib/XSLoader.pm lib/Data/Dumper.pm
$(CC) $(CFLAGS) perlmain.o libperl.a $(EXTENSIONS_A) -o $@
# An extremely dodgy hack (v2)
sed -i 's/va\.a\.a/v5.8.1/' perl
chmod +x perl
# extensions
autosplit.pl: lib/re.pm lib/Config.pm miniperl
echo 'use AutoSplit; autosplit_lib_modules(@ARGV)' > $@
ext/DynaLoader/DynaLoader.pm: miniperl lib/Config.pm
./miniperl -Ilib ext/DynaLoader/DynaLoader_pm.PL DynaLoader.pm
mv DynaLoader.pm $@
ext/DynaLoader/XSLoader.pm: miniperl lib/Config.pm
./miniperl -Ilib ext/DynaLoader/XSLoader_pm.PL XSLoader.pm
mv XSLoader.pm $@
lib/DynaLoader.pm: ext/DynaLoader/DynaLoader.pm
install $< $@
lib/XSLoader.pm: ext/DynaLoader/XSLoader.pm
install $< $@
lib/File/Glob.pm: ext/File/Glob/Glob.pm
install $< $@
lib/Digest/SHA.pm: ext/Digest/SHA/lib/Digest/SHA.pm
install $< $@
lib/Data:
mkdir $@
lib/Data/Dumper.pm: ext/Data/Dumper/Dumper.pm lib/Data
install $< $@
define build_rule
lib/auto/$1/$(notdir $1).a: ext/$1/$(notdir $1).o $(patsubst %.c,%.o,$(wildcard ext/$1/*.c)) $(EXTENSIONS_PM)
mkdir -p lib/auto/$1
$(AR) cr lib/auto/$1/$(notdir $1).a ext/$1/$(notdir $1).o $(patsubst %.c,%.o,$(wildcard ext/$1/*.c))
ext/$1/$(notdir $1).c: miniperl lib/Config.pm
cd ext/$1; \
$(CURDIR)/miniperl -I$(CURDIR)/lib Makefile.PL; \
$(CURDIR)/miniperl -I$(CURDIR)/lib $(CURDIR)/lib/ExtUtils/xsubpp -noprototypes -typemap $(CURDIR)/lib/ExtUtils/typemap `echo $(notdir $1) | sed 's/.*-//'`.xs > $(notdir $1).c
endef
$(foreach f,$(EXTENSIONS),$(eval $(call build_rule,$f)))
install: all
install perl "$(DESTDIR)$(PREFIX)/bin/perl"
mkdir -p "$(DESTDIR)$(PRIVLIB_EXP)"
cp -r lib/* "$(DESTDIR)$(PRIVLIB_EXP)"

View File

@ -0,0 +1,124 @@
SPDX-FileCopyrightText: 2021 fosslinux <fosslinux@aussies.space>
SPDX-License-Identifier: Artistic-1.0-Perl
There are a bunch of aliases that perl's build system somehow makes but
I'm not sure how to appropriately do them, so just patch them.
--- lib/ExtUtils/Constant.pm 2021-04-20 21:06:43.272663878 +1000
+++ lib/ExtUtils/Constant.pm 2021-04-20 21:07:11.116805426 +1000
@@ -253,11 +253,11 @@
switch (type) {
case PERL_constant_NOTFOUND:
sv =
- sv_2mortal(newSVpvf("%s is not a valid $package_sprintf_safe macro", s));
+ sv_2mortal(Perl_newSVpvf("%s is not a valid $package_sprintf_safe macro", s));
PUSHs(sv);
break;
case PERL_constant_NOTDEF:
- sv = sv_2mortal(newSVpvf(
+ sv = sv_2mortal(Perl_newSVpvf(
"Your vendor has not defined $package_sprintf_safe macro %s, used",
s));
PUSHs(sv);
@@ -288,7 +288,7 @@
}
$xs .= << "EOT";
default:
- sv = sv_2mortal(newSVpvf(
+ sv = sv_2mortal(Perl_newSVpvf(
"Unexpected return type %d while processing $package_sprintf_safe macro %s, used",
type, s));
PUSHs(sv);
--- ext/Data-Dumper/Dumper.xs 2009-06-11 02:42:23.000000000 +1000
+++ ext/Data-Dumper/Dumper.xs 2021-04-21 18:19:32.548468344 +1000
@@ -312,7 +312,7 @@
{
dSP; ENTER; SAVETMPS; PUSHMARK(sp);
XPUSHs(val); PUTBACK;
- i = perl_call_method(SvPVX_const(freezer), G_EVAL|G_VOID);
+ i = call_method(SvPVX_const(freezer), G_EVAL|G_VOID);
SPAGAIN;
if (SvTRUE(ERRSV))
warn("WARNING(Freezer method call failed): %"SVf"", ERRSV);
@@ -515,7 +515,7 @@
SV * const ixsv = newSViv(0);
/* allowing for a 24 char wide array index */
- New(0, iname, namelen+28, char);
+ Newx(iname, namelen+28, char);
(void)strcpy(iname, name);
inamelen = namelen;
if (name[0] == '@') {
@@ -660,7 +660,7 @@
if (sortkeys != &PL_sv_yes) {
dSP; ENTER; SAVETMPS; PUSHMARK(sp);
XPUSHs(sv_2mortal(newRV_inc(ival))); PUTBACK;
- i = perl_call_sv(sortkeys, G_SCALAR | G_EVAL);
+ i = call_sv(sortkeys, G_SCALAR | G_EVAL);
SPAGAIN;
if (i) {
sv = POPs;
@@ -745,7 +745,7 @@
}
else {
nticks = num_q(key, klen);
- New(0, nkey_buffer, klen+nticks+3, char);
+ Newx(nkey_buffer, klen+nticks+3, char);
nkey = nkey_buffer;
nkey[0] = '\'';
if (nticks)
@@ -772,7 +772,7 @@
char *extra;
I32 elen = 0;
newapad = newSVsv(apad);
- New(0, extra, klen+4+1, char);
+ Newx(extra, klen+4+1, char);
while (elen < (klen+4))
extra[elen++] = ' ';
extra[elen] = '\0';
@@ -829,7 +829,7 @@
char *npack;
char *npack_buffer = NULL;
- New(0, npack_buffer, plen+pticks+1, char);
+ Newx(npack_buffer, plen+pticks+1, char);
npack = npack_buffer;
plen += esc_q(npack, realpack, plen);
npack[plen] = '\0';
@@ -903,7 +903,7 @@
if (len > 10) {
/* Looks like we're on a 64 bit system. Make it a string so that
if a 32 bit system reads the number it will cope better. */
- sv_catpvf(retval, "'%s'", tmpbuf);
+ Perl_sv_catpvf(retval, "'%s'", tmpbuf);
} else
sv_catpvn(retval, tmpbuf, len);
}
@@ -1036,7 +1036,7 @@
if (!SvROK(href)) { /* call new to get an object first */
if (items < 2)
- croak("Usage: Data::Dumper::Dumpxs(PACKAGE, VAL_ARY_REF, [NAME_ARY_REF])");
+ Perl_croak_nocontext("Usage: Data::Dumper::Dumpxs(PACKAGE, VAL_ARY_REF, [NAME_ARY_REF])");
ENTER;
SAVETMPS;
@@ -1047,7 +1047,7 @@
if (items >= 3)
XPUSHs(sv_2mortal(newSVsv(ST(2))));
PUTBACK;
- i = perl_call_method("new", G_SCALAR);
+ i = call_method("new", G_SCALAR);
SPAGAIN;
if (i)
href = newSVsv(POPs);
@@ -1234,7 +1234,7 @@
SvREFCNT_dec(valstr);
}
else
- croak("Call to new() method failed to return HASH ref");
+ Perl_croak_nocontext("Call to new() method failed to return HASH ref");
if (gimme == G_SCALAR)
XPUSHs(sv_2mortal(retval));
}

36
sysa/perl-5.10.1/perl-5.10.1.sh Executable file
View File

@ -0,0 +1,36 @@
# SPDX-FileCopyrightText: 2021 fosslinux <fosslinux@aussies.space>
#
# SPDX-License-Identifier: GPL-3.0-or-later
src_prepare() {
default_src_prepare
# Regenerate bison files
# perly.c looks suspiciously like it is from bison, but is not; from the
# below script:
# Note that perly.c is *not* regenerated - this is now a static file which
# is not dependent on perly.y any more.
perl regen_perly.pl -b bison-2.3
# Remove the source file so make works.
rm perly.y
# Regenerate other prebuilt header files
# Taken from headers of regen scripts
rm lib/warnings.pm warnings.h regnodes.h reentr.h reentr.c overload.h \
overload.c lib/overload/numbers.pm opcode.h opnames.h pp_proto.h \
pp.sym keywords.h embed.h embedvar.h global.sym perlapi.c perlapi.h \
proto.h
perl regen.pl
mkdir -p ext/File ext/Digest ext/Data
mv ext/File-Glob ext/File/Glob
mv ext/Digest-SHA ext/Digest/SHA
mv ext/Data-Dumper ext/Data/Dumper
}
src_install() {
# Remove old perl
rm -rf "${PREFIX}"/lib/perl5/
default
}

View File

@ -38,6 +38,8 @@ build flex-2.5.33
build bison-2.3
build perl-5.10.1
if [ "$FORCE_TIMESTAMPS" = True ] ; then
echo 'Forcing all files timestamps to be 0 unix time.'
canonicalise_all_files_timestamp