2024-02-09 07:30:28 +00:00
|
|
|
FROM scratch as base
|
|
|
|
ENV VERSION=5.38.0
|
2023-11-16 10:01:19 +00:00
|
|
|
ENV SRC_HASH=eca551caec3bc549a4e590c0015003790bdd1a604ffe19cc78ee631d51f7072e
|
2024-02-09 07:30:28 +00:00
|
|
|
ENV SRC_FILE=perl-${VERSION}.tar.xz
|
|
|
|
ENV SRC_SITE=https://www.cpan.org/src/5.0/${SRC_FILE}
|
2024-02-10 12:09:13 +00:00
|
|
|
ENV SOURCE_DATE_EPOCH=1
|
2023-12-16 23:50:40 +00:00
|
|
|
|
|
|
|
FROM base as fetch
|
2024-02-09 07:30:28 +00:00
|
|
|
ADD --checksum=sha256:${SRC_HASH} ${SRC_SITE} .
|
2023-12-16 23:50:40 +00:00
|
|
|
|
|
|
|
FROM fetch as build
|
2024-02-15 15:22:38 +00:00
|
|
|
COPY --from=stagex/busybox . /
|
|
|
|
COPY --from=stagex/gcc . /
|
|
|
|
COPY --from=stagex/binutils . /
|
|
|
|
COPY --from=stagex/make . /
|
|
|
|
COPY --from=stagex/musl . /
|
2024-02-09 07:30:28 +00:00
|
|
|
RUN tar -xf ${SRC_FILE}
|
|
|
|
WORKDIR perl-${VERSION}
|
|
|
|
RUN --network=none <<-EOF
|
|
|
|
set -eux
|
|
|
|
printf '
|
|
|
|
osvers="gnulinux"
|
|
|
|
myuname="dummy_uname"
|
|
|
|
myhostname="builder"
|
|
|
|
cf_by="builder"
|
|
|
|
cf_time="0"
|
|
|
|
' > config.over
|
2024-02-10 12:09:13 +00:00
|
|
|
cat config.over
|
2023-11-16 10:01:19 +00:00
|
|
|
./Configure \
|
2024-02-09 07:30:28 +00:00
|
|
|
-des \
|
2023-11-16 10:01:19 +00:00
|
|
|
-Dcccdlflags='-fPIC' \
|
|
|
|
-Dccdlflags='-rdynamic' \
|
|
|
|
-Dprefix=/usr \
|
|
|
|
-Dvendorprefix=/usr \
|
|
|
|
-Dvendorlib=/usr/share/perl5/vendor_perl \
|
|
|
|
-Dvendorarch=/usr/lib/perl5/vendor_perl \
|
|
|
|
-Dsiteprefix=/usr/local \
|
|
|
|
-Dsitelib=/usr/local/share/perl5/site_perl \
|
|
|
|
-Dsitearch=/usr/local/lib/perl5/site_perl \
|
|
|
|
-Dlocincpth=' ' \
|
|
|
|
-Duselargefiles \
|
|
|
|
-Dusethreads \
|
|
|
|
-Duseshrplib \
|
2024-02-09 07:30:28 +00:00
|
|
|
-Dcc=gcc \
|
2023-11-16 10:01:19 +00:00
|
|
|
-Dd_semctl_semun \
|
|
|
|
-Dman1dir=/usr/share/man/man1 \
|
|
|
|
-Dman3dir=/usr/share/man/man3 \
|
|
|
|
-Dinstallman1dir=/usr/share/man/man1 \
|
|
|
|
-Dinstallman3dir=/usr/share/man/man3 \
|
|
|
|
-Dman1ext='1' \
|
|
|
|
-Dman3ext='3pm' \
|
|
|
|
-Ud_csh \
|
|
|
|
-Ud_fpos64_t \
|
|
|
|
-Ud_off64_t \
|
2024-02-09 07:30:28 +00:00
|
|
|
-Dusenm
|
|
|
|
make
|
|
|
|
EOF
|
2023-12-16 23:50:40 +00:00
|
|
|
|
|
|
|
FROM build as install
|
2024-02-09 07:30:28 +00:00
|
|
|
RUN --network=none make DESTDIR=/rootfs install
|
2024-02-09 18:19:36 +00:00
|
|
|
RUN find /rootfs -exec touch -hcd "@0" "{}" +
|
2024-02-09 07:30:28 +00:00
|
|
|
|
|
|
|
FROM scratch as test
|
2024-03-01 18:30:23 +00:00
|
|
|
COPY --from=install /rootfs/. /
|
2024-02-15 15:22:38 +00:00
|
|
|
COPY --from=stagex/musl . /
|
2024-02-09 07:30:28 +00:00
|
|
|
COPY <<-EOF test.pl
|
|
|
|
use strict;
|
|
|
|
use warnings;
|
|
|
|
print("Success\n");
|
|
|
|
EOF
|
|
|
|
RUN perl test.pl | grep "Success"
|
2023-11-16 10:01:19 +00:00
|
|
|
|
2024-03-01 18:30:23 +00:00
|
|
|
FROM stagex/filesystem as package
|
|
|
|
COPY --from=install /rootfs/. /
|