rename perl5 to perl and properly acquire
perltidy
This commit is contained in:
parent
9ce9003fb7
commit
dcf86ae013
1 changed files with 34 additions and 27 deletions
|
@ -6,24 +6,35 @@ FROM localhost/notwa-util AS downloader
|
|||
ARG PERL_COMMIT=154c25ba29a115544bdfe0983c0c938993c00959
|
||||
ARG PERL_SHA256=9980e388a0b08c0f5830aa9f63cdb3da8d11e460f637bf4622e22c6e8710eff8
|
||||
|
||||
ARG PERLTIDY_VERSION=20220613
|
||||
ARG PERLTIDY_SHA256=50496a6952904ef28f495919fc0a67801a63c87779c61308ce1ca5b32467c5d4
|
||||
|
||||
RUN --mount=type=cache,id=common,target=/media/common,sharing=locked \
|
||||
--mount=type=tmpfs,target=/tmp : \
|
||||
&& cd /media/common \
|
||||
&& name=perl5 \
|
||||
&& name=perl \
|
||||
&& export remote_fn="$PERL_COMMIT.tar.gz" \
|
||||
&& export local_fn="$name-$remote_fn" \
|
||||
&& export remote_url="https://github.com/G4Vi/$name/archive/$remote_fn" \
|
||||
&& export remote_url="https://github.com/G4Vi/perl5/archive/$remote_fn" \
|
||||
&& export dest=/$name \
|
||||
&& export sha256="$PERL_SHA256" \
|
||||
&& acquire \
|
||||
\
|
||||
&& name=perltidy \
|
||||
&& export remote_fn="Perl-Tidy-$PERLTIDY_VERSION.tar.gz" \
|
||||
&& export local_fn="$name-$PERLTIDY_VERSION.tar.gz" \
|
||||
&& export remote_url="https://cpan.metacpan.org/authors/id/S/SH/SHANCOCK/$remote_fn" \
|
||||
&& export dest=/$name \
|
||||
&& export sha256="$PERLTIDY_SHA256" \
|
||||
&& acquire \
|
||||
;
|
||||
|
||||
FROM localhost/cosmo AS builder
|
||||
COPY --from=downloader /perl5 /perl5
|
||||
|
||||
# TODO: this shouldn't be necessary!
|
||||
RUN apk add --no-cache make
|
||||
|
||||
COPY --from=downloader /perl /perl
|
||||
RUN : \
|
||||
&& cd cosmopolitan \
|
||||
&& . ./env \
|
||||
|
@ -71,13 +82,13 @@ RUN : \
|
|||
&& sed -i '/sock\/sock.h/a\\#include "libc/sock/struct/pollfd.h"' cosmopolitan/libc/isystem/poll.h \
|
||||
&& sed -i '/sock\/sock.h/a\\#include "libc/sock/struct/pollfd.h"' cosmopolitan/libc/isystem/sys/poll.h \
|
||||
&& sed -i '/calls\/weirdtypes.h/a\\#include "libc/runtime/sysconf.h"' cosmopolitan/libc/isystem/unistd.h \
|
||||
&& sed -i '/x86_64-linux-musl/d' perl5/hints/cosmo.sh \
|
||||
&& sed -i '/Which of these apply/c\\dflt=cosmo' perl5/Configure \
|
||||
&& sed -i 's/.*-musl-objcopy/\tobjcopy/g' perl5/Makefile.SH \
|
||||
&& sed -i 's/cp \([^ ]\+\)/chmod +x \1 \&\& cp \1/g' perl5/Makefile.SH \
|
||||
&& sed -i '/x86_64-linux-musl/d' perl/hints/cosmo.sh \
|
||||
&& sed -i '/Which of these apply/c\\dflt=cosmo' perl/Configure \
|
||||
&& sed -i 's/.*-musl-objcopy/\tobjcopy/g' perl/Makefile.SH \
|
||||
&& sed -i 's/cp \([^ ]\+\)/chmod +x \1 \&\& cp \1/g' perl/Makefile.SH \
|
||||
;
|
||||
|
||||
WORKDIR perl5
|
||||
WORKDIR perl
|
||||
|
||||
RUN : \
|
||||
&& COSMO_MODE="" COSMO_REPO="/cosmopolitan" sh Configure -d -e \
|
||||
|
@ -96,13 +107,13 @@ RUN make -j2
|
|||
RUN make -j2 minitest devtty=/dev/zero | tee minitest_results.txt
|
||||
|
||||
RUN : \
|
||||
&& mkdir "/perl5/cosmo/o" \
|
||||
&& mkdir "/perl5/cosmo/o/tmp" \
|
||||
&& cp "/perl5/perl.com" "/perl5/cosmo/o/tmp/perl.com" \
|
||||
&& make "DESTDIR=/perl5/cosmo/o/tmp" install.perl \
|
||||
&& mkdir "/perl/cosmo/o" \
|
||||
&& mkdir "/perl/cosmo/o/tmp" \
|
||||
&& cp "/perl/perl.com" "/perl/cosmo/o/tmp/perl.com" \
|
||||
&& make "DESTDIR=/perl/cosmo/o/tmp" install.perl \
|
||||
;
|
||||
RUN : \
|
||||
&& cd "/perl5/cosmo/o/tmp/zip" \
|
||||
&& cd "/perl/cosmo/o/tmp/zip" \
|
||||
&& rm "bin/perl" "bin/perl5.36.0" \
|
||||
&& find lib -name '*.a' -delete \
|
||||
&& find lib -name '*.h' -delete \
|
||||
|
@ -112,23 +123,19 @@ RUN : \
|
|||
&& zip -qr "../perl.com" "lib" \
|
||||
&& mv "../perl.com" "../../perl.com" \
|
||||
;
|
||||
COPY --from=downloader /perltidy /perltidy
|
||||
RUN : \
|
||||
&& version=20220613 \
|
||||
&& wget -q "https://cpan.metacpan.org/authors/id/S/SH/SHANCOCK/Perl-Tidy-$version.tar.gz" -O "Perl-Tidy-$version.tar.gz" \
|
||||
&& tar zxf "Perl-Tidy-$version.tar.gz" \
|
||||
&& cd "Perl-Tidy-$version" \
|
||||
&& ../cosmo/o/perl.com pm2pl \
|
||||
&& mv "perltidy-$version.pl" ../perltidy.pl \
|
||||
&& cd .. \
|
||||
&& rm -r Perl-Tidy-$version \
|
||||
&& cd "/perl5/cosmo/o/tmp/zip" \
|
||||
&& cd "/perltidy" \
|
||||
&& /perl/cosmo/o/perl.com pm2pl \
|
||||
&& mv "perltidy-$version.pl" /perl/perltidy.pl \
|
||||
&& cd "/perl/cosmo/o/tmp/zip" \
|
||||
&& find -type f -name '*.pm' -exec \
|
||||
/cosmopolitan/o/ape/ape.elf ../../perl.com /perl5/perltidy.pl \
|
||||
/cosmopolitan/o/ape/ape.elf ../../perl.com /perl/perltidy.pl \
|
||||
--mangle --delete-all-comments --backup-and-modify-in-place --backup-file-extension=/ {} \
|
||||
+ \
|
||||
;
|
||||
RUN : \
|
||||
&& cd "/perl5/cosmo/o/tmp/zip" \
|
||||
&& cd "/perl/cosmo/o/tmp/zip" \
|
||||
&& cp "../perl.com.bak" "../perl.com" \
|
||||
&& chmod u+w "../perl.com" \
|
||||
&& zip -qr "../perl.com" "bin" \
|
||||
|
@ -139,7 +146,7 @@ RUN : \
|
|||
FROM scratch AS runner
|
||||
COPY --chmod=0755 --from=localhost/notwa-util /usr/local/bin/busybox /bin/busybox
|
||||
COPY --chmod=0755 --from=builder /cosmopolitan/bin/ape /bin/ape
|
||||
COPY --chmod=0755 --from=builder /perl5/cosmo/o/perl.com /bin/perl.com
|
||||
COPY --chmod=0755 --from=builder /perl5/perl.elf /bin/perl.com.dbg
|
||||
COPY --from=builder /perl5/minitest_results.txt /minitest_results.txt
|
||||
COPY --chmod=0755 --from=builder /perl/cosmo/o/perl.com /bin/perl.com
|
||||
COPY --chmod=0755 --from=builder /perl/perl.elf /bin/perl.com.dbg
|
||||
COPY --from=builder /perl/minitest_results.txt /minitest_results.txt
|
||||
ENTRYPOINT ["/bin/ape", "/bin/perl.com"]
|
||||
|
|
Loading…
Add table
Reference in a new issue