From f79e4e04f3a369d59e1f3c2c11195f03148e6d5c Mon Sep 17 00:00:00 2001 From: kipcode66 Date: Mon, 26 Dec 2022 12:39:59 -0500 Subject: [PATCH] added VSCode devcontainer config files (#213) * added VSCode devcontainer config files * removed useless command * changed oead to syaz0 * addded cmake to the container --- .devcontainer/Dockerfile | 22 ++++++++++++++++++++++ .devcontainer/devcontainer.json | 29 +++++++++++++++++++++++++++++ tools/package_game_assets.py | 6 +++--- tools/requirements.txt | 3 ++- 4 files changed, 56 insertions(+), 4 deletions(-) create mode 100644 .devcontainer/Dockerfile create mode 100644 .devcontainer/devcontainer.json diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 00000000000..1504ede58d8 --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,22 @@ +# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.245.2/containers/ubuntu/.devcontainer/base.Dockerfile + +# [Choice] Ubuntu version (use ubuntu-22.04 or ubuntu-18.04 on local arm64/Apple Silicon): ubuntu-22.04, ubuntu-20.04, ubuntu-18.04 +ARG VARIANT="jammy" +FROM mcr.microsoft.com/vscode/devcontainers/base:0-${VARIANT} + +RUN dpkg --add-architecture i386 && apt-get update && export DEBIAN_FRONTEND=noninteractive \ + && apt-get -y install --no-install-recommends build-essential cmake python3-pip wine wine32 + +USER vscode + +# Install DevkitPPC +WORKDIR /tmp +RUN wget https://apt.devkitpro.org/install-devkitpro-pacman +RUN chmod +x ./install-devkitpro-pacman +RUN yes | sudo ./install-devkitpro-pacman +RUN sudo chmod +x ./install-devkitpro-pacman +RUN sudo ./install-devkitpro-pacman +RUN sudo dkp-pacman -Syu --noconfirm +WORKDIR /etc +RUN sudo ln -sf /proc/self/mounts mtab +RUN sudo dkp-pacman -S --noconfirm gamecube-dev wii-dev \ No newline at end of file diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 00000000000..30d298c5129 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,29 @@ +// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at: +// https://github.com/microsoft/vscode-dev-containers/tree/v0.245.2/containers/ubuntu +{ + "name": "Ubuntu", + "build": { + "dockerfile": "Dockerfile", + // Update 'VARIANT' to pick an Ubuntu version: jammy / ubuntu-22.04, focal / ubuntu-20.04, bionic /ubuntu-18.04 + // Use ubuntu-22.04 or ubuntu-18.04 on local arm64/Apple Silicon. + "args": { "VARIANT": "ubuntu-22.04" } + }, + + "extensions": [ + "ms-vscode.cpptools-extension-pack", + "mhutchie.git-graph" + ], + + // Use 'forwardPorts' to make a list of ports inside the container available locally. + // "forwardPorts": [], + + // Use 'postCreateCommand' to run commands after the container is created. + "updateContentCommand": "python3 -m pip install --user -r tools/requirements.txt", + "postCreateCommand": "./tp setup || echo \"\\nMake sure you put the compiler in the appropriate folder and copied the ISO in the right folder.\\nThen run \\\"./tp setup\\\" again.\\n\"", + + // Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root. + "remoteUser": "vscode", + "features": { + "python": "3.8" + } +} diff --git a/tools/package_game_assets.py b/tools/package_game_assets.py index 960ca1cc99b..20bcf18f224 100644 --- a/tools/package_game_assets.py +++ b/tools/package_game_assets.py @@ -6,7 +6,7 @@ from pathlib import Path import hashlib import struct import ctypes -import oead +import syaz0 def copy(path,destPath): @@ -224,7 +224,7 @@ def addFile(index,sizeIndex,dirs,name,stringTable,paths,data): path = relPath file.unk1 = 0 fileData = open(path,"rb") - compressedData = oead.yaz0.compress(fileData.read()) + compressedData = syaz0.compress(fileData.read()) padding = (0x20-(len(compressedData)%0x20)) file.fileLength = len(compressedData) file.fileOffset = sizeIndex @@ -255,7 +255,7 @@ def copyRelFiles(buildPath,aMemList,mMemList): relSource = open(fullPath,"rb") data = relSource.read() relSource.close() - data = oead.yaz0.compress(data) + data = syaz0.compress(data) relNew = open(buildPath/"game/files/rel/Final/Release"/file,"wb") relNew.write(data) relNew.truncate() diff --git a/tools/requirements.txt b/tools/requirements.txt index bcc34c4116c..12119dbe8f3 100644 --- a/tools/requirements.txt +++ b/tools/requirements.txt @@ -8,4 +8,5 @@ ansiwrap watchdog python-Levenshtein cxxfilt -oead \ No newline at end of file +syaz0 +pyelftools \ No newline at end of file