From 90fded9f74593b91e936fc97e9cbcf0244b2d93b Mon Sep 17 00:00:00 2001 From: Neil McPhail Date: Tue, 29 Apr 2025 09:11:57 +0000 Subject: [PATCH] reinstate z88dk by building ourselves --- .devcontainer/Dockerfile | 60 ++++++++++++++++++++++++++++----- .devcontainer/devcontainer.json | 4 ++- README.md | 4 +-- 3 files changed, 57 insertions(+), 11 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index f1bdf8e..01917a8 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,7 +1,5 @@ # syntax=docker/dockerfile:1 -#FROM z88dk/z88dk:latest AS z88dk - FROM ubuntu:24.04 AS build RUN apt-get update \ && apt-get install -y --no-install-recommends \ @@ -20,13 +18,57 @@ RUN cd /zx0/src/ \ ADD https://www.boriel.com/files/zxb/zxbasic-1.18.1-linux64.tar.gz . RUN tar xf zxbasic* +FROM build AS z88dk +RUN apt-get update \ + && apt-get install -y --no-install-recommends \ + bison \ + ca-certificates \ + ccache \ + cpanminus \ + curl \ + dos2unix \ + flex \ + gdb \ + git \ + libboost-all-dev \ + libcapture-tiny-perl \ + libclone-perl \ + libdata-hexdump-perl \ + libfile-slurp-perl \ + libgmp3-dev \ + liblocal-lib-perl \ + libmodern-perl-perl \ + libpath-tiny-perl \ + libregexp-common-perl \ + libtext-table-perl \ + libxml2-dev \ + libyaml-perl \ + m4 \ + perl \ + pkg-config \ + ragel \ + re2c \ + texi2html \ + texinfo \ + zlib1g-dev \ + && rm -rf /var/lib/apt/lists/* +ENV Z88DK_PATH="/opt/z88dk" +RUN cpanm -l $HOME/perl5 --no-wget local::lib Template::Plugin::YAML \ + && git clone --depth 1 --recursive https://github.com/z88dk/z88dk.git ${Z88DK_PATH} \ + && cd ${Z88DK_PATH} \ + && eval "$(perl -I$HOME/perl5/lib/perl5 -Mlocal::lib)" \ + && chmod 777 build.sh \ + && BUILD_SDCC=1 BUILD_SDCC_HTTP=1 ./build.sh \ + && make install-clean bins-clean + FROM ubuntu:24.04 RUN apt-get update \ && apt-get install -y --no-install-recommends \ - fuse-emulator-utils\ + ca-certificates \ + fuse-emulator-utils \ git \ make \ - openssh-client\ + openssh-client \ pasmo \ python3 \ z80asm \ @@ -41,8 +83,10 @@ COPY --from=build /zxbasic/zxbasm.py /opt/zxbasic/zxbasm COPY --from=build /zxbasic/zxbc.py /opt/zxbasic/zxbc COPY --from=build /zxbasic/zxbpp.py /opt/zxbasic/zxbpp COPY --from=build /zxbasic/src /opt/zxbasic/src -#COPY --from=z88dk /opt/z88dk /opt/z88dk +COPY --from=z88dk /opt/z88dk/bin /opt/z88dk/bin +COPY --from=z88dk /opt/z88dk/lib /opt/z88dk/lib +ENV PATH="${PATH}:/opt/z88dk/bin:/opt/zxbasic" +ENV ZCCCFG="/opt/z88dk/lib/config" USER ubuntu -#RUN echo "PATH=$PATH:/opt/z88dk/bin:/opt/zxbasic" >> ~/.profile -#RUN echo "export ZCCCFG=/opt/z88dk/lib/config/" >> ~/.profile -RUN echo "PATH=$PATH:/opt/zxbasic" >> ~/.profile \ No newline at end of file +RUN echo "PATH=$PATH:/opt/z88dk/bin:/opt/zxbasic" >> ~/.profile +RUN echo "export ZCCCFG=/opt/z88dk/lib/config/" >> ~/.profile \ No newline at end of file diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index c24929b..f883daf 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,6 +1,8 @@ { "name": "ZX Spectrum dev tools", - "build": { "dockerfile": "Dockerfile" }, + //"build": { "dockerfile": "Dockerfile" }, + // The Dockerfile takes an age to build due to z88dk, so pull from prebuilt: + "image": "boarstone.mcphail.uk/mcphail/speccydev:latest", "remoteUser": "ubuntu", "runArgs": [ "--network=host" diff --git a/README.md b/README.md index dd57f58..0525b91 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Development tools for the ZX Spectrum -The Dockerfile is the basis of the devcontainer and can be changed to add or remove tools. +The Dockerfile is the basis of the devcontainer and can be changed to add or remove tools. It will take a long time to build locally, so by default the devcontainer will pull a prebuilt version. Edit `.devcontainer/devcontainer.json` if you would rather build your own. The devcontainer contains: - pasmo (assembler) @@ -8,7 +8,7 @@ The devcontainer contains: - z80asm (assembler) - z80dasm (disassembler) - zmakebas (creates BASIC programs) -- ~~z88dk (C compiler and other utilities including assembler)~~ - not currently functional +- z88dk (C compiler and other utilities including assembler) - utilities from the FUSE emulator: - audio2tape - createhdf