Skip to content

Commit 74674b2

Browse files
committed
⚙️ Generate Dockerfiles and patches for 5.28.3/5.30.3
Skipping previous version for now due to bingos/devel-patchperl#44
1 parent 460f948 commit 74674b2

File tree

32 files changed

+2120
-0
lines changed

32 files changed

+2120
-0
lines changed
Lines changed: 169 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,169 @@
1+
diff --git a/Configure b/Configure
2+
index f99377e..e020242 100755
3+
--- a/Configure
4+
+++ b/Configure
5+
@@ -4689,7 +4689,7 @@ else
6+
fi
7+
$rm -f try try.*
8+
case "$gccversion" in
9+
-1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
10+
+1.*) cpp=`./loc gcc-cpp $cpp $pth` ;;
11+
esac
12+
case "$gccversion" in
13+
'') gccosandvers='' ;;
14+
@@ -4729,7 +4729,7 @@ esac
15+
# gcc 3.* complain about adding -Idirectories that they already know about,
16+
# so we will take those off from locincpth.
17+
case "$gccversion" in
18+
-3*)
19+
+3.*)
20+
echo "main(){}">try.c
21+
for incdir in $locincpth; do
22+
warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
23+
@@ -5455,13 +5455,13 @@ fi
24+
case "$hint" in
25+
default|recommended)
26+
case "$gccversion" in
27+
- 1*) dflt="$dflt -fpcc-struct-return" ;;
28+
+ 1.*) dflt="$dflt -fpcc-struct-return" ;;
29+
esac
30+
case "$optimize:$DEBUGGING" in
31+
*-g*:old) dflt="$dflt -DDEBUGGING";;
32+
esac
33+
case "$gccversion" in
34+
- 2*) if $test -d /etc/conf/kconfig.d &&
35+
+ 2.*) if $test -d /etc/conf/kconfig.d &&
36+
$contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
37+
then
38+
# Interactive Systems (ISC) POSIX mode.
39+
@@ -5470,7 +5470,7 @@ default|recommended)
40+
;;
41+
esac
42+
case "$gccversion" in
43+
- 1*) ;;
44+
+ 1.*) ;;
45+
2.[0-8]*) ;;
46+
?*) set strict-aliasing -fno-strict-aliasing
47+
eval $checkccflag
48+
@@ -5588,7 +5588,7 @@ case "$cppflags" in
49+
;;
50+
esac
51+
case "$gccversion" in
52+
-1*) cppflags="$cppflags -D__GNUC__"
53+
+1.*) cppflags="$cppflags -D__GNUC__"
54+
esac
55+
case "$mips_type" in
56+
'');;
57+
@@ -23026,7 +23026,7 @@ fi
58+
59+
: add -D_FORTIFY_SOURCE if feasible and not already there
60+
case "$gccversion" in
61+
-[4567].*) case "$optimize$ccflags" in
62+
+[456789].*|[1-9][0-9]*) case "$optimize$ccflags" in
63+
*-O*) case "$ccflags$cppsymbols" in
64+
*_FORTIFY_SOURCE=*) # Don't add it again.
65+
echo "You seem to have -D_FORTIFY_SOURCE already, not adding it." >&4
66+
diff --git a/cpan/Time-Local/t/Local.t b/cpan/Time-Local/t/Local.t
67+
index 6341396..701d22d 100644
68+
--- a/cpan/Time-Local/t/Local.t
69+
+++ b/cpan/Time-Local/t/Local.t
70+
@@ -85,19 +85,17 @@ my $epoch_is_64
71+
72+
for ( @time, @neg_time ) {
73+
my ( $year, $mon, $mday, $hour, $min, $sec ) = @$_;
74+
- $year -= 1900;
75+
$mon--;
76+
77+
SKIP: {
78+
skip '1970 test on VOS fails.', 12
79+
- if $^O eq 'vos' && $year == 70;
80+
+ if $^O eq 'vos' && $year == 1970;
81+
skip 'this platform does not support negative epochs.', 12
82+
- if $year < 70 && !$neg_epoch_ok;
83+
+ if $year < 1970 && !$neg_epoch_ok;
84+
85+
# Test timelocal()
86+
{
87+
- my $year_in = $year < 70 ? $year + 1900 : $year;
88+
- my $time = timelocal( $sec, $min, $hour, $mday, $mon, $year_in );
89+
+ my $time = timelocal( $sec, $min, $hour, $mday, $mon, $year );
90+
91+
my ( $s, $m, $h, $D, $M, $Y ) = localtime($time);
92+
93+
@@ -106,13 +104,12 @@ SKIP: {
94+
is( $h, $hour, "timelocal hour for @$_" );
95+
is( $D, $mday, "timelocal day for @$_" );
96+
is( $M, $mon, "timelocal month for @$_" );
97+
- is( $Y, $year, "timelocal year for @$_" );
98+
+ is( $Y, $year - 1900, "timelocal year for @$_" );
99+
}
100+
101+
# Test timegm()
102+
{
103+
- my $year_in = $year < 70 ? $year + 1900 : $year;
104+
- my $time = timegm( $sec, $min, $hour, $mday, $mon, $year_in );
105+
+ my $time = timegm( $sec, $min, $hour, $mday, $mon, $year );
106+
107+
my ( $s, $m, $h, $D, $M, $Y ) = gmtime($time);
108+
109+
@@ -121,14 +118,13 @@ SKIP: {
110+
is( $h, $hour, "timegm hour for @$_" );
111+
is( $D, $mday, "timegm day for @$_" );
112+
is( $M, $mon, "timegm month for @$_" );
113+
- is( $Y, $year, "timegm year for @$_" );
114+
+ is( $Y, $year - 1900, "timegm year for @$_" );
115+
}
116+
}
117+
}
118+
119+
for (@bad_time) {
120+
my ( $year, $mon, $mday, $hour, $min, $sec ) = @$_;
121+
- $year -= 1900;
122+
$mon--;
123+
124+
eval { timegm( $sec, $min, $hour, $mday, $mon, $year ) };
125+
@@ -229,6 +225,30 @@ SKIP:
126+
);
127+
}
128+
129+
+# 2-digit years
130+
+{
131+
+ my $current_year = ( localtime() )[5];
132+
+ my $pre_break = ( $current_year + 49 ) - 100;
133+
+ my $break = ( $current_year + 50 ) - 100;
134+
+ my $post_break = ( $current_year + 51 ) - 100;
135+
+
136+
+ is(
137+
+ ( ( localtime( timelocal( 0, 0, 0, 1, 1, $pre_break ) ) )[5] ),
138+
+ $pre_break + 100,
139+
+ "year $pre_break is treated as next century",
140+
+ );
141+
+ is(
142+
+ ( ( localtime( timelocal( 0, 0, 0, 1, 1, $break ) ) )[5] ),
143+
+ $break + 100,
144+
+ "year $break is treated as next century",
145+
+ );
146+
+ is(
147+
+ ( ( localtime( timelocal( 0, 0, 0, 1, 1, $post_break ) ) )[5] ),
148+
+ $post_break,
149+
+ "year $post_break is treated as current century",
150+
+ );
151+
+}
152+
+
153+
SKIP:
154+
{
155+
skip 'These tests only run for the package maintainer.', 8
156+
diff --git a/hints/linux.sh b/hints/linux.sh
157+
index a985a8e..8cbe7dc 100644
158+
--- a/hints/linux.sh
159+
+++ b/hints/linux.sh
160+
@@ -165,6 +165,9 @@ esac
161+
# plibpth to bypass this check.
162+
if [ -x /usr/bin/gcc ] ; then
163+
gcc=/usr/bin/gcc
164+
+# clang also provides -print-search-dirs
165+
+elif ${cc:-cc} --version 2>/dev/null | grep -q '^clang ' ; then
166+
+ gcc=${cc:-cc}
167+
else
168+
gcc=gcc
169+
fi
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
FROM buildpack-deps:buster
2+
LABEL maintainer="Peter Martini <PeterCMartini@GMail.com>, Zak B. Elep <zakame@cpan.org>"
3+
4+
COPY *.patch /usr/src/perl/
5+
WORKDIR /usr/src/perl
6+
7+
RUN true \
8+
&& curl -SL https://www.cpan.org/src/5.0/perl-5.28.3.tar.xz -o perl-5.28.3.tar.xz \
9+
&& echo '77dc1ddf541643af14d585867d3d0741cce45d0dbe8f1467024e63165d9e2fc5 *perl-5.28.3.tar.xz' | sha256sum -c - \
10+
&& tar --strip-components=1 -xaf perl-5.28.3.tar.xz -C /usr/src/perl \
11+
&& rm perl-5.28.3.tar.xz \
12+
&& cat *.patch | patch -p1 \
13+
&& gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \
14+
&& archBits="$(dpkg-architecture --query DEB_BUILD_ARCH_BITS)" \
15+
&& archFlag="$([ "$archBits" = '64' ] && echo '-Duse64bitall' || echo '-Duse64bitint')" \
16+
&& ./Configure -Darchname="$gnuArch" "$archFlag" -Dusethreads -Duseshrplib -Dvendorprefix=/usr/local -des \
17+
&& make -j$(nproc) \
18+
&& TEST_JOBS=$(nproc) make test_harness \
19+
&& make install \
20+
&& cd /usr/src \
21+
&& curl -LO https://www.cpan.org/authors/id/M/MI/MIYAGAWA/App-cpanminus-1.7044.tar.gz \
22+
&& echo '9b60767fe40752ef7a9d3f13f19060a63389a5c23acc3e9827e19b75500f81f3 *App-cpanminus-1.7044.tar.gz' | sha256sum -c - \
23+
&& tar -xzf App-cpanminus-1.7044.tar.gz && cd App-cpanminus-1.7044 && perl bin/cpanm . && cd /root \
24+
&& true \
25+
&& rm -fr ./cpanm /root/.cpanm /usr/src/perl /usr/src/App-cpanminus-1.7044* /tmp/*
26+
27+
WORKDIR /
28+
29+
CMD ["perl5.28.3","-de0"]
Lines changed: 169 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,169 @@
1+
diff --git a/Configure b/Configure
2+
index f99377e..e020242 100755
3+
--- a/Configure
4+
+++ b/Configure
5+
@@ -4689,7 +4689,7 @@ else
6+
fi
7+
$rm -f try try.*
8+
case "$gccversion" in
9+
-1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
10+
+1.*) cpp=`./loc gcc-cpp $cpp $pth` ;;
11+
esac
12+
case "$gccversion" in
13+
'') gccosandvers='' ;;
14+
@@ -4729,7 +4729,7 @@ esac
15+
# gcc 3.* complain about adding -Idirectories that they already know about,
16+
# so we will take those off from locincpth.
17+
case "$gccversion" in
18+
-3*)
19+
+3.*)
20+
echo "main(){}">try.c
21+
for incdir in $locincpth; do
22+
warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
23+
@@ -5455,13 +5455,13 @@ fi
24+
case "$hint" in
25+
default|recommended)
26+
case "$gccversion" in
27+
- 1*) dflt="$dflt -fpcc-struct-return" ;;
28+
+ 1.*) dflt="$dflt -fpcc-struct-return" ;;
29+
esac
30+
case "$optimize:$DEBUGGING" in
31+
*-g*:old) dflt="$dflt -DDEBUGGING";;
32+
esac
33+
case "$gccversion" in
34+
- 2*) if $test -d /etc/conf/kconfig.d &&
35+
+ 2.*) if $test -d /etc/conf/kconfig.d &&
36+
$contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
37+
then
38+
# Interactive Systems (ISC) POSIX mode.
39+
@@ -5470,7 +5470,7 @@ default|recommended)
40+
;;
41+
esac
42+
case "$gccversion" in
43+
- 1*) ;;
44+
+ 1.*) ;;
45+
2.[0-8]*) ;;
46+
?*) set strict-aliasing -fno-strict-aliasing
47+
eval $checkccflag
48+
@@ -5588,7 +5588,7 @@ case "$cppflags" in
49+
;;
50+
esac
51+
case "$gccversion" in
52+
-1*) cppflags="$cppflags -D__GNUC__"
53+
+1.*) cppflags="$cppflags -D__GNUC__"
54+
esac
55+
case "$mips_type" in
56+
'');;
57+
@@ -23026,7 +23026,7 @@ fi
58+
59+
: add -D_FORTIFY_SOURCE if feasible and not already there
60+
case "$gccversion" in
61+
-[4567].*) case "$optimize$ccflags" in
62+
+[456789].*|[1-9][0-9]*) case "$optimize$ccflags" in
63+
*-O*) case "$ccflags$cppsymbols" in
64+
*_FORTIFY_SOURCE=*) # Don't add it again.
65+
echo "You seem to have -D_FORTIFY_SOURCE already, not adding it." >&4
66+
diff --git a/cpan/Time-Local/t/Local.t b/cpan/Time-Local/t/Local.t
67+
index 6341396..701d22d 100644
68+
--- a/cpan/Time-Local/t/Local.t
69+
+++ b/cpan/Time-Local/t/Local.t
70+
@@ -85,19 +85,17 @@ my $epoch_is_64
71+
72+
for ( @time, @neg_time ) {
73+
my ( $year, $mon, $mday, $hour, $min, $sec ) = @$_;
74+
- $year -= 1900;
75+
$mon--;
76+
77+
SKIP: {
78+
skip '1970 test on VOS fails.', 12
79+
- if $^O eq 'vos' && $year == 70;
80+
+ if $^O eq 'vos' && $year == 1970;
81+
skip 'this platform does not support negative epochs.', 12
82+
- if $year < 70 && !$neg_epoch_ok;
83+
+ if $year < 1970 && !$neg_epoch_ok;
84+
85+
# Test timelocal()
86+
{
87+
- my $year_in = $year < 70 ? $year + 1900 : $year;
88+
- my $time = timelocal( $sec, $min, $hour, $mday, $mon, $year_in );
89+
+ my $time = timelocal( $sec, $min, $hour, $mday, $mon, $year );
90+
91+
my ( $s, $m, $h, $D, $M, $Y ) = localtime($time);
92+
93+
@@ -106,13 +104,12 @@ SKIP: {
94+
is( $h, $hour, "timelocal hour for @$_" );
95+
is( $D, $mday, "timelocal day for @$_" );
96+
is( $M, $mon, "timelocal month for @$_" );
97+
- is( $Y, $year, "timelocal year for @$_" );
98+
+ is( $Y, $year - 1900, "timelocal year for @$_" );
99+
}
100+
101+
# Test timegm()
102+
{
103+
- my $year_in = $year < 70 ? $year + 1900 : $year;
104+
- my $time = timegm( $sec, $min, $hour, $mday, $mon, $year_in );
105+
+ my $time = timegm( $sec, $min, $hour, $mday, $mon, $year );
106+
107+
my ( $s, $m, $h, $D, $M, $Y ) = gmtime($time);
108+
109+
@@ -121,14 +118,13 @@ SKIP: {
110+
is( $h, $hour, "timegm hour for @$_" );
111+
is( $D, $mday, "timegm day for @$_" );
112+
is( $M, $mon, "timegm month for @$_" );
113+
- is( $Y, $year, "timegm year for @$_" );
114+
+ is( $Y, $year - 1900, "timegm year for @$_" );
115+
}
116+
}
117+
}
118+
119+
for (@bad_time) {
120+
my ( $year, $mon, $mday, $hour, $min, $sec ) = @$_;
121+
- $year -= 1900;
122+
$mon--;
123+
124+
eval { timegm( $sec, $min, $hour, $mday, $mon, $year ) };
125+
@@ -229,6 +225,30 @@ SKIP:
126+
);
127+
}
128+
129+
+# 2-digit years
130+
+{
131+
+ my $current_year = ( localtime() )[5];
132+
+ my $pre_break = ( $current_year + 49 ) - 100;
133+
+ my $break = ( $current_year + 50 ) - 100;
134+
+ my $post_break = ( $current_year + 51 ) - 100;
135+
+
136+
+ is(
137+
+ ( ( localtime( timelocal( 0, 0, 0, 1, 1, $pre_break ) ) )[5] ),
138+
+ $pre_break + 100,
139+
+ "year $pre_break is treated as next century",
140+
+ );
141+
+ is(
142+
+ ( ( localtime( timelocal( 0, 0, 0, 1, 1, $break ) ) )[5] ),
143+
+ $break + 100,
144+
+ "year $break is treated as next century",
145+
+ );
146+
+ is(
147+
+ ( ( localtime( timelocal( 0, 0, 0, 1, 1, $post_break ) ) )[5] ),
148+
+ $post_break,
149+
+ "year $post_break is treated as current century",
150+
+ );
151+
+}
152+
+
153+
SKIP:
154+
{
155+
skip 'These tests only run for the package maintainer.', 8
156+
diff --git a/hints/linux.sh b/hints/linux.sh
157+
index a985a8e..8cbe7dc 100644
158+
--- a/hints/linux.sh
159+
+++ b/hints/linux.sh
160+
@@ -165,6 +165,9 @@ esac
161+
# plibpth to bypass this check.
162+
if [ -x /usr/bin/gcc ] ; then
163+
gcc=/usr/bin/gcc
164+
+# clang also provides -print-search-dirs
165+
+elif ${cc:-cc} --version 2>/dev/null | grep -q '^clang ' ; then
166+
+ gcc=${cc:-cc}
167+
else
168+
gcc=gcc
169+
fi
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
FROM buildpack-deps:stretch
2+
LABEL maintainer="Peter Martini <PeterCMartini@GMail.com>, Zak B. Elep <zakame@cpan.org>"
3+
4+
COPY *.patch /usr/src/perl/
5+
WORKDIR /usr/src/perl
6+
7+
RUN true \
8+
&& curl -SL https://www.cpan.org/src/5.0/perl-5.28.3.tar.xz -o perl-5.28.3.tar.xz \
9+
&& echo '77dc1ddf541643af14d585867d3d0741cce45d0dbe8f1467024e63165d9e2fc5 *perl-5.28.3.tar.xz' | sha256sum -c - \
10+
&& tar --strip-components=1 -xaf perl-5.28.3.tar.xz -C /usr/src/perl \
11+
&& rm perl-5.28.3.tar.xz \
12+
&& cat *.patch | patch -p1 \
13+
&& gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \
14+
&& archBits="$(dpkg-architecture --query DEB_BUILD_ARCH_BITS)" \
15+
&& archFlag="$([ "$archBits" = '64' ] && echo '-Duse64bitall' || echo '-Duse64bitint')" \
16+
&& ./Configure -Darchname="$gnuArch" "$archFlag" -Dusethreads -Duseshrplib -Dvendorprefix=/usr/local -des \
17+
&& make -j$(nproc) \
18+
&& TEST_JOBS=$(nproc) make test_harness \
19+
&& make install \
20+
&& cd /usr/src \
21+
&& curl -LO https://www.cpan.org/authors/id/M/MI/MIYAGAWA/App-cpanminus-1.7044.tar.gz \
22+
&& echo '9b60767fe40752ef7a9d3f13f19060a63389a5c23acc3e9827e19b75500f81f3 *App-cpanminus-1.7044.tar.gz' | sha256sum -c - \
23+
&& tar -xzf App-cpanminus-1.7044.tar.gz && cd App-cpanminus-1.7044 && perl bin/cpanm . && cd /root \
24+
&& true \
25+
&& rm -fr ./cpanm /root/.cpanm /usr/src/perl /usr/src/App-cpanminus-1.7044* /tmp/*
26+
27+
WORKDIR /
28+
29+
CMD ["perl5.28.3","-de0"]

0 commit comments

Comments
 (0)