From a48d6b03d6e1c370bd61ac8aa70c3235ee51c626 Mon Sep 17 00:00:00 2001 From: Andrew Houts Date: Tue, 31 Mar 2020 20:11:48 -0700 Subject: [PATCH 1/2] add docker config --- Dockerfile | 13 +++++++++++++ README.md | 27 +++++++++++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..98c41395 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,13 @@ +FROM ubuntu:latest + +RUN apt update +RUN apt install -y wget build-essential pkg-config git binutils-mips-linux-gnu python3 zlib1g-dev libaudiofile-dev bsdmainutils + +RUN wget https://github.com/n64decomp/qemu-irix/releases/download/v2.11-deb/qemu-irix-2.11.0-2169-g32ab296eef_amd64.deb +RUN dpkg -i qemu-irix-2.11.0-2169-g32ab296eef_amd64.deb + +RUN mkdir /sm64 +WORKDIR /sm64 +ENV PATH="/sm64/tools:${PATH}" + +CMD echo 'usage: docker run --rm --mount type=bind,source="$(pwd)",destination=/sm64 sm64 make VERSION= -j4' diff --git a/README.md b/README.md index 6754e1c8..511021d7 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,33 @@ A prior copy of the game is required to extract the required assets. ## Installation +### Docker + +#### 1. Copy baserom(s) for asset extraction + +For each version (jp/us/eu) that you want to build a ROM for, put an existing ROM at +`./baserom..z64` for asset extraction. + +#### 2. Create docker image + +```bash +docker build -t sm64 . +``` + +#### 3. Build + +To build we simply have to mount our local filesystem into the docker container and build. + +```bash +# for example if you have baserom.us.z64 in the project root +docker run --rm --mount type=bind,source="$(pwd)",destination=/sm64 sm64 make VERSION=us -j4 + +# if your host system is linux you need to tell docker what user should own the output files +docker run --rm --mount type=bind,source="$(pwd)",destination=/sm64 --user "$(id -u):$(id -g)" sm64 make VERSION=us -j4 +``` + +Resulting artifacts can be found in the `build` directory. + ### Linux #### 1. Copy baserom(s) for asset extraction From 0987c9c91dd8b89c869dc852bc90ffd13f59cd70 Mon Sep 17 00:00:00 2001 From: Andrew Houts Date: Thu, 2 Apr 2020 10:50:36 -0700 Subject: [PATCH 2/2] incorporate streetster's suggestions --- Dockerfile | 25 +++++++++++++++++++------ README.md | 2 +- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index 98c41395..dbc31e2a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,13 +1,26 @@ -FROM ubuntu:latest +FROM ubuntu:18.04 as build -RUN apt update -RUN apt install -y wget build-essential pkg-config git binutils-mips-linux-gnu python3 zlib1g-dev libaudiofile-dev bsdmainutils +RUN apt-get update && \ + apt-get install -y \ + binutils-mips-linux-gnu \ + bsdmainutils \ + build-essential \ + libaudiofile-dev \ + pkg-config \ + python3 \ + wget \ + zlib1g-dev -RUN wget https://github.com/n64decomp/qemu-irix/releases/download/v2.11-deb/qemu-irix-2.11.0-2169-g32ab296eef_amd64.deb -RUN dpkg -i qemu-irix-2.11.0-2169-g32ab296eef_amd64.deb +RUN wget \ + https://github.com/n64decomp/qemu-irix/releases/download/v2.11-deb/qemu-irix-2.11.0-2169-g32ab296eef_amd64.deb \ + -O qemu.deb && \ + echo 8170f37cf03a08cc2d7c1c58f10d650ea0d158f711f6916da9364f6d8c85f741 qemu.deb | sha256sum --check && \ + dpkg -i qemu.deb && \ + rm qemu.deb RUN mkdir /sm64 WORKDIR /sm64 ENV PATH="/sm64/tools:${PATH}" -CMD echo 'usage: docker run --rm --mount type=bind,source="$(pwd)",destination=/sm64 sm64 make VERSION= -j4' +CMD echo 'usage: docker run --rm --mount type=bind,source="$(pwd)",destination=/sm64 sm64 make VERSION=${VERSION:-us} -j4\n' \ + 'see https://github.com/n64decomp/sm64/blob/master/README.md for advanced usage' diff --git a/README.md b/README.md index 511021d7..8ed1a3c7 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,7 @@ To build we simply have to mount our local filesystem into the docker container docker run --rm --mount type=bind,source="$(pwd)",destination=/sm64 sm64 make VERSION=us -j4 # if your host system is linux you need to tell docker what user should own the output files -docker run --rm --mount type=bind,source="$(pwd)",destination=/sm64 --user "$(id -u):$(id -g)" sm64 make VERSION=us -j4 +docker run --rm --mount type=bind,source="$(pwd)",destination=/sm64 --user $UID:$UID sm64 make VERSION=us -j4 ``` Resulting artifacts can be found in the `build` directory.