Add macOS build instructions

This commit is contained in:
Inori 2019-08-05 06:18:39 -04:00 committed by Inori
parent b7250b4239
commit 27b4bc2a05

View file

@ -128,7 +128,73 @@ You'll find your stuff under your MSYS home directory. You can also type `explor
### macOS (homebrew)
Writing it.
1. Install [Homebrew](https://brew.sh).
2. Get most of your dependencies from Homebrew:
```sh
brew install meson cmake automake autoconf sdl2 sdl2_{image,ttf} \
boost pixman physfs libsigc++ libvorbis fluidsynth pkgconfig
```
3. Build the rest from source:
```sh
mkdir ~/src; cd ~/src
git clone https://github.com/Ancurio/SDL_Sound
git clone https://github.com/inori-z/ruby --single-branch --branch ruby_1_8_7
cd SDL_Sound && ./bootstrap
./configure
make install -j`nproc`
cd ..
# when you install ruby, some extensions might not want to build.
# You probably don’t particularly need any, so you can just delete
# any problematic ones if you like:
rm -rf ruby/ext/tk
# and try building again afterwards. Or you can try to fix whatever
# the problem is (missing libraries, usually). Hey, do whatever you
# need to do, Capp’n.
cd ruby && autoconf
# We're putting our build of ruby in its own prefix. macOS already
# includes Ruby (at least until 10.16 or so), and you really do
# not want to have any conflicts with it
./configure --prefix=/usr/local/opt/mkxp-ruby --enable-shared --disable-install-doc
make -j`nproc` && make install
cd ..
```
4. Build mkxp-z:
```sh
git clone https://github.com/inori-z/mkxp-z
cd mkxp-z
# Ruby 1.8 doesn’t support pkg-config (Might add it in, since this
# is a bit annoying) so you have to set include and link paths yourself.
# the header folder that Ruby 1.8 creates for macOS includes a version
# number (i.e. `x86_64-darwin18.7.0`), and is going to be located under
# `/usr/local/opt/mkxp-ruby/lib/ruby/1.8`.
# You will also need to link to `/usr/local/opt/mkxp-ruby/lib`, and tell
# meson where your pkgconfig path is (`/usr/local/lib/pkgconfig`).
meson build -Dpkg_config_path=/usr/local/lib/pkgconfig \
-Dcpp_args=-I/usr/local/opt/mkxp-ruby/lib/ruby/1.8/x86_64-darwin18.7.0 \
-Dcpp_link_args=-L/usr/local/opt/mkxp-ruby/lib
cd build
ninja
```
Your results will be in `~/src/mkxp-z/build` . You can type `open ~/src/mkxp-z/build` to get there quickly.
### Linux (Ubuntu)