1
0
mirror of https://github.com/zeldaret/oot.git synced 2024-09-21 12:54:51 +00:00
oot/docs/BUILDING_MACOS.md
EllipticEllipsis 9b67778a00
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"
2022-01-16 19:43:07 -05:00

2.2 KiB

Building on macOS

N.B. C++17 is required to build the asset processing program that we use (ZAPD), so check your OS version can support this before proceeding.

1. Dependencies

For macOS, use Homebrew to install the following dependencies:

  • coreutils
  • make
  • python3
  • libpng
  • bash
  • clang-format

You can install them with the following commands:

brew update
brew install coreutils make python3 libpng bash clang-format

(The repository expects Homebrew-installed programs to be either linked correctly in $PATH etc. or in their default locations.)

To install the Python dependencies simply run in a terminal:

python3 -m pip install colorama

2. Building mips-linux-binutils

The following instructions are written for MacOS users but should apply to any Unix-like system, with maybe some modifications at the end regarding the bash_profile.

Create destination dir for binutils

sudo mkdir -p /opt/cross

Create and enter local working dir

mkdir ~/binutils-tmp
cd ~/binutils-tmp

Get and extract binutils source

wget https://ftp.gnu.org/gnu/binutils/binutils-2.35.tar.bz2
tar xjf binutils-2.35.tar.bz2

(You may find this command does not work: if so, just access the URL in a browser and save it to ~/binutils-tmp.)

Create and enter a build directory

mkdir build-binutils
cd build-binutils

Configure the build

../binutils-2.35/configure --target=mips-linux-gnu --prefix=/opt/cross --disable-gprof --disable-gdb --disable-werror

Make and install binutils

make -j
sudo make install

Edit your ~/.bash_profile/~/.zsh_profile (or whichever shell you use) to add the new binutils binaries to the system PATH

echo "export PATH=$PATH:/opt/cross/bin" >> ~/.bash_profile

Reload ~/.bash_profile (or just launch a new terminal tab)

source ~/.bash_profile

If this worked, you can now delete the temporary directory ~/binutils-tmp.

3. Final note

Apple's version of make is very out-of-date, so you should use the brew-installed gmake in place of make in this repo from now on.

You should now be able to continue from step 2 of the Linux instructions.