From a5093d06dd15fc72e8db13fd6f94e50210a58d8f Mon Sep 17 00:00:00 2001 From: jaby Date: Sat, 4 Jan 2025 22:53:40 +0100 Subject: [PATCH] Support builds though podman --- examples/PoolBox/PoolBox.code-workspace | 27 +++++------------------ examples/PoolBox/iso/Config.xml | 1 + podman/Dockerfile | 1 + scripts/podman_jaby_engine.sh | 8 ++++++- support/src/FontWriter/Makefile | 2 +- support/src/SupportLibrary.code-workspace | 8 ++----- 6 files changed, 18 insertions(+), 29 deletions(-) diff --git a/examples/PoolBox/PoolBox.code-workspace b/examples/PoolBox/PoolBox.code-workspace index 540f55ec..cb769059 100644 --- a/examples/PoolBox/PoolBox.code-workspace +++ b/examples/PoolBox/PoolBox.code-workspace @@ -8,35 +8,20 @@ "tasks": { "version": "2.0.0", "tasks": [ - { + { "label": "build", - "type": "shell", - "windows": { // v re-export for WSL v re-export for WSL - "command": "wsl make ${input:project}_${input:target} BUILD_PROFILE=${input:build profile} REGION=${input:region} CUSTOM_CONFIG=${input:custom config} PSX_LICENSE_PATH=$(wslpath ${env:PSX_LICENSE_PATH}) JABY_ENGINE_DIR=$(wslpath ${env:JABY_ENGINE_PATH})", - }, - "linux": { - "command": "make ${input:project}_${input:target} BUILD_PROFILE=${input:build profile} REGION=${input:region} CUSTOM_CONFIG=${input:custom config}", - }, + "type": "shell", // TODO: Sort out JABY_ENGINE_DIR!!! Can it be set in the docker image? Can it just be JABY_ENGINE_PATH? + "command": "${env:JABY_ENGINE_PATH}/scripts/podman_jaby_engine.sh ${workspaceFolder} . make ${input:project}_${input:target} BUILD_PROFILE=${input:build profile} REGION=${input:region} CUSTOM_CONFIG=${input:custom config} JABY_ENGINE_DIR=/jaby_engine", "group": { "kind": "build", "isDefault": true }, - "options": { - "env": { - "PATH": "${env:JABY_ENGINE_PATH}/bin;${env:PATH}" - } - } }, { "label": "read memory map", - "type": "shell", - "command": "psxreadmap.exe ${input:output memory map} application/bin/${input:tv format}/PSX-${input:build profile}/PoolBox.elf", + "type": "shell", // TODO: Make this work again? Or remove it and just tell people how to use it? Does not work with docker...? + "command": "${env:JABY_ENGINE_PATH}/scripts/podman_jaby_engine.sh ${workspaceFolder} . psxreadmap ${input:output memory map} application/bin/PAL/PSX-${input:build profile}/PoolBox.elf", "problemMatcher": [], - "options": { - "env": { - "PATH": "${env:JABY_ENGINE_PATH}/bin;${env:PATH}" - } - } } ], "inputs": [ @@ -73,7 +58,7 @@ "type": "command", "command": "shellCommand.execute", "args": { - "command": "echo ^|^ && dir /b /a:d", + "command": "echo \"|\" && ls -d */", "cwd": "${env:JABY_ENGINE_PATH}/config", "fieldSeparator": "|" } diff --git a/examples/PoolBox/iso/Config.xml b/examples/PoolBox/iso/Config.xml index 1a144b2b..2108295b 100644 --- a/examples/PoolBox/iso/Config.xml +++ b/examples/PoolBox/iso/Config.xml @@ -9,6 +9,7 @@ --> Jaby + %PSX_LICENSE_PATH%/%PSX_LICENSE%.DAT diff --git a/podman/Dockerfile b/podman/Dockerfile index ab6a5b1f..5dd841a3 100644 --- a/podman/Dockerfile +++ b/podman/Dockerfile @@ -13,6 +13,7 @@ ADD ["scripts/install_pop-fe.sh", "/usr/scripts"] ENV PATH="/jaby_engine/bin:/root/.cargo/bin:${PATH}" ENV JABY_ENGINE_PATH=/jaby_engine +ENV PSX_LICENSE_PATH=/psx_license #WORKDIR /usr/src/project diff --git a/scripts/podman_jaby_engine.sh b/scripts/podman_jaby_engine.sh index 5b270dad..4a10a2d2 100755 --- a/scripts/podman_jaby_engine.sh +++ b/scripts/podman_jaby_engine.sh @@ -1,6 +1,12 @@ #!/usr/bin/env bash +if [[ -n "${PSX_LICENSE_PATH}" ]]; then +LICENSE_MOUNT="-v ${PSX_LICENSE_PATH}:/psx_license" +else +LICENSE_MOUNT= +fi + PROJECT_PATH=$1 PROJECT_WORK_DIR=$2 shift shift -podman run --rm -it -v ${JABY_ENGINE_PATH}:/jaby_engine -v ${PROJECT_PATH}:/project -e PSX_LICENSE_PATH=${PSX_LICENSE_PATH} -w /project/$PROJECT_WORK_DIR jaby_engine $@ \ No newline at end of file +podman run --rm -it -v ${JABY_ENGINE_PATH}:/jaby_engine -v ${PROJECT_PATH}:/project $LICENSE_MOUNT -w /project/$PROJECT_WORK_DIR jaby_engine $@ \ No newline at end of file diff --git a/support/src/FontWriter/Makefile b/support/src/FontWriter/Makefile index af90a06e..75d9db76 100644 --- a/support/src/FontWriter/Makefile +++ b/support/src/FontWriter/Makefile @@ -1,4 +1,4 @@ -JABY_ENGINE_DIR = ../../.. +JABY_ENGINE_DIR = /jaby_engine include $(JABY_ENGINE_DIR)/mkfile/common/RebuildTarget.mk ARTIFACT = libFontWriter diff --git a/support/src/SupportLibrary.code-workspace b/support/src/SupportLibrary.code-workspace index 9fea4a4e..2b9aa6d2 100644 --- a/support/src/SupportLibrary.code-workspace +++ b/support/src/SupportLibrary.code-workspace @@ -19,13 +19,9 @@ { "label": "make", "type": "shell", - "windows": { - "command": "wsl make ${input:target} BUILD_PROFILE=${input:build cfg}", - }, - "linux": { - "command": "make ${input:target} BUILD_PROFILE=${input:build cfg}", - }, + "command": "../../../scripts/podman_jaby_engine.sh ${workspaceFolder}/.. src/FontWriter make ${input:target} BUILD_PROFILE=${input:build cfg}", "options": { + // TODO: This should not be the case "cwd": "${workspaceFolder}/FontWriter" }, "group": "build"