mirror of
https://github.com/ACreTeam/ac-decomp
synced 2026-07-07 20:11:51 -04:00
Miscellaneous Docker fixes (#412)
* Skip compiler download if user has them already (Docker Windows) * Use Expand-Archive instead of tar to extract zip on Windows * Return to using latest wibo in Dockerfile * Switch wibo to latest version in guide also improve formatting a bit * Skip compiler download if user has them already (Docker Mac/Linux) * Slightly optimize error handling * Make docker upgrade packages on build * add compiler readmes to .gitignore * add compiler folders to .gitignore this is better than just the readmes just in case anything inside the zip changes in the future * Fix newline * Re-add command that was deleted by accident
This commit is contained in:
@@ -25,3 +25,6 @@ src/data/bin2
|
||||
objdiff.json
|
||||
src/data/item/player_room_floor
|
||||
src/data/item/player_room_wall
|
||||
tools/1.2.5n/
|
||||
tools/1.3.2r/
|
||||
tools/1.3.2/
|
||||
|
||||
+2
-1
@@ -2,6 +2,7 @@ FROM ubuntu:24.04 as build
|
||||
|
||||
# --- basic package installation ---
|
||||
RUN apt-get update && \
|
||||
apt-get upgrade -y && \
|
||||
apt-get install -y \
|
||||
git \
|
||||
ninja-build \
|
||||
@@ -17,7 +18,7 @@ RUN pip install --break-system-packages -r /temp/requirements.txt
|
||||
RUN rm -rf /temp
|
||||
|
||||
# --- wibo installation ---
|
||||
RUN wget https://github.com/decompals/wibo/releases/download/0.6.13/wibo
|
||||
RUN wget https://github.com/decompals/wibo/releases/latest/download/wibo
|
||||
RUN install ./wibo /usr/bin
|
||||
RUN rm wibo
|
||||
|
||||
|
||||
@@ -14,7 +14,8 @@ Use `--recursive` when cloning to have ppcdis in the repository.
|
||||
|
||||
## Building
|
||||
|
||||
> ℹ️ On Windows, the build is known to run disproportionately slow when ran natively, so we recommend using WSL.
|
||||
> [!NOTE]
|
||||
> On Windows, the build is known to run disproportionately slow when ran natively, so we recommend using WSL.
|
||||
|
||||
### Docker
|
||||
|
||||
@@ -27,16 +28,17 @@ Use `--recursive` when cloning to have ppcdis in the repository.
|
||||
|
||||
### Build manually
|
||||
|
||||
> ℹ️ When building manually from a work directory previously used for Docker, you will need to run `sudo ninja -t clean` for the build to execute properly.
|
||||
> [!TIP]
|
||||
> When building manually from a work directory previously used for Docker, you will need to run `sudo ninja -t clean` for the build to execute properly.
|
||||
|
||||
1. [Dump a copy of the game](./docs/extract_game.md) and extract all files.
|
||||
2. Place **main.dol**, **foresta.rel.szs**, **forest_1st.arc**, and **forest_2nd.arc** in *dump/*.
|
||||
3. Download the [CodeWarrior 1.3.2, 1.3.2r, and 1.2.5n compilers](https://files.decomp.dev/compilers_latest.zip) and extract them to *tools/1.3.2/*, *tools/1.3.2r/*, and *tools/1.2.5n/*, respectively.
|
||||
4. Install Python, pip, and [ninja](https://github.com/ninja-build/ninja/wiki/Pre-built-Ninja-packages#package-managers) using your package manager of choice.
|
||||
5. Install Python modules from requirements.txt (`pip install -r requirements.txt`).
|
||||
6. Install version 0.6.13 of [wibo](https://github.com/decompals/wibo)
|
||||
6. Install [wibo](https://github.com/decompals/wibo)
|
||||
- Wibo is a lightweight Wine replacement that's tailor-made for use with decomp projects. Regular Wine can be used if preferred, but for the purposes of this guide, these instructions will use wibo.
|
||||
- Download the [GitHub release of version 0.6.13](https://github.com/decompals/wibo/releases/tag/0.6.13) and run `install ./wibo /usr/bin` to install it to your system.
|
||||
- Download the [the latest GitHub release](https://github.com/decompals/wibo/releases/latest) and run `install ./wibo /usr/bin` to install it to your system.
|
||||
7. Install devkitPPC.
|
||||
- To get devkitPPC, you'll need [devkitPro Pacman](https://devkitpro.org/wiki/devkitPro_pacman#Installing_devkitPro_Pacman).
|
||||
- Run `dkp-pacman -S devkitPPC` once dkp-pacman is installed to install devkitPPC.
|
||||
|
||||
+19
-8
@@ -1,15 +1,26 @@
|
||||
@echo off
|
||||
echo "Please ensure Docker Desktop is running before continuing."
|
||||
pause
|
||||
curl -O https://files.decomp.dev/compilers_latest.zip
|
||||
mkdir compilers_temp
|
||||
tar -xf compilers_latest.zip -C compilers_temp
|
||||
xcopy compilers_temp\GC\1.2.5n\ tools\1.2.5n\ /E /I
|
||||
xcopy compilers_temp\GC\1.3.2\ tools\1.3.2\ /E /I
|
||||
xcopy compilers_temp\GC\1.3.2r\ tools\1.3.2r\ /E /I
|
||||
del compilers_latest.zip
|
||||
rmdir /S /Q compilers_temp\
|
||||
:: Check if the compilers are present. If any one compiler doesn't exist, the download process will be initiated.
|
||||
IF exist tools\1.2.5n\ ( echo 1.2.5n exists ) ELSE ( goto compilers )
|
||||
IF exist tools\1.3.2\ ( echo 1.3.2 exists ) ELSE ( goto compilers )
|
||||
IF exist tools\1.3.2r\ ( echo 1.3.2r exists ) ELSE ( goto compilers )
|
||||
goto buildimage
|
||||
|
||||
:buildimage
|
||||
docker build -t ac-decomp .
|
||||
echo "Docker image setup is now complete. You may proceed with the instructions."
|
||||
pause
|
||||
exit
|
||||
|
||||
:compilers
|
||||
curl -O https://files.decomp.dev/compilers_latest.zip
|
||||
mkdir compilers_temp
|
||||
powershell -command "Expand-Archive -LiteralPath 'compilers_latest.zip' -DestinationPath compilers_temp"
|
||||
:: Only copy compilers that the user doesn't already have.
|
||||
IF exist tools\1.2.5n\ ( echo 1.2.5n already exists, skipping copy ) ELSE ( xcopy compilers_temp\GC\1.2.5n\ tools\1.2.5n\ /E /I )
|
||||
IF exist tools\1.3.2\ ( echo 1.3.2 already exists, skipping copy ) ELSE ( xcopy compilers_temp\GC\1.3.2\ tools\1.3.2\ /E /I )
|
||||
IF exist tools\1.3.2r\ ( echo 1.3.2r already exists, skipping copy ) ELSE ( xcopy compilers_temp\GC\1.3.2r\ tools\1.3.2r\ /E /I )
|
||||
del compilers_latest.zip
|
||||
rmdir /S /Q compilers_temp\
|
||||
goto buildimage
|
||||
|
||||
+10
-3
@@ -1,5 +1,11 @@
|
||||
echo "Please ensure Docker is installed before continuing."
|
||||
read -p "Press Enter to continue or CTRL-C to exit."
|
||||
if [ -d "tools/1.2.5n" ]; then echo "1.2.5n exists" && export one_two_five_n_exist=1; fi
|
||||
if [ -d "tools/1.3.2" ]; then echo "1.3.2 exists" && export one_three_two_exist=1; fi
|
||||
if [ -d "tools/1.3.2r" ]; then echo "1.3.2r exists" && export one_three_two_r_exist=1; fi
|
||||
if [ "$one_two_five_n_exist" -eq 1 ] && [ "$one_three_two_exist" -eq 1 ] && [ "$one_three_two_r_exist" -eq 1 ]; then docker build -t ac-decomp . && echo "Docker image setup is now complete. You may proceed with the instructions." && exit; fi
|
||||
|
||||
|
||||
if command -v curl &> /dev/null; then
|
||||
curl -O https://files.decomp.dev/compilers_latest.zip
|
||||
elif command -v wget &> /dev/null; then
|
||||
@@ -14,11 +20,12 @@ if command -v unzip &> /dev/null; then
|
||||
unzip compilers_latest.zip -d compilers_temp
|
||||
else
|
||||
echo "You do not seem to have unzip installed on this system. Please install it to continue."
|
||||
rm compilers_latest.zip
|
||||
rm -r compilers_temp
|
||||
rm -r compilers_temp compilers_latest.zip
|
||||
exit 1
|
||||
fi
|
||||
mv compilers_temp/GC/1.2.5n/ tools/ && mv compilers_temp/GC/1.3.2/ tools/ && mv compilers_temp/GC/1.3.2r/ tools/
|
||||
if [ ! -d "tools/1.2.5n" ]; then mv compilers_temp/GC/1.2.5n/ tools/; fi
|
||||
if [ ! -d "tools/1.3.2" ]; then mv compilers_temp/GC/1.3.2/ tools/; fi
|
||||
if [ ! -d "tools/1.3.2r" ]; then mv compilers_temp/GC/1.3.2r/ tools/; fi
|
||||
rm -r compilers_temp compilers_latest.zip
|
||||
docker build -t ac-decomp .
|
||||
echo "Docker image setup is now complete. You may proceed with the instructions."
|
||||
|
||||
Reference in New Issue
Block a user