diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..8647c2fc --- /dev/null +++ b/Dockerfile @@ -0,0 +1,41 @@ +FROM ubuntu:20.04 as build +ENV TZ=Etc/UTC +RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone + +# Install dependencies +## apt install python & libraries +RUN apt-get update && \ + apt-get install -y \ + python3 \ + python3-pip \ + libjpeg-dev \ + zlib1g-dev \ + libsdl2-dev \ + git \ + wget + +## install python dependencies +COPY requirements.txt /tmp/ +RUN pip3 install -r /tmp/requirements.txt + +## Windows build dependencies +#RUN apt-get install -y \ +# binutils-mingw-w64 +#RUN apt-get install -y \ +# tcc \ +# unzip + +## Switch build dependencies +### Install devkitpro for switch build +#RUN wget https://apt.devkitpro.org/install-devkitpro-pacman && \ +# chmod +x ./install-devkitpro-pacman && \ +# sed -i 's/apt-get/apt-get -y /g' ./install-devkitpro-pacman && \ +# ./install-devkitpro-pacman +### Install switch development tools +#RUN ln -s /proc/self/mounts /etc/mtab +#RUN dkp-pacman --noconfirm -S switch-dev switch-sdl2 switch-tools + +RUN mkdir /zelda3 +WORKDIR /zelda3 + +CMD echo 'usage: docker run --rm --mount type=bind,source="$(pwd)",destination=/zelda3 zelda3 make' \ No newline at end of file diff --git a/README.md b/README.md index fee61e3d..e6ebb712 100644 --- a/README.md +++ b/README.md @@ -109,6 +109,28 @@ make # Add -j$(nproc) to build using all cores ( Optional ) nxlink -s zelda3.nro ``` +## Building using Docker +In case you have Docker/Podman intalled you can build a docker image using the `Dockerfile` instead of using the above methods. + +### Build the Docker Image + +This only needs to be done one time unless the `Dockerfile` has been updated/changed + +Clone this repo first + +Make sure you are in the root path of this repo +```sh +docker build . -t zelda3 +``` + +### Build the game +Ensure the rom named zelda3.sfc is in the `tables` directory + +#### Build for Linux +```sh +docker run --rm --mount type=bind,source="$(pwd)",destination=/zelda3 zelda3 make +``` + ## More Compilation Help Look at the wiki at https://github.com/snesrev/zelda3/wiki for more help.