From b98925a5b7fc9468c2d034246fbfdbbfa678b8c9 Mon Sep 17 00:00:00 2001 From: Nicolas Boulenguez Date: Sat, 16 Nov 2024 15:23:30 +0100 Subject: [PATCH] basic: build with recent gcc, python and qbasic64 --- impls/basic/Dockerfile | 24 ++++++++++++------------ impls/basic/basicpp.py | 4 ++-- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/impls/basic/Dockerfile b/impls/basic/Dockerfile index 928b1b1c62..0b035b31a6 100644 --- a/impls/basic/Dockerfile +++ b/impls/basic/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:wily +FROM ubuntu:24.04 MAINTAINER Joel Martin ########################################################## @@ -9,10 +9,8 @@ MAINTAINER Joel Martin RUN apt-get -y update # Required for running tests -RUN apt-get -y install make python - -# Some typical implementation and test requirements -RUN apt-get -y install curl libreadline-dev libedit-dev +RUN apt-get -y install make python3 +RUN ln -fs /usr/bin/python3 /usr/local/bin/python RUN mkdir -p /mal WORKDIR /mal @@ -21,26 +19,28 @@ WORKDIR /mal # Specific implementation requirements ########################################################## +RUN DEBIAN_FRONTEND=noninteractive apt-get -y install \ + ca-certificates curl gcc g++ libasound2-dev \ + libglu1-mesa-dev mesa-common-dev patch unzip wget + # cbmbasic -RUN apt-get install -y gcc unzip patch +# Remove duplicate RAM (https://github.com/mist64/cbmbasic/commit/352a313313dd0a15a47288c8f8031b54ac8c92a2). RUN cd /tmp && \ curl -L https://github.com/kanaka/cbmbasic/archive/master.zip -o cbmbasic.zip && \ unzip cbmbasic.zip && \ cd cbmbasic-master && \ + sed -i '/unsigned char RAM.65536.;/d' runtime.c && \ make && \ - cp cbmbasic /usr/bin/cbmbasic && \ + mv cbmbasic /usr/local/bin && \ cd .. && \ rm -r cbmbasic* -RUN apt-get install -y g++ mesa-common-dev libglu1-mesa-dev libasound2-dev wget RUN cd /tmp && \ - curl -L http://www.qb64.net/release/official/2017_02_09__02_14_38-1.1-20170120.51/linux/qb64-1.1-20170120.51-lnx.tar.gz | tar xzf - && \ - cd qb64 && \ + wget https://github.com/QB64Official/qb64/releases/download/v2.1/qb64_dev_2022-09-08-07-14-00_47f5044_lnx.tar.gz -O- | tar xzf - && \ + cd qb64_20*_lnx/ && \ find . -name '*.sh' -exec sed -i "s/\r//g" {} \; && \ env EUID=1 ./setup_lnx.sh && \ mkdir -p /usr/share/qb64 && \ cp -a qb64 internal LICENSE programs source /usr/share/qb64/ && \ echo '#!/bin/sh\ncd /usr/share/qb64\n./qb64 "${@}"' > /usr/bin/qb64 && \ chmod +x /usr/bin/qb64 - - diff --git a/impls/basic/basicpp.py b/impls/basic/basicpp.py index cb2f6223f8..c9c64df363 100755 --- a/impls/basic/basicpp.py +++ b/impls/basic/basicpp.py @@ -111,7 +111,7 @@ def misc_fixups(orig_lines): text = re.sub(r"\bIF ", "IF", text) text = re.sub(r"\bPRINT *", "PRINT", text) text = re.sub(r"\bDIM ", "DIM", text) - text = re.sub(r"\OPEN ", "OPEN", text) + text = re.sub(r"\bOPEN ", "OPEN", text) text = re.sub(r"\bGET ", "GET", text) text = re.sub(r"\bPOKE ", "POKE", text) text = re.sub(r"\bCLOSE ", "CLOSE", text) @@ -161,7 +161,7 @@ def finalize(lines, args): if m: prefix = m.groups(1)[0] sub = m.groups(1)[1] - if not call_index.has_key(sub): + if sub not in call_index: call_index[sub] = 0 call_index[sub] += 1 label = sub+"_"+str(call_index[sub])