diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..c9418ae --- /dev/null +++ b/.dockerignore @@ -0,0 +1,30 @@ +build/ +*~ +*#*# +/pcsx.json +/*.frag +/*.vert +/*.lua +/*.mcd +/*.chd +*.tiled-session +/.pcsx +temp/ +**/__pycache__/ +**/venv/ +**/.mypy_cache/ +*.MAP +*.LVL +*.COL +*.OMP +*.OTD +*.PRL +*.psxlvl +**/collision16.json +**/tilemap128.csv +*.mdl +*.MDL +*.xa +*.XA +*.VAG +.git/ diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..5b99819 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,66 @@ +FROM luksamuk/psxtoolchain:latest +RUN apt update +RUN apt install -y \ + python-is-python3 \ + python3-numpy \ + python3-shapely \ + python3-pandas + +# RUN apt install -y libxcb-xinerama0 libxcb-cursor0 xvfb + +# Build and install tiled 1.11.2 +RUN apt install -y \ + qtbase5-dev \ + qtdeclarative5-dev \ + libqt5svg5-dev \ + qttools5-dev-tools \ + zlib1g-dev \ + zlib1g-dev \ + libgl1-mesa-dev \ + build-essential \ + python3-dev \ + qbs +RUN cd / && \ + git clone --depth 1 --branch v1.11.2 https://github.com/mapeditor/tiled +RUN cd tiled &&\ + qbs setup-toolchains --detect &&\ + qbs config profiles.default.cpp.toolchainInstallPath /usr/bin &&\ + qbs config profiles.default.cpp.compilerName g++ +ENV PYTHONHOME=/usr +RUN cd tiled &&\ + qbs install qbs.installPrefix:"/usr" +RUN cd tiled &&\ + qbs install --no-build --install-root / +ENV QT_QPA_PLATFORM=offscreen +RUN tiled --version && rm -r /tiled + +RUN apt clean &&\ + rm -rf /var/lib/apt/lists/* + +ENV HOME="/home/builduser/" + +# Enable and install Tiled python/csv plugins +RUN mkdir -p ~/.config/mapeditor.org &&\ + mkdir -p ~/.tiled &&\ + printf "[Plugins]\nEnabled=libpython.so\n" \ + > ~/.config/mapeditor.org/tiled.conf + +COPY ./assets/tiled /usr/bin/tiled +COPY ./tools/tiled_exporter/chunkexporter.py ~/.tiled/chunkexporter.py +COPY ./tools/tiled_exporter/lvlexporter.py ~/.tiled/lvlexporter.py + +RUN tiled --export-formats &&\ + cat ~/.config/mapeditor.org/tiled.conf &&\ + false + +# Prevent errors with CMake and Tiled +ENV CMAKE_MAKE_PROGRAM=make + +COPY . /sonicxa +WORKDIR /sonicxa +RUN make purge +RUN make cook +RUN make elf +RUN make iso +RUN make chd + diff --git a/build-docker.sh b/build-docker.sh new file mode 100755 index 0000000..bb877c2 --- /dev/null +++ b/build-docker.sh @@ -0,0 +1,3 @@ +#!/bin/bash +docker buildx build --load . -t sonicxa:latest + diff --git a/dockershell.sh b/dockershell.sh new file mode 100755 index 0000000..76b10db --- /dev/null +++ b/dockershell.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +exec docker run -it --rm \ + -v $(pwd):/source \ + -v $(pwd):$(pwd) \ + -w /source \ + --network=host \ + --add-host localhost:host-gateway \ + sonicxa:latest \ + /bin/bash