OK, here are the instructions for compiling OpenFunscripter on a Mac:
Firstly, we need to install the Apple Xcode Command Line Tools
xcode-select –-install
(you’ll need to agree Apple’s terms of service for these. it’ll download and install and may take 10+ minutes depending on how fast your internet & Mac is)
Let’s navigate to your home folder
cd ~
And clone the OFS source code into a folder called OpenFunscripter:
git clone https://github.com/OpenFunscripter/OFS.git OpenFunscripter
Navigate inside it
cd ~/OpenFunscripter
And pull in all its submodules
git submodule update --init
Now navigate into EASTL
cd lib/EASTL
And get its submodules too
git submodule update --init
We need to install Homebrew, which we’ll then use to install cmake and mpv
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Let’s install cmake so we can build things
brew install cmake
If you’re on an Apple Silicon (arm M1) Mac, we need to pretend we’re on an Intel machine so everything actually compiles. (This will open a new bash shell and use Rosetta to emulate an Intel machine – if your Mac prompts you to install Rosetta, do what it says)
For Apple Silicon Macs only:
arch -x86_64 /bin/bash
[opens a new fake-Intel bash shell]
For Apple Silicon Macs only, we need to install homebrew again (sorry). This will hopefully work! It’s very messy to install homebrew twice, as normally homebrew for arm installs to /opt/homebrew/bin/brew, but we have to fudge things for our fake-Intel build so we get fake-intel mpv which OpenFunscript needs)
For Apple Silicon Macs only
arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
For Apple Silicon Macs only—first we have to explicitly set a load of exports for the intel version of homebrew, as we’re running in a fake-Intel bash shell where these may not get set automatically and they’ll be needed later for cmake & make, then we run the x86 version of homebrew to install mpv
export HOMEBREW_PREFIX="/usr/local";
export HOMEBREW_CELLAR="/usr/local/Cellar";
export HOMEBREW_REPOSITORY="/usr/local/Homebrew";
export PATH="/usr/local/bin:/usr/local/sbin${PATH+:$PATH}";
export MANPATH="/usr/local/share/man${MANPATH+:$MANPATH}:";
export INFOPATH="/usr/local/share/info:${INFOPATH:-}";
/usr/local/Homebrew/bin/brew install mpv
For Intel Macs only:
brew install mpv
(The above brew install commands will probably take a while depending on how fast your Mac & internet is)
Hopefully that all worked. Now let’s make sure we’re in the right place
cd ~/OpenFunscripter
And build things
cmake -B build
cd build
make
If everything’s gone to plan, you should after quite a few minutes have a nice working OpenFunscripter app! It’s inside the ~/OpenFunscripter/bin folder.
Let’s copy it to your Applications folder
cp -a ~/OpenFunscripter/bin/OpenFunscripter.app /Applications/
And open it from the commandline
open /Applications/OpenFunscripter.app
You should have an open window with OpenFunscripter running!
With a bit of luck, unless I’ve messed something up, these instructions will work for both Intel and Apple Silicon Macs. Get in touch if you’re stuck and I’ll try to help. Good luck!