1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-08-06 22:30:15 +00:00

Building on Macs (#1086)

* git subrepo pull (merge) tools/ZAPD

subrepo:
  subdir:   "tools/ZAPD"
  merged:   "945e6ca1a"
upstream:
  origin:   "https://github.com/zeldaret/ZAPD.git"
  branch:   "master"
  commit:   "50242eca9"
git-subrepo:
  version:  "0.4.3"
  origin:   "https://github.com/ingydotnet/git-subrepo.git"
  commit:   "2f68596"

* Fix extract_assets.py multithreading

* Update binutils doc a bit

* Remove * import, add multiprocessing option
and way to pass arguments to ZAPD

* Update format.sh to be more platform-independent

* git subrepo pull --force tools/ZAPD

subrepo:
  subdir:   "tools/ZAPD"
  merged:   "fd5a7f434"
upstream:
  origin:   "https://github.com/zeldaret/ZAPD.git"
  branch:   "master"
  commit:   "fd5a7f434"
git-subrepo:
  version:  "0.4.3"
  origin:   "https://github.com/ingydotnet/git-subrepo.git"
  commit:   "2f68596"

* Remove ;

* Update formatting script to not just use 11

* Add Python requirements,
move the Mac stuff in the README into its own doc

* Fix readme link

* Minor format thing

* .

* Move ZAPDArgs into its own function

* Update readme and remove requirements.txt

* Dragorn-inspired rewrite of processZAPDArgs

* git subrepo pull --force tools/ZAPD

subrepo:
  subdir:   "tools/ZAPD"
  merged:   "a0d3f7b68"
upstream:
  origin:   "https://github.com/zeldaret/ZAPD.git"
  branch:   "master"
  commit:   "a0d3f7b68"
git-subrepo:
  version:  "0.4.3"
  origin:   "https://github.com/ingydotnet/git-subrepo.git"
  commit:   "2f68596"

* Fix function definition

* Building docs overhaul

* Add Python packages to Mac and Cygwin

* Heading number

* format format.sh (!)

* Replace "currently"

* Remove Debian

* git subrepo pull (merge) --force tools/ZAPD

subrepo:
  subdir:   "tools/ZAPD"
  merged:   "0ba781304"
upstream:
  origin:   "https://github.com/zeldaret/ZAPD.git"
  branch:   "master"
  commit:   "0ba781304"
git-subrepo:
  version:  "0.4.3"
  origin:   "https://github.com/ingydotnet/git-subrepo.git"
  commit:   "2f68596"
This commit is contained in:
EllipticEllipsis 2022-01-17 00:43:07 +00:00 committed by GitHub
parent 9450272503
commit 9b67778a00
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
41 changed files with 640 additions and 325 deletions

100
README.md
View file

@ -39,37 +39,24 @@ It builds the following ROM:
## Installation
We recommend using WSL on Windows, or native Linux, which the rest of this readme describes. We currently have instructions for
* [Windows](#Windows), with and without WSL
* [macOS](docs/BUILDING_MACOS.md)
* [Linux](#Linux-Native-or-under-WSL--VM), natively or using WSL / VM
* [Docker](docs/BUILDING_DOCKER.md)
(These will also depend on the Linux instructions.)
Some of these may also be out of date or unmaintained; usually our contributors use WSL, Linux, and macOS, so these instructions should be up to date.
### Windows
For Windows 10 or 11, install WSL and a distribution by following this
[WSL Installation Guide](https://docs.microsoft.com/en-us/windows/wsl/install).
We recommend using Debian or Ubuntu 20.04 Linux distributions.
We recommend using Ubuntu 20.04 as the Linux distribution.
For older versions of Windows, install a Linux VM or refer to either [Cygwin](#Cygwin) or [Docker](#Docker) instructions.
For older versions of Windows, install a Linux VM or refer to either [Cygwin](docs/BUILDING_CYGWIN.md) or [Docker](docs/BUILDING_DOCKER.md) instructions.
### macOS
For macOS, use homebrew to install the following dependencies:
* coreutils
* make
* python3
* md5sha1sum
* libpng
You can install them with the following commands:
```bash
brew update
brew install coreutils make python3 md5sha1sum libpng
```
You'll also need to [build and install mips-linux-binutils](docs/BUILDING_BINUTILS_MACOS.md).
Going forward in this guide, please use `gmake` whenever you encounter a `make` command.
The `make` that comes with macOS behaves differently than GNU make and is incompatible with this project.
You should now be able to continue from [step 2](#2-clone-the-repository) of the Linux instructions.
### Linux (Native or under WSL / VM)
@ -90,6 +77,12 @@ sudo apt-get update
sudo apt-get install git build-essential binutils-mips-linux-gnu python3 libpng-dev
```
To install the Python dependencies simply run in a terminal:
```bash
python3 -m pip install colorama
```
#### 2. Clone the repository
Clone `https://github.com/zeldaret/oot.git` where you wish to have the project, with a command such as:
@ -98,6 +91,12 @@ Clone `https://github.com/zeldaret/oot.git` where you wish to have the project,
git clone https://github.com/zeldaret/oot.git
```
This will copy the GitHub repository contents into a new folder in the current directory called `oot`. Change into this directory before doing anything else:
```bash
cd oot
```
#### 3. Prepare a base ROM
Copy over your copy of the Master Quest (Debug) ROM inside the root of this new project directory.
@ -145,57 +144,6 @@ This means that the built ROM isn't the same as the base one, so something went
Both of these have the disadvantage that the ordering of the terminal output is scrambled, so for debugging it is best to stick to one thread (i.e. not pass `-j` or `-jN`).
### Cygwin
If you want to use Cygwin, you will need to:
* Download and install [Git Bash](https://git-scm.com/download/win).
* Download and install [Cygwin](https://cygwin.com).
* [Build and install mips-linux-binutils](docs/BUILDING_BINUTILS_CYGWIN.md).
Once mips-linux-binutils is installed you will need to install the following packages using Cygwin's installer:
* libiconv
* dos2unix
* python3
* libpng-devel
Then you can continue from step [step 2](#2-clone-the-repository) of the Linux instructions.
Note that, before building anything, you will need to run the following commands to fix line endings:
```bash
dos2unix fixle.sh
./fixle.sh
```
### Docker
#### 1. Setup requirements
To use Docker, you'll need either Docker Desktop or Docker Toolbox installed and setup based on your system.
You'll also need to prepare a local version of the project with a copied base ROM (see steps [2](#2-clone-the-repository) and [3](#3-prepare-a-base-rom) of the Linux instructions).
#### 2. Create the Docker image
From inside your local project, run the following command:
```bash
docker build . -t oot
```
#### 3. Start the container
To start the container, you can mount your local filesystem into the Docker container and run an interactive bash session.
```bash
docker run -it --rm --mount type=bind,source="$(pwd)",destination=/oot oot /bin/bash
```
#### 4. Setup and Build the ROM
Once inside the container, you can follow steps [4](#4-setup-the-rom-and-build-process) and [5](#5-build-the-rom) of the Linux instructions to setup and build the ROM, or run any other command you need.
## Contributing