From 94f13dfd61a6aa8de1556d14d6c7075fb8f644ff Mon Sep 17 00:00:00 2001 From: Jaby Date: Thu, 2 Jan 2025 19:47:47 +0100 Subject: [PATCH 01/25] Create GCC in podman --- mkfile/Makefile | 2 +- podman/Dockerfile | 16 +++++++++ podman/install.sh | 1 + .../scripts}/install_pop-fe.sh | 0 podman/scripts/install_rust.sh | 5 +++ {wsl_scripts => podman/scripts}/make_gcc.sh | 33 ++++++++++++------- podman/scripts/prerequisites.sh | 3 ++ readme.md | 10 ++++++ src/Tools/Common.mk | 1 - wsl_scripts/install_rust.sh | 2 -- wsl_scripts/prerequisites.sh | 3 -- 11 files changed, 57 insertions(+), 19 deletions(-) create mode 100644 podman/Dockerfile create mode 100644 podman/install.sh rename {wsl_scripts => podman/scripts}/install_pop-fe.sh (100%) create mode 100755 podman/scripts/install_rust.sh rename {wsl_scripts => podman/scripts}/make_gcc.sh (57%) create mode 100755 podman/scripts/prerequisites.sh delete mode 100755 wsl_scripts/install_rust.sh delete mode 100755 wsl_scripts/prerequisites.sh diff --git a/mkfile/Makefile b/mkfile/Makefile index cd1685f3..4aa1e396 100644 --- a/mkfile/Makefile +++ b/mkfile/Makefile @@ -10,7 +10,7 @@ PLATFORM ?= PSX #Build profile, possible values: release, debug, profile, coverage BUILD_DIR ?= bin/$(PSX_TV_FORMAT) BUILD_PROFILE ?= debug -PSX_TV_FORMAT ?= PAL +PSX_TV_FORMAT ?= PAL CONFIG_NAME ?= $(PLATFORM)-$(BUILD_PROFILE) OUTPUT_DIR = $(BUILD_DIR)/$(CONFIG_NAME) diff --git a/podman/Dockerfile b/podman/Dockerfile new file mode 100644 index 00000000..40a6fc8a --- /dev/null +++ b/podman/Dockerfile @@ -0,0 +1,16 @@ +FROM "ubuntu:24.04" +ADD ["scripts/install_pop-fe.sh", "scripts/install_rust.sh", "scripts/make_gcc.sh", "scripts/prerequisites.sh", "/usr/scripts"] +RUN apt update && cd /usr/scripts && ./prerequisites.sh && ./install_rust.sh && cd /usr && ./scripts/make_gcc.sh + + + +#RUN apt update && apt install -y nginx + +#RUN mkdir /app +#WORKDIR /app + +#VOLUME my_vol (Do not use) + +#ADD install_pop-fe.sh install_pop-fe.sh +#CMD ["cp", "install_pop-fe.sh", "/my_vol"] +# TODO: Make a script that builds the image and then registers alias like `jaby-make` for the docker command \ No newline at end of file diff --git a/podman/install.sh b/podman/install.sh new file mode 100644 index 00000000..2d0552c6 --- /dev/null +++ b/podman/install.sh @@ -0,0 +1 @@ +podman build -t jaby_engine . \ No newline at end of file diff --git a/wsl_scripts/install_pop-fe.sh b/podman/scripts/install_pop-fe.sh similarity index 100% rename from wsl_scripts/install_pop-fe.sh rename to podman/scripts/install_pop-fe.sh diff --git a/podman/scripts/install_rust.sh b/podman/scripts/install_rust.sh new file mode 100755 index 00000000..f01bbb2d --- /dev/null +++ b/podman/scripts/install_rust.sh @@ -0,0 +1,5 @@ +#!/bin/bash +echo "<<< Install Rust >>>" +curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y +. "$HOME/.cargo/env" +cargo install cargo-edit --locked \ No newline at end of file diff --git a/wsl_scripts/make_gcc.sh b/podman/scripts/make_gcc.sh similarity index 57% rename from wsl_scripts/make_gcc.sh rename to podman/scripts/make_gcc.sh index 4ece47cd..24b5ec72 100755 --- a/wsl_scripts/make_gcc.sh +++ b/podman/scripts/make_gcc.sh @@ -1,55 +1,64 @@ #!/bin/bash +GCC_VERSION=13.1.0 + +echo "<<< Build GCC >>>" mkdir -p psx-gcc cd psx-gcc -echo "clone binutils" +echo "<<< clone binutils >>>" git clone git://sourceware.org/git/binutils-gdb.git cd binutils-gdb mkdir -p build cd build -echo "Configure binutils" +echo "<<< Configure binutils >>>" ../configure --target=mipsel-linux-gnu --with-sysroot --disable-nls --disable-werror if [ $? -ne 0 ]; then exit 1 fi -echo "Make binutils" +echo "<<< Make binutils >>>" make if [ $? -ne 0 ]; then exit 1 fi -echo "Install binutils" -sudo make install +echo "<<< Install binutils >>>" +make install if [ $? -ne 0 ]; then exit 1 fi cd ../.. -echo "clone gcc" +echo "<<< clone gcc >>>" git clone --recurse-submodules git://gcc.gnu.org/git/gcc.git cd gcc -echo "checkout gcc 13.1.0" -git checkout releases/gcc-13.1.0 +echo "<<< checkout gcc $GCC_VERSION >>>" +git checkout releases/$GCC_VERSION mkdir -p build cd build -echo "configure gcc" +echo "<<< configure gcc >>>" ../configure --target=mipsel-linux-gnu --disable-nls --enable-languages=c,c++ --without-headers if [ $? -ne 0 ]; then exit 1 fi -echo "Make gcc" +echo "<<< Make gcc >>>" make all-gcc if [ $? -ne 0 ]; then exit 1 fi -echo "Install gcc" -sudo make install-gcc +echo "<<< Install gcc >>>" +make install-gcc if [ $? -ne 0 ]; then exit 1 fi + +echo "<<< Delete GCC folder >>>" +cd /usr +rm -fr psx-gcc + +# TODO: Remove gcc files after everything \ No newline at end of file diff --git a/podman/scripts/prerequisites.sh b/podman/scripts/prerequisites.sh new file mode 100755 index 00000000..5fdafe98 --- /dev/null +++ b/podman/scripts/prerequisites.sh @@ -0,0 +1,3 @@ +#!/bin/bash +echo "<<< Install prerequisites >>>" +apt install -y curl make texinfo g++ gcc git libgmp3-dev libmpfr-dev libmpc-dev flex install-info info bison \ No newline at end of file diff --git a/readme.md b/readme.md index 70c32237..58f364d9 100644 --- a/readme.md +++ b/readme.md @@ -1,5 +1,6 @@ - [JabyEngine](#jabyengine) - [About](#about) + - [Podman](#podman) - [How to build](#how-to-build) - [Building `JabyEngine` (without VSCode)](#building-jabyengine-without-vscode) - [Building support library (without VSCode)](#building-support-library-without-vscode) @@ -14,6 +15,15 @@ ## About JabyEngine is my personal attempt to eventually make my own PS1 game from "ground up". Originally I didn't indented to release this code publicly but recently I decided to give it a try. If you read this, thank you! +## Podman +* `sudo apt install podman` +* `podman build -t jaby_engine ` +* `podman images`: lists all images +* `podman image rm `: removes an image +* `podman run -it /bin/bash`: runs bash and interactive +* `podman run --rm <-v : <-e ENV_VAR=VALUE> jaby_engine`: clean up after run +* `podman image tree `: lists usefull information + ## How to build JabyEngine relies on linux to be build. For Windows users it uses `wsl` instead but support for it might get dropped during further development. diff --git a/src/Tools/Common.mk b/src/Tools/Common.mk index 772d68d5..25fca883 100644 --- a/src/Tools/Common.mk +++ b/src/Tools/Common.mk @@ -31,5 +31,4 @@ define cargo_unix_default ) endef -# Run `cargo install cargo-edit --locked`to support upgrade # Windows build requires "rustup target add x86_64-pc-windows-gnu" and "sudo apt-get install mingw-w64" \ No newline at end of file diff --git a/wsl_scripts/install_rust.sh b/wsl_scripts/install_rust.sh deleted file mode 100755 index 9bb29601..00000000 --- a/wsl_scripts/install_rust.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/bash -sudo curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh \ No newline at end of file diff --git a/wsl_scripts/prerequisites.sh b/wsl_scripts/prerequisites.sh deleted file mode 100755 index ff0823e1..00000000 --- a/wsl_scripts/prerequisites.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash -sudo apt update -sudo apt install make texinfo g++ gcc libgmp3-dev libmpfr-dev libmpc-dev flex install-info info bison \ No newline at end of file From 546c246dd11d78062239c10dbe81c71cb395a044 Mon Sep 17 00:00:00 2001 From: Jaby Date: Thu, 2 Jan 2025 19:48:12 +0100 Subject: [PATCH 02/25] Set exec bit --- podman/install.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 podman/install.sh diff --git a/podman/install.sh b/podman/install.sh old mode 100644 new mode 100755 From ce9bcb837044fa9d12164ceddf4002cc27e6417e Mon Sep 17 00:00:00 2001 From: Jaby Date: Thu, 2 Jan 2025 21:42:31 +0100 Subject: [PATCH 03/25] Update Dockerfile to be less painful; Set JABY_ENGINE_PATH automatically --- podman/Dockerfile | 15 ++++++++++++--- podman/install.sh | 14 +++++++++++++- podman/scripts/install_rust.sh | 3 +++ podman/scripts/make_gcc.sh | 3 +++ podman/scripts/prerequisites.sh | 3 --- readme.md | 1 + 6 files changed, 32 insertions(+), 7 deletions(-) delete mode 100755 podman/scripts/prerequisites.sh diff --git a/podman/Dockerfile b/podman/Dockerfile index 40a6fc8a..01641870 100644 --- a/podman/Dockerfile +++ b/podman/Dockerfile @@ -1,8 +1,16 @@ FROM "ubuntu:24.04" -ADD ["scripts/install_pop-fe.sh", "scripts/install_rust.sh", "scripts/make_gcc.sh", "scripts/prerequisites.sh", "/usr/scripts"] -RUN apt update && cd /usr/scripts && ./prerequisites.sh && ./install_rust.sh && cd /usr && ./scripts/make_gcc.sh +WORKDIR /usr +ADD ["scripts/make_gcc.sh", "/usr/scripts"] +RUN apt update && /usr/scripts/make_gcc.sh +WORKDIR /usr/scripts +ADD ["scripts/install_rust.sh", "/usr/scripts"] +RUN apt update && ./install_rust.sh +# TODO: Deal with this eventually +ADD ["scripts/install_pop-fe.sh", "/usr/scripts"] + +#WORKDIR /usr/src/project #RUN apt update && apt install -y nginx @@ -13,4 +21,5 @@ RUN apt update && cd /usr/scripts && ./prerequisites.sh && ./install_rust.sh && #ADD install_pop-fe.sh install_pop-fe.sh #CMD ["cp", "install_pop-fe.sh", "/my_vol"] -# TODO: Make a script that builds the image and then registers alias like `jaby-make` for the docker command \ No newline at end of file + +# TODO: Make a script that builds the image and --then registers alias like `jaby-make` for the docker command-- Cody said alias are bad (yesterday he liked them) and wants scripts instead (He also suddenly claims that he called them invasive but ACTUALLY it was me. Oh noooow he corrects his statement) \ No newline at end of file diff --git a/podman/install.sh b/podman/install.sh index 2d0552c6..73f40ff9 100755 --- a/podman/install.sh +++ b/podman/install.sh @@ -1 +1,13 @@ -podman build -t jaby_engine . \ No newline at end of file +#!/usr/bin/env bash +podman build -t jaby_engine . + +if [[ -z "${JABY_ENGINE_PATH}" ]]; then +echo "Setting JABY_ENGINE_PATH to parent folder" + +SCRIPT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &> /dev/null && pwd)" +JABY_ENGINE_PATH="$(dirname "$SCRIPT_DIR")" +cat << End >> ~/.profile +export JABY_ENGINE_PATH="$JABY_ENGINE_PATH" +End +source ~/.profile +fi \ No newline at end of file diff --git a/podman/scripts/install_rust.sh b/podman/scripts/install_rust.sh index f01bbb2d..0c4136c6 100755 --- a/podman/scripts/install_rust.sh +++ b/podman/scripts/install_rust.sh @@ -1,4 +1,7 @@ #!/bin/bash +echo "<<< Install Rust prerequisites >>>" +apt install -y curl + echo "<<< Install Rust >>>" curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y . "$HOME/.cargo/env" diff --git a/podman/scripts/make_gcc.sh b/podman/scripts/make_gcc.sh index 24b5ec72..18f31835 100755 --- a/podman/scripts/make_gcc.sh +++ b/podman/scripts/make_gcc.sh @@ -1,4 +1,7 @@ #!/bin/bash +echo "<<< Install GCC prerequisites >>>" +apt install -y make texinfo g++ gcc git libgmp3-dev libmpfr-dev libmpc-dev flex install-info info bison + GCC_VERSION=13.1.0 echo "<<< Build GCC >>>" diff --git a/podman/scripts/prerequisites.sh b/podman/scripts/prerequisites.sh deleted file mode 100755 index 5fdafe98..00000000 --- a/podman/scripts/prerequisites.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash -echo "<<< Install prerequisites >>>" -apt install -y curl make texinfo g++ gcc git libgmp3-dev libmpfr-dev libmpc-dev flex install-info info bison \ No newline at end of file diff --git a/readme.md b/readme.md index 58f364d9..71bdd714 100644 --- a/readme.md +++ b/readme.md @@ -23,6 +23,7 @@ JabyEngine is my personal attempt to eventually make my own PS1 game from "groun * `podman run -it /bin/bash`: runs bash and interactive * `podman run --rm <-v : <-e ENV_VAR=VALUE> jaby_engine`: clean up after run * `podman image tree `: lists usefull information +* `podman run --rm -it -v ${JABY_ENGINE_PATH}:${JABY_ENGINE_PATH} jaby_engine /bin/bash` maybe a good idea...? ## How to build JabyEngine relies on linux to be build. For Windows users it uses `wsl` instead but support for it might get dropped during further development. From 3627e41003aab79e3da05f26fb3b4aaeb208c21b Mon Sep 17 00:00:00 2001 From: Jaby Date: Fri, 3 Jan 2025 10:16:57 +0100 Subject: [PATCH 04/25] Improve podman build --- podman/Dockerfile | 3 ++- podman/scripts/make_gcc.sh | 14 ++++++-------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/podman/Dockerfile b/podman/Dockerfile index 01641870..339c74b2 100644 --- a/podman/Dockerfile +++ b/podman/Dockerfile @@ -1,6 +1,7 @@ FROM "ubuntu:24.04" -WORKDIR /usr +WORKDIR /usr/scripts ADD ["scripts/make_gcc.sh", "/usr/scripts"] +WORKDIR /usr RUN apt update && /usr/scripts/make_gcc.sh WORKDIR /usr/scripts diff --git a/podman/scripts/make_gcc.sh b/podman/scripts/make_gcc.sh index 18f31835..fc29bbb9 100755 --- a/podman/scripts/make_gcc.sh +++ b/podman/scripts/make_gcc.sh @@ -21,12 +21,12 @@ if [ $? -ne 0 ]; then exit 1 fi echo "<<< Make binutils >>>" -make +make -j$(nproc) if [ $? -ne 0 ]; then exit 1 fi echo "<<< Install binutils >>>" -make install +make -j$(nproc) install if [ $? -ne 0 ]; then exit 1 fi @@ -38,7 +38,7 @@ git clone --recurse-submodules git://gcc.gnu.org/git/gcc.git cd gcc echo "<<< checkout gcc $GCC_VERSION >>>" -git checkout releases/$GCC_VERSION +git checkout "releases/gcc-$GCC_VERSION" mkdir -p build cd build @@ -49,19 +49,17 @@ if [ $? -ne 0 ]; then fi echo "<<< Make gcc >>>" -make all-gcc +make -j$(nproc) all-gcc if [ $? -ne 0 ]; then exit 1 fi echo "<<< Install gcc >>>" -make install-gcc +make -j$(nproc) install-gcc if [ $? -ne 0 ]; then exit 1 fi echo "<<< Delete GCC folder >>>" cd /usr -rm -fr psx-gcc - -# TODO: Remove gcc files after everything \ No newline at end of file +rm -fr psx-gcc \ No newline at end of file From abef7c1413914aefbfedbcd8e7139aa0e2a151d0 Mon Sep 17 00:00:00 2001 From: Jaby Date: Fri, 3 Jan 2025 16:23:11 +0100 Subject: [PATCH 05/25] Create podman helper script --- readme.md | 1 + scripts/podman_jaby_engine.sh | 8 ++++++++ 2 files changed, 9 insertions(+) create mode 100644 scripts/podman_jaby_engine.sh diff --git a/readme.md b/readme.md index 71bdd714..24f17151 100644 --- a/readme.md +++ b/readme.md @@ -24,6 +24,7 @@ JabyEngine is my personal attempt to eventually make my own PS1 game from "groun * `podman run --rm <-v : <-e ENV_VAR=VALUE> jaby_engine`: clean up after run * `podman image tree `: lists usefull information * `podman run --rm -it -v ${JABY_ENGINE_PATH}:${JABY_ENGINE_PATH} jaby_engine /bin/bash` maybe a good idea...? +* `${JABY_ENGINE_PATH}/scripts/podman_jaby_engine.sh make all BUILD_PROFILE=release PSX_TV_FORMAT=PAL CUSTOM_CONFIG=` ## How to build JabyEngine relies on linux to be build. For Windows users it uses `wsl` instead but support for it might get dropped during further development. diff --git a/scripts/podman_jaby_engine.sh b/scripts/podman_jaby_engine.sh new file mode 100644 index 00000000..bbfcdcff --- /dev/null +++ b/scripts/podman_jaby_engine.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash +if [[ -z "${JABY_ENGINE_PROJECT_PATH}" ]]; then +PROJECT_MOUNT=-v ${JABY_ENGINE_PROJECT_PATH}:${JABY_ENGINE_PROJECT_PATH} +else +PROJECT_MOUNT= +fi + +podman run --rm -it -v ${JABY_ENGINE_PATH}:${JABY_ENGINE_PATH} $PROJECT_MOUNT -e JABY_ENGINE_PATH=${JABY_ENGINE_PATH} -e PSX_LICENSE_PATH=${PSX_LICENSE_PATH} -w ${PWD} jaby_engine $@ \ No newline at end of file From a92918263b652b86f88f19873ac3380a206ce9ed Mon Sep 17 00:00:00 2001 From: Jaby Date: Sat, 4 Jan 2025 18:59:21 +0100 Subject: [PATCH 06/25] Make Library build work with podman --- podman/Dockerfile | 3 +++ scripts/podman_jaby_engine.sh | 12 ++++----- src/Library/Library.code-workspace | 16 +++--------- src/Tools/Tools.code-workspace | 42 +++++++----------------------- 4 files changed, 20 insertions(+), 53 deletions(-) mode change 100644 => 100755 scripts/podman_jaby_engine.sh diff --git a/podman/Dockerfile b/podman/Dockerfile index 339c74b2..ab6a5b1f 100644 --- a/podman/Dockerfile +++ b/podman/Dockerfile @@ -11,6 +11,9 @@ RUN apt update && ./install_rust.sh # TODO: Deal with this eventually ADD ["scripts/install_pop-fe.sh", "/usr/scripts"] +ENV PATH="/jaby_engine/bin:/root/.cargo/bin:${PATH}" +ENV JABY_ENGINE_PATH=/jaby_engine + #WORKDIR /usr/src/project #RUN apt update && apt install -y nginx diff --git a/scripts/podman_jaby_engine.sh b/scripts/podman_jaby_engine.sh old mode 100644 new mode 100755 index bbfcdcff..5b270dad --- a/scripts/podman_jaby_engine.sh +++ b/scripts/podman_jaby_engine.sh @@ -1,8 +1,6 @@ #!/usr/bin/env bash -if [[ -z "${JABY_ENGINE_PROJECT_PATH}" ]]; then -PROJECT_MOUNT=-v ${JABY_ENGINE_PROJECT_PATH}:${JABY_ENGINE_PROJECT_PATH} -else -PROJECT_MOUNT= -fi - -podman run --rm -it -v ${JABY_ENGINE_PATH}:${JABY_ENGINE_PATH} $PROJECT_MOUNT -e JABY_ENGINE_PATH=${JABY_ENGINE_PATH} -e PSX_LICENSE_PATH=${PSX_LICENSE_PATH} -w ${PWD} jaby_engine $@ \ No newline at end of file +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 diff --git a/src/Library/Library.code-workspace b/src/Library/Library.code-workspace index afb872fc..904f6e6d 100644 --- a/src/Library/Library.code-workspace +++ b/src/Library/Library.code-workspace @@ -19,23 +19,13 @@ { "label": "make", "type": "shell", - "windows": { - "command": "wsl make ${input:target} BUILD_PROFILE=${input:build cfg} PSX_TV_FORMAT=${input:tv format} CUSTOM_CONFIG=${input:config options}", - }, - "linux": { - "command": "make ${input:target} BUILD_PROFILE=${input:build cfg} PSX_TV_FORMAT=${input:tv format} CUSTOM_CONFIG=${input:config options}", - }, + "command": "../../scripts/podman_jaby_engine.sh ../../ src/Library make ${input:target} BUILD_PROFILE=${input:build cfg} PSX_TV_FORMAT=${input:tv format} CUSTOM_CONFIG=${input:config options}", "group": "build" }, { "label": "make_all", "type": "shell", - "windows": { - "command": "wsl make -f MakeAll.mk ${input:target prefix}_${input:target} BUILD_PROFILE=${input:build cfg} CUSTOM_CONFIG=${input:config options}", - }, - "linux": { - "command": "make -f MakeAll.mk ${input:target} BUILD_PROFILE=${input:build cfg}", - }, + "command": "../../scripts/podman_jaby_engine.sh ../../ src/Library make -f MakeAll.mk ${input:target prefix}_${input:target} BUILD_PROFILE=${input:build cfg} CUSTOM_CONFIG=${input:config options}", "group": "build" } ], @@ -59,7 +49,7 @@ "type": "command", "command": "shellCommand.execute", "args": { - "command": "echo ^|^ && dir /b /a:d", + "command": "echo \"|\" && ls -d */", "cwd": "${workspaceFolder}/../../config", "fieldSeparator": "|" } diff --git a/src/Tools/Tools.code-workspace b/src/Tools/Tools.code-workspace index 7b35fa07..3acdfd0c 100644 --- a/src/Tools/Tools.code-workspace +++ b/src/Tools/Tools.code-workspace @@ -6,23 +6,14 @@ ], "settings": { "cargo_task": [ - "./ all!Unix: All", - "cpp_out all!Unix: cpp_out", - "mkoverlay all!Unix: mkoverlay", - "psxcdgen_ex all!Unix: psxcdgen_ex", - "psxcdread all!Unix: psxcdread", - "psxfileconv all!Unix: psxfileconv", - "psxreadmap all!Unix: psxreadmap", - "wslpath all!Unix: wslpath", - - "./ all-windows!Windows: All", - "cpp_out all-windows!Windows: cpp_out", - "mkoverlay all-windows!Windows: mkoverlay", - "psxcdgen_ex all-windows!Windows: psxcdgen_ex", - "psxcdread all-windows!Windows: psxcdread", - "psxfileconv all-windows!Windows: psxfileconv", - "psxreadmap all-windows!Windows: psxreadmap", - "wslpath all-windows!Windows: wslpath" + "./ all!All", + "cpp_out all!cpp_out", + "mkoverlay all!mkoverlay", + "psxcdgen_ex all!psxcdgen_ex", + "psxcdread all!psxcdread", + "psxfileconv all!psxfileconv", + "psxreadmap all!psxreadmap", + "wslpath all!wslpath", ] }, "tasks": { @@ -34,26 +25,11 @@ "group": { "kind": "build" }, - "windows": { - "command": "wsl --shell-type login make -C ${input:windows_cargo_task} CARGO_CMD=${input:cargo cmd} BUILD_PROFILE=${input:build cfg}" - }, - "linux": { - "command": "make -C ${input:linux_cargo_task} BUILD_PROFILE=${input:build cfg}" - }, + "command": "../../scripts/podman_jaby_engine.sh ../../ src/Tools make -C ${input:linux_cargo_task} CARGO_CMD=${input:cargo cmd} BUILD_PROFILE=${input:build cfg}", "problemMatcher": [] } ], "inputs": [ - { - "id": "windows_cargo_task", - "type": "command", - "command": "shellCommand.execute", - "args": { - "command": "powershell", - "commandArgs": ["-command", "'${config:cargo_task}'.Replace(',',\"`n\")"], - "fieldSeparator": "!" - } - }, { "id": "linux_cargo_task", "type": "command", From 9fb99359829ca03a27143e0025beab496cafd268 Mon Sep 17 00:00:00 2001 From: Jaby Date: Sat, 4 Jan 2025 22:53:40 +0100 Subject: [PATCH 07/25] 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" From 0fc0cf7041c0bf1dcb602263967775047e499c38 Mon Sep 17 00:00:00 2001 From: Jaby Date: Sun, 5 Jan 2025 13:30:57 +0100 Subject: [PATCH 08/25] Make Rust work better; Adjust docker version --- examples/PoolBox/PoolBox.code-workspace | 2 +- podman/Dockerfile | 2 +- scripts/podman_jaby_engine.sh | 6 +++++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/examples/PoolBox/PoolBox.code-workspace b/examples/PoolBox/PoolBox.code-workspace index cb769059..cbe22001 100644 --- a/examples/PoolBox/PoolBox.code-workspace +++ b/examples/PoolBox/PoolBox.code-workspace @@ -20,7 +20,7 @@ { "label": "read memory map", "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", + "command": "${env:JABY_ENGINE_PATH}/bin/psxreadmap ${input:output memory map} application/bin/PAL/PSX-${input:build profile}/PoolBox.elf", "problemMatcher": [], } ], diff --git a/podman/Dockerfile b/podman/Dockerfile index 5dd841a3..0f287910 100644 --- a/podman/Dockerfile +++ b/podman/Dockerfile @@ -1,4 +1,4 @@ -FROM "ubuntu:24.04" +FROM "ubuntu:22.04" WORKDIR /usr/scripts ADD ["scripts/make_gcc.sh", "/usr/scripts"] WORKDIR /usr diff --git a/scripts/podman_jaby_engine.sh b/scripts/podman_jaby_engine.sh index 4a10a2d2..febc6649 100755 --- a/scripts/podman_jaby_engine.sh +++ b/scripts/podman_jaby_engine.sh @@ -1,4 +1,7 @@ #!/usr/bin/env bash +JABY_ENGINE_DOT_FOLDER="$HOME/.jaby_engine" +JABY_ENGINE_CARGO_FOLDER="$JABY_ENGINE_DOT_FOLDER/cargo/registry" + if [[ -n "${PSX_LICENSE_PATH}" ]]; then LICENSE_MOUNT="-v ${PSX_LICENSE_PATH}:/psx_license" else @@ -9,4 +12,5 @@ PROJECT_PATH=$1 PROJECT_WORK_DIR=$2 shift shift -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 +mkdir -p $JABY_ENGINE_CARGO_FOLDER +podman run --rm -it -v $JABY_ENGINE_CARGO_FOLDER:/root/.cargo/registry -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 From 3d29f3bcff662c0987bd164bfb268f03a89dda4b Mon Sep 17 00:00:00 2001 From: Jaby Date: Sun, 5 Jan 2025 14:39:21 +0100 Subject: [PATCH 09/25] Also map JABY_ENGINE_DIR --- examples/PoolBox/PoolBox.code-workspace | 2 +- podman/Dockerfile | 1 + podman/scripts/install_rust.sh | 1 + support/src/FontWriter/Makefile | 1 - 4 files changed, 3 insertions(+), 2 deletions(-) diff --git a/examples/PoolBox/PoolBox.code-workspace b/examples/PoolBox/PoolBox.code-workspace index cbe22001..ce1c336c 100644 --- a/examples/PoolBox/PoolBox.code-workspace +++ b/examples/PoolBox/PoolBox.code-workspace @@ -11,7 +11,7 @@ { "label": "build", "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", + "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}", "group": { "kind": "build", "isDefault": true diff --git a/podman/Dockerfile b/podman/Dockerfile index 0f287910..47fb9687 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 JABY_ENGINE_DIR=/jaby_engine ENV PSX_LICENSE_PATH=/psx_license #WORKDIR /usr/src/project diff --git a/podman/scripts/install_rust.sh b/podman/scripts/install_rust.sh index 0c4136c6..6a30f7c0 100755 --- a/podman/scripts/install_rust.sh +++ b/podman/scripts/install_rust.sh @@ -2,6 +2,7 @@ echo "<<< Install Rust prerequisites >>>" apt install -y curl +# TODO: Specific version?? echo "<<< Install Rust >>>" curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y . "$HOME/.cargo/env" diff --git a/support/src/FontWriter/Makefile b/support/src/FontWriter/Makefile index 75d9db76..a9921bf2 100644 --- a/support/src/FontWriter/Makefile +++ b/support/src/FontWriter/Makefile @@ -1,4 +1,3 @@ -JABY_ENGINE_DIR = /jaby_engine include $(JABY_ENGINE_DIR)/mkfile/common/RebuildTarget.mk ARTIFACT = libFontWriter From d0a9ebf1d182f9292c884a5dbe3496b43b276813 Mon Sep 17 00:00:00 2001 From: Jaby Date: Sun, 5 Jan 2025 14:42:56 +0100 Subject: [PATCH 10/25] Update bug report --- docs/Bugs/known_bugs.md | 6 ++++++ docs/docs.md | 5 +++-- 2 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 docs/Bugs/known_bugs.md diff --git a/docs/Bugs/known_bugs.md b/docs/Bugs/known_bugs.md new file mode 100644 index 00000000..b4dd1a53 --- /dev/null +++ b/docs/Bugs/known_bugs.md @@ -0,0 +1,6 @@ +# Known bugs +- [Known bugs](#known-bugs) + - [`psxreadmap` is not functional under Linux](#psxreadmap-is-not-functional-under-linux) + +## `psxreadmap` is not functional under Linux +Key input seems not work under any version under Linux... \ No newline at end of file diff --git a/docs/docs.md b/docs/docs.md index 30637036..3b509dac 100644 --- a/docs/docs.md +++ b/docs/docs.md @@ -2,7 +2,7 @@ - [JabyEngine Documentation](#jabyengine-documentation) - [Features](#features) - [Known limitations](#known-limitations) - - [Observed bugs](#observed-bugs) + - [Bugs](#bugs) ## Features - [Auto LBAs](./Features/auto_lba.md) @@ -10,5 +10,6 @@ ## Known limitations - Insufficient documentation -## Observed bugs +### Bugs +- [Known bugs](./Bugs/known_bugs.md) - [Observed bugs](./Bugs/observed_bugs.md) \ No newline at end of file From 6929c8cec106b3e3f425a8461e208ff239ddca52 Mon Sep 17 00:00:00 2001 From: Jaby Date: Sun, 5 Jan 2025 14:57:00 +0100 Subject: [PATCH 11/25] Use ! as a seperator between project mount point and cwd --- examples/PoolBox/PoolBox.code-workspace | 6 +++--- scripts/podman_jaby_engine.sh | 6 +++--- src/Library/Library.code-workspace | 4 ++-- src/Tools/Tools.code-workspace | 2 +- support/src/SupportLibrary.code-workspace | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/examples/PoolBox/PoolBox.code-workspace b/examples/PoolBox/PoolBox.code-workspace index ce1c336c..4c22c398 100644 --- a/examples/PoolBox/PoolBox.code-workspace +++ b/examples/PoolBox/PoolBox.code-workspace @@ -10,8 +10,8 @@ "tasks": [ { "label": "build", - "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}", + "type": "shell", + "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}", "group": { "kind": "build", "isDefault": true @@ -19,7 +19,7 @@ }, { "label": "read memory map", - "type": "shell", // TODO: Make this work again? Or remove it and just tell people how to use it? Does not work with docker...? + "type": "shell", "command": "${env:JABY_ENGINE_PATH}/bin/psxreadmap ${input:output memory map} application/bin/PAL/PSX-${input:build profile}/PoolBox.elf", "problemMatcher": [], } diff --git a/scripts/podman_jaby_engine.sh b/scripts/podman_jaby_engine.sh index febc6649..bb16edf8 100755 --- a/scripts/podman_jaby_engine.sh +++ b/scripts/podman_jaby_engine.sh @@ -8,9 +8,9 @@ else LICENSE_MOUNT= fi -PROJECT_PATH=$1 -PROJECT_WORK_DIR=$2 -shift +PROJECT_PATH_ARR=(${1//!/ }) +PROJECT_PATH=${PROJECT_PATH_ARR[0]} +PROJECT_WORK_DIR=${PROJECT_PATH_ARR[1]} shift mkdir -p $JABY_ENGINE_CARGO_FOLDER podman run --rm -it -v $JABY_ENGINE_CARGO_FOLDER:/root/.cargo/registry -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/src/Library/Library.code-workspace b/src/Library/Library.code-workspace index 904f6e6d..9abab54d 100644 --- a/src/Library/Library.code-workspace +++ b/src/Library/Library.code-workspace @@ -19,13 +19,13 @@ { "label": "make", "type": "shell", - "command": "../../scripts/podman_jaby_engine.sh ../../ src/Library make ${input:target} BUILD_PROFILE=${input:build cfg} PSX_TV_FORMAT=${input:tv format} CUSTOM_CONFIG=${input:config options}", + "command": "../../scripts/podman_jaby_engine.sh ../../!src/Library make ${input:target} BUILD_PROFILE=${input:build cfg} PSX_TV_FORMAT=${input:tv format} CUSTOM_CONFIG=${input:config options}", "group": "build" }, { "label": "make_all", "type": "shell", - "command": "../../scripts/podman_jaby_engine.sh ../../ src/Library make -f MakeAll.mk ${input:target prefix}_${input:target} BUILD_PROFILE=${input:build cfg} CUSTOM_CONFIG=${input:config options}", + "command": "../../scripts/podman_jaby_engine.sh ../../!src/Library make -f MakeAll.mk ${input:target prefix}_${input:target} BUILD_PROFILE=${input:build cfg} CUSTOM_CONFIG=${input:config options}", "group": "build" } ], diff --git a/src/Tools/Tools.code-workspace b/src/Tools/Tools.code-workspace index 3acdfd0c..c2e75d27 100644 --- a/src/Tools/Tools.code-workspace +++ b/src/Tools/Tools.code-workspace @@ -25,7 +25,7 @@ "group": { "kind": "build" }, - "command": "../../scripts/podman_jaby_engine.sh ../../ src/Tools make -C ${input:linux_cargo_task} CARGO_CMD=${input:cargo cmd} BUILD_PROFILE=${input:build cfg}", + "command": "../../scripts/podman_jaby_engine.sh ../../!src/Tools make -C ${input:linux_cargo_task} CARGO_CMD=${input:cargo cmd} BUILD_PROFILE=${input:build cfg}", "problemMatcher": [] } ], diff --git a/support/src/SupportLibrary.code-workspace b/support/src/SupportLibrary.code-workspace index 2b9aa6d2..540a2256 100644 --- a/support/src/SupportLibrary.code-workspace +++ b/support/src/SupportLibrary.code-workspace @@ -19,7 +19,7 @@ { "label": "make", "type": "shell", - "command": "../../../scripts/podman_jaby_engine.sh ${workspaceFolder}/.. src/FontWriter 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" From d36509983f5b75d8a179171cd587686677aa2549 Mon Sep 17 00:00:00 2001 From: Jaby Date: Sun, 5 Jan 2025 15:32:23 +0100 Subject: [PATCH 12/25] Support 'No Docker' run --- readme.md | 3 +++ scripts/podman_jaby_engine.sh | 9 ++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/readme.md b/readme.md index 24f17151..12d5e7cb 100644 --- a/readme.md +++ b/readme.md @@ -32,6 +32,9 @@ JabyEngine relies on linux to be build. For Windows users it uses `wsl` instead The following environment variables should be set: * `JABY_ENGINE_PATH`: The path to the root folder of this repo * `PSX_LICENSE_PATH`: The path to a folder containing the PS1 licenses for generating a CD. + +Additionally you can also specify the following optional environment variables: +* `JABY_ENGINE_NO_DOCKER`: Turns off usage of `podman` for build. This is only recommended for specific development. ### Building `JabyEngine` (without VSCode) `make` requires the following values to be passed: diff --git a/scripts/podman_jaby_engine.sh b/scripts/podman_jaby_engine.sh index bb16edf8..c9397534 100755 --- a/scripts/podman_jaby_engine.sh +++ b/scripts/podman_jaby_engine.sh @@ -12,5 +12,12 @@ PROJECT_PATH_ARR=(${1//!/ }) PROJECT_PATH=${PROJECT_PATH_ARR[0]} PROJECT_WORK_DIR=${PROJECT_PATH_ARR[1]} shift + +if [[ -z "${JABY_ENGINE_NO_DOCKER}" ]]; then mkdir -p $JABY_ENGINE_CARGO_FOLDER -podman run --rm -it -v $JABY_ENGINE_CARGO_FOLDER:/root/.cargo/registry -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 +podman run --rm -it -v $JABY_ENGINE_CARGO_FOLDER:/root/.cargo/registry -v ${JABY_ENGINE_PATH}:/jaby_engine -v ${PROJECT_PATH}:/project $LICENSE_MOUNT -w /project/$PROJECT_WORK_DIR jaby_engine $@ +else +echo "WARNING! You are not running in podman" +cd $PROJECT_PATH/$PROJECT_WORK_DIR +$@ +fi \ No newline at end of file From 55c9316840cb78c8b1686594a6bb02d176777284 Mon Sep 17 00:00:00 2001 From: Jaby Date: Sun, 5 Jan 2025 15:38:35 +0100 Subject: [PATCH 13/25] Change seperator to : --- examples/PoolBox/PoolBox.code-workspace | 2 +- scripts/podman_jaby_engine.sh | 2 +- src/Library/Library.code-workspace | 4 ++-- src/Tools/Tools.code-workspace | 4 ++-- support/src/SupportLibrary.code-workspace | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/examples/PoolBox/PoolBox.code-workspace b/examples/PoolBox/PoolBox.code-workspace index 4c22c398..5df127c7 100644 --- a/examples/PoolBox/PoolBox.code-workspace +++ b/examples/PoolBox/PoolBox.code-workspace @@ -11,7 +11,7 @@ { "label": "build", "type": "shell", - "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}", + "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}", "group": { "kind": "build", "isDefault": true diff --git a/scripts/podman_jaby_engine.sh b/scripts/podman_jaby_engine.sh index c9397534..66538fe7 100755 --- a/scripts/podman_jaby_engine.sh +++ b/scripts/podman_jaby_engine.sh @@ -8,7 +8,7 @@ else LICENSE_MOUNT= fi -PROJECT_PATH_ARR=(${1//!/ }) +PROJECT_PATH_ARR=(${1//:/ }) PROJECT_PATH=${PROJECT_PATH_ARR[0]} PROJECT_WORK_DIR=${PROJECT_PATH_ARR[1]} shift diff --git a/src/Library/Library.code-workspace b/src/Library/Library.code-workspace index 9abab54d..70508534 100644 --- a/src/Library/Library.code-workspace +++ b/src/Library/Library.code-workspace @@ -19,13 +19,13 @@ { "label": "make", "type": "shell", - "command": "../../scripts/podman_jaby_engine.sh ../../!src/Library make ${input:target} BUILD_PROFILE=${input:build cfg} PSX_TV_FORMAT=${input:tv format} CUSTOM_CONFIG=${input:config options}", + "command": "../../scripts/podman_jaby_engine.sh ../../:src/Library make ${input:target} BUILD_PROFILE=${input:build cfg} PSX_TV_FORMAT=${input:tv format} CUSTOM_CONFIG=${input:config options}", "group": "build" }, { "label": "make_all", "type": "shell", - "command": "../../scripts/podman_jaby_engine.sh ../../!src/Library make -f MakeAll.mk ${input:target prefix}_${input:target} BUILD_PROFILE=${input:build cfg} CUSTOM_CONFIG=${input:config options}", + "command": "../../scripts/podman_jaby_engine.sh ../../:src/Library make -f MakeAll.mk ${input:target prefix}_${input:target} BUILD_PROFILE=${input:build cfg} CUSTOM_CONFIG=${input:config options}", "group": "build" } ], diff --git a/src/Tools/Tools.code-workspace b/src/Tools/Tools.code-workspace index c2e75d27..0ce65be7 100644 --- a/src/Tools/Tools.code-workspace +++ b/src/Tools/Tools.code-workspace @@ -25,7 +25,7 @@ "group": { "kind": "build" }, - "command": "../../scripts/podman_jaby_engine.sh ../../!src/Tools make -C ${input:linux_cargo_task} CARGO_CMD=${input:cargo cmd} BUILD_PROFILE=${input:build cfg}", + "command": "../../scripts/podman_jaby_engine.sh ../../:src/Tools make -C ${input:linux_cargo_task} CARGO_CMD=${input:cargo cmd} BUILD_PROFILE=${input:build cfg}", "problemMatcher": [] } ], @@ -49,7 +49,7 @@ { "id": "cargo cmd", "type":"pickString", - "options": ["build", "check", "update", "upgrade", "clean", "run", "tree"], + "options": ["build", "check", "upgrade", "clean", "run", "tree"], "default": "build", "description": "cargo command to run" } diff --git a/support/src/SupportLibrary.code-workspace b/support/src/SupportLibrary.code-workspace index 540a2256..20041bb3 100644 --- a/support/src/SupportLibrary.code-workspace +++ b/support/src/SupportLibrary.code-workspace @@ -19,7 +19,7 @@ { "label": "make", "type": "shell", - "command": "../../../scripts/podman_jaby_engine.sh ${workspaceFolder}/..!src/FontWriter 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" From 9b9aa3a42c2615cec580bb5af28bf56cce2cc911 Mon Sep 17 00:00:00 2001 From: Jaby Date: Sun, 5 Jan 2025 15:50:30 +0100 Subject: [PATCH 14/25] Update ENV variables for local build --- scripts/podman_jaby_engine.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/podman_jaby_engine.sh b/scripts/podman_jaby_engine.sh index 66538fe7..97df0bb4 100755 --- a/scripts/podman_jaby_engine.sh +++ b/scripts/podman_jaby_engine.sh @@ -18,6 +18,8 @@ mkdir -p $JABY_ENGINE_CARGO_FOLDER podman run --rm -it -v $JABY_ENGINE_CARGO_FOLDER:/root/.cargo/registry -v ${JABY_ENGINE_PATH}:/jaby_engine -v ${PROJECT_PATH}:/project $LICENSE_MOUNT -w /project/$PROJECT_WORK_DIR jaby_engine $@ else echo "WARNING! You are not running in podman" +export JABY_ENGINE_DIR=$JABY_ENGINE_PATH +export PATH="$JABY_ENGINE_PATH/bin:${PATH}" cd $PROJECT_PATH/$PROJECT_WORK_DIR $@ fi \ No newline at end of file From 2a813ed40ef3f1547d8203d2436681954981020e Mon Sep 17 00:00:00 2001 From: Jaby Date: Sun, 5 Jan 2025 15:57:14 +0100 Subject: [PATCH 15/25] Add 32BIT.TMD file --- .gitattributes | 3 ++- bin/extern/32BIT.TMD | 3 +++ examples/PoolBox/iso/Config.xml | 1 - readme.md | 14 ++++++++++---- 4 files changed, 15 insertions(+), 6 deletions(-) create mode 100644 bin/extern/32BIT.TMD diff --git a/.gitattributes b/.gitattributes index b7be3103..47ba9f05 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,4 +1,5 @@ *.xa filter=lfs diff=lfs merge=lfs -text *.wav filter=lfs diff=lfs merge=lfs -text *.png filter=lfs diff=lfs merge=lfs -text -*.mp3 filter=lfs diff=lfs merge=lfs -text \ No newline at end of file +*.mp3 filter=lfs diff=lfs merge=lfs -text +*.TMD filter=lfs diff=lfs merge=lfs -text \ No newline at end of file diff --git a/bin/extern/32BIT.TMD b/bin/extern/32BIT.TMD new file mode 100644 index 00000000..08225d62 --- /dev/null +++ b/bin/extern/32BIT.TMD @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b9b3dca0dd6b7cf7a41642a31743b43b3e9b2185b5dee3ad1f3120940b20fd08 +size 8856 diff --git a/examples/PoolBox/iso/Config.xml b/examples/PoolBox/iso/Config.xml index 2108295b..1a144b2b 100644 --- a/examples/PoolBox/iso/Config.xml +++ b/examples/PoolBox/iso/Config.xml @@ -9,7 +9,6 @@ --> Jaby - %PSX_LICENSE_PATH%/%PSX_LICENSE%.DAT diff --git a/readme.md b/readme.md index 12d5e7cb..8f7d02b5 100644 --- a/readme.md +++ b/readme.md @@ -10,6 +10,7 @@ - [JabyEngine](#jabyengine-1) - [PoolBox](#poolbox) - [Special thanks](#special-thanks) +- [TODO before commit](#todo-before-commit) # JabyEngine ## About @@ -59,9 +60,10 @@ These projects shall eventually turn into useful extensions for the engine. So f # Media creators ## JabyEngine -| Art | Author | -|-----------------------------------------------------------------|--------| -| `ressources\Splash_ntsc.png`
`ressources\Splash_ntsc.png` | Niuka | +| Art | Author | +|-----------------------------------------------------------------|------------------------------------------------------------| +| `ressources\Splash_ntsc.png`
`ressources\Splash_ntsc.png` | Niuka | +| `bin/extern/32BIT.TMD` | http://psx.arthus.net/homebrew/assets/boot_logos/32BIT.TMD | ## PoolBox | Art | Author | @@ -83,4 +85,8 @@ These projects shall eventually turn into useful extensions for the engine. So f * Cody the white tiger * Nicolas Noble * Pyravia -* Sickle \ No newline at end of file +* Sickle + +# TODO before commit +* Remove `wslpath` +* Double check documentation \ No newline at end of file From febebd71b5ef8f9bd69ce7fd04bdc1ec5445119b Mon Sep 17 00:00:00 2001 From: Jaby Date: Sun, 5 Jan 2025 15:58:16 +0100 Subject: [PATCH 16/25] Clean-up simple TODOs --- podman/Dockerfile | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/podman/Dockerfile b/podman/Dockerfile index 47fb9687..7efe3904 100644 --- a/podman/Dockerfile +++ b/podman/Dockerfile @@ -14,18 +14,4 @@ ADD ["scripts/install_pop-fe.sh", "/usr/scripts"] ENV PATH="/jaby_engine/bin:/root/.cargo/bin:${PATH}" ENV JABY_ENGINE_PATH=/jaby_engine ENV JABY_ENGINE_DIR=/jaby_engine -ENV PSX_LICENSE_PATH=/psx_license - -#WORKDIR /usr/src/project - -#RUN apt update && apt install -y nginx - -#RUN mkdir /app -#WORKDIR /app - -#VOLUME my_vol (Do not use) - -#ADD install_pop-fe.sh install_pop-fe.sh -#CMD ["cp", "install_pop-fe.sh", "/my_vol"] - -# TODO: Make a script that builds the image and --then registers alias like `jaby-make` for the docker command-- Cody said alias are bad (yesterday he liked them) and wants scripts instead (He also suddenly claims that he called them invasive but ACTUALLY it was me. Oh noooow he corrects his statement) \ No newline at end of file +ENV PSX_LICENSE_PATH=/psx_license \ No newline at end of file From e4056a98397d8c6eff6d25986f3f46a2bf4ecf30 Mon Sep 17 00:00:00 2001 From: Jaby Date: Tue, 7 Jan 2025 21:40:37 +0100 Subject: [PATCH 17/25] Support pop-fe --- bin/convert2cdda.sh | 6 ---- bin/run_pop_fe.sh | 9 ------ mkfile/ISOMakefile.mk | 2 +- podman/Dockerfile | 5 ++-- podman/scripts/install_pop-fe.sh | 47 ++++++++------------------------ podman/scripts/run_pop_fe.sh | 5 ++++ readme.md | 1 + 7 files changed, 21 insertions(+), 54 deletions(-) delete mode 100644 bin/convert2cdda.sh delete mode 100644 bin/run_pop_fe.sh create mode 100755 podman/scripts/run_pop_fe.sh diff --git a/bin/convert2cdda.sh b/bin/convert2cdda.sh deleted file mode 100644 index 60d16550..00000000 --- a/bin/convert2cdda.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash -#Made possible by Cody the white tiger - -# $1 => Input file -# $2 => Output file -ffmpeg -i $1 -sample_fmt s16 -ar 44100 $2 \ No newline at end of file diff --git a/bin/run_pop_fe.sh b/bin/run_pop_fe.sh deleted file mode 100644 index 630d0868..00000000 --- a/bin/run_pop_fe.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash -#Made possible by Cody the white tiger - -BASEDIR=$(dirname "$0") -cd $BASEDIR -source extern/py3venv/bin/activate - -cd extern/pop-fe/ -./pop-fe.py --title=$1 --ps1-newemu --cover=$2/Icon.png --pic0=$2/Title.png --pic1=$2/Background.png --ps3-pkg="${3%.*}.pkg" $3 \ No newline at end of file diff --git a/mkfile/ISOMakefile.mk b/mkfile/ISOMakefile.mk index c0c85139..4799aa2b 100644 --- a/mkfile/ISOMakefile.mk +++ b/mkfile/ISOMakefile.mk @@ -8,7 +8,7 @@ $(CD_OUTPUT): always $(PKG_OUTPUT): always @mkdir -p $(REGION) @echo "!!PKG generation is experimentel!!" - run_pop_fe.sh $(ARTIFACT) $(PWD)/assets/pkg $(PWD)/iso/$(REGION)/$(ARTIFACT).cue + run_pop_fe.sh $(ARTIFACT) $(shell pwd)/../assets/pkg $(shell pwd)/$(REGION)/$(ARTIFACT).cue all: $(CD_OUTPUT) clean: pkg_clean diff --git a/podman/Dockerfile b/podman/Dockerfile index 7efe3904..c3d1315c 100644 --- a/podman/Dockerfile +++ b/podman/Dockerfile @@ -8,8 +8,9 @@ WORKDIR /usr/scripts ADD ["scripts/install_rust.sh", "/usr/scripts"] RUN apt update && ./install_rust.sh -# TODO: Deal with this eventually -ADD ["scripts/install_pop-fe.sh", "/usr/scripts"] +ADD ["scripts/install_pop-fe.sh", "scripts/run_pop_fe.sh", "/usr/scripts"] +WORKDIR /usr/jaby_engine/bin/extern +RUN apt update && /usr/scripts/install_pop-fe.sh ENV PATH="/jaby_engine/bin:/root/.cargo/bin:${PATH}" ENV JABY_ENGINE_PATH=/jaby_engine diff --git a/podman/scripts/install_pop-fe.sh b/podman/scripts/install_pop-fe.sh index e32a4787..4e6555b6 100755 --- a/podman/scripts/install_pop-fe.sh +++ b/podman/scripts/install_pop-fe.sh @@ -1,42 +1,17 @@ #!/bin/bash -#Made possible by Cody the white tiger +# Made possible by Cody the white tiger -BASEDIR=$(dirname "$0") -mkdir -p $BASEDIR/../bin/extern/ -cd $BASEDIR/../bin/extern +echo "<<< Install pop-fe >>>" +apt-get install -y cmake python-is-python3 python3 python3-pip python3-venv pkg-config libiso9660-dev libsndfile1-dev swig libsndfile-dev ffmpeg mame-tools cmake wget unzip -sudo apt install -y python3 python3-pip python3-venv pkg-config libiso9660-dev libsndfile1-dev swig -if ! test -d py3venv; then - python3 -m venv py3venv -fi -source py3venv/bin/activate -pip3 install ecdsa wheel pillow rarfile PyPDF2 requests opencv-contrib-python pycryptodome pycdio pycdlib - -if ! test -d pop-fe; then - git clone https://github.com/sahlberg/pop-fe -fi - -if ! test -d Cue2cu2; then - git clone https://github.com/NRGDEAD/Cue2cu2 - cp Cue2cu2/cue2cu2.py pop-fe -fi +git clone --recursive https://github.com/sahlberg/pop-fe +pip3 install pytubefix PyPDF2 requests pycdlib ecdsa tkinterdnd2 opencv-contrib-python rarfile scikit-learn scipy +make -C pop-fe/PSL1GHT/tools/ps3py/ +cmake -B pop-fe/atracdenc/src/ -S pop-fe/atracdenc/src/ +make -C pop-fe/atracdenc/src/ cd pop-fe -if ! test -d atracdenc; then - git clone https://github.com/dcherednik/atracdenc.git - cd atracdenc/src/ - cmake . - make - cd ../.. -fi +./pop-fe.py --install -if ! test -d PSL1GHT; then - git clone https://github.com/sahlberg/PSL1GHT - cd PSL1GHT/tools/ps3py - git checkout origin/use-python3 - make -fi - -#if ! test -f /usr/local/bin/python; then -# sudo ln -s $(which python3) /usr/local/bin/python -#fi +echo "<<< Register pop-fe >>>" +ln -s /usr/scripts/run_pop_fe.sh /usr/local/bin/run_pop_fe.sh \ No newline at end of file diff --git a/podman/scripts/run_pop_fe.sh b/podman/scripts/run_pop_fe.sh new file mode 100755 index 00000000..5f5c7be1 --- /dev/null +++ b/podman/scripts/run_pop_fe.sh @@ -0,0 +1,5 @@ +#!/bin/bash +# Made possible by Cody the white tiger + +cd /usr/jaby_engine/bin/extern/pop-fe +./pop-fe.py --title=$1 --ps1-newemu --cover=$2/Icon.png --pic0=$2/Title.png --pic1=$2/Background.png --ps3-pkg="${3%.*}.pkg" $3 \ No newline at end of file diff --git a/readme.md b/readme.md index 8f7d02b5..70278081 100644 --- a/readme.md +++ b/readme.md @@ -89,4 +89,5 @@ These projects shall eventually turn into useful extensions for the engine. So f # TODO before commit * Remove `wslpath` +* Verify template creation * Double check documentation \ No newline at end of file From 13fde35cd04b4bccfa8dfd38ef4c1a762d0717d4 Mon Sep 17 00:00:00 2001 From: Jaby Date: Tue, 7 Jan 2025 22:02:14 +0100 Subject: [PATCH 18/25] Fix Support library build mess --- support/src/Makefile | 8 ++++---- support/src/SupportLibrary.code-workspace | 6 +----- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/support/src/Makefile b/support/src/Makefile index 923279d5..dc95c529 100644 --- a/support/src/Makefile +++ b/support/src/Makefile @@ -1,6 +1,6 @@ -FontWriter: always +.PHONY: FontWriter + +FontWriter: $(MAKE) -C $(JABY_ENGINE_DIR)/support/src/FontWriter $(MAKECMDGOALS) -all: FontWriter - -always: ; \ No newline at end of file +all: FontWriter \ No newline at end of file diff --git a/support/src/SupportLibrary.code-workspace b/support/src/SupportLibrary.code-workspace index 20041bb3..1c8ddf84 100644 --- a/support/src/SupportLibrary.code-workspace +++ b/support/src/SupportLibrary.code-workspace @@ -19,11 +19,7 @@ { "label": "make", "type": "shell", - "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" - }, + "command": "../../scripts/podman_jaby_engine.sh ${workspaceFolder}/..:src/FontWriter make ${input:target} BUILD_PROFILE=${input:build cfg}", "group": "build" } ], From 9fc9508734f87c4232981d2d940c3bf3078fc21e Mon Sep 17 00:00:00 2001 From: Jaby Date: Tue, 7 Jan 2025 22:25:40 +0100 Subject: [PATCH 19/25] Use specific Rust version --- podman/scripts/install_rust.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/podman/scripts/install_rust.sh b/podman/scripts/install_rust.sh index 6a30f7c0..977fad28 100755 --- a/podman/scripts/install_rust.sh +++ b/podman/scripts/install_rust.sh @@ -2,8 +2,8 @@ echo "<<< Install Rust prerequisites >>>" apt install -y curl -# TODO: Specific version?? -echo "<<< Install Rust >>>" -curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y +RUST_VERSION=1.78.0 +echo "<<< Install Rust $RUST_VERSION >>>" +curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --default-toolchain=$RUST_VERSION -y . "$HOME/.cargo/env" cargo install cargo-edit --locked \ No newline at end of file From be94ff487fc2df65676569f39b6f8ee88e8f11b9 Mon Sep 17 00:00:00 2001 From: Jaby Date: Tue, 7 Jan 2025 22:40:48 +0100 Subject: [PATCH 20/25] Update readme for podman changes --- readme.md | 44 +++++++++++++++++++++++--------------------- 1 file changed, 23 insertions(+), 21 deletions(-) diff --git a/readme.md b/readme.md index 70278081..9447f980 100644 --- a/readme.md +++ b/readme.md @@ -1,9 +1,9 @@ - [JabyEngine](#jabyengine) - [About](#about) - - [Podman](#podman) - [How to build](#how-to-build) - - [Building `JabyEngine` (without VSCode)](#building-jabyengine-without-vscode) - - [Building support library (without VSCode)](#building-support-library-without-vscode) + - [Building `Tools` (without VS Code)](#building-tools-without-vs-code) + - [Building `JabyEngine` (without VS Code)](#building-jabyengine-without-vs-code) + - [Building support library (without VS Code)](#building-support-library-without-vs-code) - [`FontWriter` (without VSCode)](#fontwriter-without-vscode) - [Building `PoolBox` (without VSCode)](#building-poolbox-without-vscode) - [Media creators](#media-creators) @@ -16,34 +16,37 @@ ## About JabyEngine is my personal attempt to eventually make my own PS1 game from "ground up". Originally I didn't indented to release this code publicly but recently I decided to give it a try. If you read this, thank you! -## Podman -* `sudo apt install podman` -* `podman build -t jaby_engine ` -* `podman images`: lists all images -* `podman image rm `: removes an image -* `podman run -it /bin/bash`: runs bash and interactive -* `podman run --rm <-v : <-e ENV_VAR=VALUE> jaby_engine`: clean up after run -* `podman image tree `: lists usefull information -* `podman run --rm -it -v ${JABY_ENGINE_PATH}:${JABY_ENGINE_PATH} jaby_engine /bin/bash` maybe a good idea...? -* `${JABY_ENGINE_PATH}/scripts/podman_jaby_engine.sh make all BUILD_PROFILE=release PSX_TV_FORMAT=PAL CUSTOM_CONFIG=` - ## How to build -JabyEngine relies on linux to be build. For Windows users it uses `wsl` instead but support for it might get dropped during further development. +JabyEngine can be build with a docker image using `podman`. Simply run the `install.sh` script from the `podman` folder and you should be good to go. + +`podman_jaby_engine.sh` allows you to easily run the docker image for builds: +`podman_jaby_engine.sh : <...>` The following environment variables should be set: -* `JABY_ENGINE_PATH`: The path to the root folder of this repo +* `JABY_ENGINE_PATH`: The path to the root folder of this repo. If you used the `install.sh` script and the environment variable was not set, the script will have set it to the folder. Restarting the shell or VS Code might be required. * `PSX_LICENSE_PATH`: The path to a folder containing the PS1 licenses for generating a CD. Additionally you can also specify the following optional environment variables: -* `JABY_ENGINE_NO_DOCKER`: Turns off usage of `podman` for build. This is only recommended for specific development. +* `JABY_ENGINE_NO_DOCKER`: Turns off the usage of `podman` for builds. This is only recommended for specific development. -### Building `JabyEngine` (without VSCode) +VS Code has build targets set for all the projects which should be build in this order: +* `src/Tools/Tools.code-workspace`: Build all tools +* `src/Library/Library.code-workspace`: Build JabyEngine for the configurations you need +* `support/src/SupportLibrary.code-workspace` (optional): Build for using support code +* `examples/PoolBox/PoolBox.code-workspace`(optional): Build for an example "game" + +### Building `Tools` (without VS Code) +`make` requires the following values to be passed: +* `CARGO_CMD`: `build` +* `BUILD_PROFILE`: `debug`/`release` + +### Building `JabyEngine` (without VS Code) `make` requires the following values to be passed: * `BUILD_PROFILE`: `debug`/`release` * `PSX_TV_FORMAT`: `PAL`/`NTSC` * `CUSTOM_CONFIG`: Empty or folder name under `./config` -### Building support library (without VSCode) +### Building support library (without VS Code) These projects shall eventually turn into useful extensions for the engine. So far they are more tests then proper code. However `PoolBox` is depended on `FontWriter`. #### `FontWriter` (without VSCode) @@ -89,5 +92,4 @@ These projects shall eventually turn into useful extensions for the engine. So f # TODO before commit * Remove `wslpath` -* Verify template creation -* Double check documentation \ No newline at end of file +* Verify template creation \ No newline at end of file From a043783beb1d8e6da7ba3a012923309c1a5eb061 Mon Sep 17 00:00:00 2001 From: Jaby Date: Tue, 7 Jan 2025 23:17:07 +0100 Subject: [PATCH 21/25] Update scripts and template for VS Code --- examples/PoolBox/PoolBox.code-workspace | 2 +- podman/scripts/install_pop-fe.sh | 2 +- podman/scripts/install_rust.sh | 2 +- podman/scripts/make_gcc.sh | 2 +- podman/scripts/run_pop_fe.sh | 2 +- readme.md | 5 ----- .../#{ProjectName}.code-workspace | 21 +++---------------- template/install.bat | 6 ------ template/install.sh | 6 ++++++ 9 files changed, 14 insertions(+), 34 deletions(-) delete mode 100644 template/install.bat create mode 100755 template/install.sh diff --git a/examples/PoolBox/PoolBox.code-workspace b/examples/PoolBox/PoolBox.code-workspace index 5df127c7..ddada09d 100644 --- a/examples/PoolBox/PoolBox.code-workspace +++ b/examples/PoolBox/PoolBox.code-workspace @@ -20,7 +20,7 @@ { "label": "read memory map", "type": "shell", - "command": "${env:JABY_ENGINE_PATH}/bin/psxreadmap ${input:output memory map} application/bin/PAL/PSX-${input:build profile}/PoolBox.elf", + "command": "${env:JABY_ENGINE_PATH}/bin/psxreadmap ${input:output memory map} application/bin/${input:tv format}/PSX-${input:build profile}/PoolBox.elf", "problemMatcher": [], } ], diff --git a/podman/scripts/install_pop-fe.sh b/podman/scripts/install_pop-fe.sh index 4e6555b6..8925858f 100755 --- a/podman/scripts/install_pop-fe.sh +++ b/podman/scripts/install_pop-fe.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # Made possible by Cody the white tiger echo "<<< Install pop-fe >>>" diff --git a/podman/scripts/install_rust.sh b/podman/scripts/install_rust.sh index 977fad28..1ad8759e 100755 --- a/podman/scripts/install_rust.sh +++ b/podman/scripts/install_rust.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash echo "<<< Install Rust prerequisites >>>" apt install -y curl diff --git a/podman/scripts/make_gcc.sh b/podman/scripts/make_gcc.sh index fc29bbb9..9e2a219c 100755 --- a/podman/scripts/make_gcc.sh +++ b/podman/scripts/make_gcc.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash echo "<<< Install GCC prerequisites >>>" apt install -y make texinfo g++ gcc git libgmp3-dev libmpfr-dev libmpc-dev flex install-info info bison diff --git a/podman/scripts/run_pop_fe.sh b/podman/scripts/run_pop_fe.sh index 5f5c7be1..06a4497d 100755 --- a/podman/scripts/run_pop_fe.sh +++ b/podman/scripts/run_pop_fe.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # Made possible by Cody the white tiger cd /usr/jaby_engine/bin/extern/pop-fe diff --git a/readme.md b/readme.md index 9447f980..f6610118 100644 --- a/readme.md +++ b/readme.md @@ -10,7 +10,6 @@ - [JabyEngine](#jabyengine-1) - [PoolBox](#poolbox) - [Special thanks](#special-thanks) -- [TODO before commit](#todo-before-commit) # JabyEngine ## About @@ -89,7 +88,3 @@ These projects shall eventually turn into useful extensions for the engine. So f * Nicolas Noble * Pyravia * Sickle - -# TODO before commit -* Remove `wslpath` -* Verify template creation \ No newline at end of file diff --git a/template/JabyEngine-PSX_Game/#{ProjectName}.code-workspace b/template/JabyEngine-PSX_Game/#{ProjectName}.code-workspace index 4e1124dc..b733125f 100644 --- a/template/JabyEngine-PSX_Game/#{ProjectName}.code-workspace +++ b/template/JabyEngine-PSX_Game/#{ProjectName}.code-workspace @@ -11,32 +11,17 @@ { "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}", - }, + "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}", "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}/#{ProjectName}.elf", + "command": "${env:JABY_ENGINE_PATH}/bin/psxreadmap ${input:output memory map} application/bin/${input:tv format}/PSX-${input:build profile}/#{ProjectName}.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/template/install.bat b/template/install.bat deleted file mode 100644 index 2a89868b..00000000 --- a/template/install.bat +++ /dev/null @@ -1,6 +0,0 @@ -echo off -set dst_name=JabyEngine-PSX_Game -set dst="%APPDATA%\Code\User\ProjectTemplates\%dst_name%" - -mkdir %dst% -xcopy /s %dst_name% %dst% \ No newline at end of file diff --git a/template/install.sh b/template/install.sh new file mode 100755 index 00000000..869216ac --- /dev/null +++ b/template/install.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash +dst_name=JabyEngine-PSX_Game +dst="$HOME/.config/Code/User/ProjectTemplates" + +mkdir -p $dst +cp -r "$dst_name" "$dst" \ No newline at end of file From 835eed47dae4db62ae897c650f6512e7513e7a77 Mon Sep 17 00:00:00 2001 From: Jaby Date: Tue, 7 Jan 2025 23:20:18 +0100 Subject: [PATCH 22/25] Recommend Project Temapltes --- src/Library/Library.code-workspace | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Library/Library.code-workspace b/src/Library/Library.code-workspace index 70508534..d63328b3 100644 --- a/src/Library/Library.code-workspace +++ b/src/Library/Library.code-workspace @@ -71,7 +71,7 @@ ] }, "extensions": { - "recommendations": ["augustocdias.tasks-shell-input"] + "recommendations": ["augustocdias.tasks-shell-input", "cantonios.project-templates"] }, "settings": { "cmake.configureOnOpen": false, From 6383e7b97c24dd9833da977543723d215defe03c Mon Sep 17 00:00:00 2001 From: Jaby Date: Wed, 8 Jan 2025 22:13:27 +0100 Subject: [PATCH 23/25] Update PR --- podman/Dockerfile | 3 ++- podman/install.sh | 18 +++++++++++------- podman/scripts/make_gcc.sh | 2 +- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/podman/Dockerfile b/podman/Dockerfile index c3d1315c..c278cf2d 100644 --- a/podman/Dockerfile +++ b/podman/Dockerfile @@ -1,7 +1,7 @@ FROM "ubuntu:22.04" WORKDIR /usr/scripts ADD ["scripts/make_gcc.sh", "/usr/scripts"] -WORKDIR /usr +WORKDIR /tmp RUN apt update && /usr/scripts/make_gcc.sh WORKDIR /usr/scripts @@ -12,6 +12,7 @@ ADD ["scripts/install_pop-fe.sh", "scripts/run_pop_fe.sh", "/usr/scripts"] WORKDIR /usr/jaby_engine/bin/extern RUN apt update && /usr/scripts/install_pop-fe.sh +WORKDIR /project ENV PATH="/jaby_engine/bin:/root/.cargo/bin:${PATH}" ENV JABY_ENGINE_PATH=/jaby_engine ENV JABY_ENGINE_DIR=/jaby_engine diff --git a/podman/install.sh b/podman/install.sh index 73f40ff9..7c514c63 100755 --- a/podman/install.sh +++ b/podman/install.sh @@ -2,12 +2,16 @@ podman build -t jaby_engine . if [[ -z "${JABY_ENGINE_PATH}" ]]; then -echo "Setting JABY_ENGINE_PATH to parent folder" + echo "Setting JABY_ENGINE_PATH to parent folder" -SCRIPT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &> /dev/null && pwd)" -JABY_ENGINE_PATH="$(dirname "$SCRIPT_DIR")" -cat << End >> ~/.profile -export JABY_ENGINE_PATH="$JABY_ENGINE_PATH" -End -source ~/.profile + SCRIPT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &> /dev/null && pwd)" + export JABY_ENGINE_PATH="$(dirname "$SCRIPT_DIR")" + if cat /etc/passwd | grep $USER | grep bash > /dev/null; then + # Bash found + echo "export JABY_ENGINE_PATH="$JABY_ENGINE_PATH"" >> ~/.bashrc + + else + # No bash found + echo "Please add export JABY_ENGINE_PATH="$JABY_ENGINE_PATH" to your shell profile" + fi fi \ No newline at end of file diff --git a/podman/scripts/make_gcc.sh b/podman/scripts/make_gcc.sh index 9e2a219c..a6331421 100755 --- a/podman/scripts/make_gcc.sh +++ b/podman/scripts/make_gcc.sh @@ -61,5 +61,5 @@ if [ $? -ne 0 ]; then fi echo "<<< Delete GCC folder >>>" -cd /usr +cd /tmp rm -fr psx-gcc \ No newline at end of file From 4c746631deda0a5995c9ad170dcb48aa950bed8c Mon Sep 17 00:00:00 2001 From: Jaby Date: Wed, 8 Jan 2025 22:16:54 +0100 Subject: [PATCH 24/25] Update template install script --- template/install.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/template/install.sh b/template/install.sh index 869216ac..8e09094a 100755 --- a/template/install.sh +++ b/template/install.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -dst_name=JabyEngine-PSX_Game +src=JabyEngine-PSX_Game dst="$HOME/.config/Code/User/ProjectTemplates" mkdir -p $dst -cp -r "$dst_name" "$dst" \ No newline at end of file +cp -r "$src" "$dst" \ No newline at end of file From 606905f954b8b0850f932b9d2a37e0a24b1d5e89 Mon Sep 17 00:00:00 2001 From: Jaby Date: Wed, 8 Jan 2025 22:18:35 +0100 Subject: [PATCH 25/25] Try again --- template/install.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/template/install.sh b/template/install.sh index 8e09094a..ddaf4f52 100755 --- a/template/install.sh +++ b/template/install.sh @@ -1,6 +1,5 @@ #!/usr/bin/env bash -src=JabyEngine-PSX_Game dst="$HOME/.config/Code/User/ProjectTemplates" mkdir -p $dst -cp -r "$src" "$dst" \ No newline at end of file +cp -r "JabyEngine-PSX_Game" "$dst" \ No newline at end of file