-
Notifications
You must be signed in to change notification settings - Fork 596
Building on macOS
Note: experimental, HELP WANTED
The author has no intention of delving into the specific development process of macOS, so he only roughly ran through the compilation steps
-
YGOPro distribution
It is used to obtain cards database and pictures and app, in which database and app are necessary
-
git
And have GitHub account and SSH key
-
homebrew
-
Xcode
-
There are two kinds of project description files, premake and cmake, but cmake has not been maintained recently
-
Download the 64-bit version, can be disabled by changing
USE_IRRKLANG
in premake5.lua, the result is no sound
Install via brew:
- freetype
- libevent
- libx11
- sqlite
- zlib
- gpatch
The following two dependency libraries need their source codes to be manually downloaded and statically compiled
-
Only this version has been tested and needs to be patched with Chinese support
-
Versions 5.2 and earlier are not supported, must be built with C++, not C
Just use git clone
, and add --recursive
to clone sub modules at the same time, or run git submodule update --init
after completion
After cloning is finished, enter the ocgcore
and script
sub-module dirs and checkout
to master
branch.
Commands:
git clone [email protected]:Fluorohydride/ygopro.git
cd ygopro
git submodule update --init
cd ocgcore/
git checkout master
cd ..
cd script/
git checkout master
cd ..
-
Unzip the downloaded irrlicht to the project folder and rename it to
irrlicht
-
Unzip the downloaded irrKlang to the project folder and rename it to
irrklang
("k" is lowercase) -
Unzip the downloaded lua to the project folder and rename it to
lua
-
Copy all folders in the premake folder to the project folder, which contains the premake description files of each dependent library, which can be modified and improved by yourself
cp -r ./premake/irrlicht .
cp -r ./premake/lua .
cp ./irrklang/bin/macosx-gcc/libirrklang.dylib /usr/local/lib/
The original version of Irrlicht does not support Chinese, and needs to be patched. Enter the Irrlicht folder and run
patch -p1 < irrlicht.patch
You can also use the modified version directly
cd irrlicht
cp -r include /usr/local/include/irrlicht
cd source/Irrlicht/MacOSX
xcodebuild -project MacOSX.xcodeproj
cp build/Release/libIrrlicht.a /usr/local/lib/
cd ../../../..
Extract premake5 executable directly into the project folder and run
./premake5 gmake --cc=clang
Then you can enter the build dir and make
At this time, the directory structure should look like this after omitting redundant files:
├── bin
├── build
├── cmake
├── gframe
├── irrklang
│ └── include
├── irrlicht
│ └── include
├── lua
│ └── src
├── obj
├── ocgcore
├── premake
├── script
├── sound
└── textures
ln
cards.cdb
and pics
dir and deck
dir and replay
dir to the project folder
Copy a ygopro.app
from a working distribution, replace the executable with the file we built
cp ./bin/release/ygopro.app ./ygopro.app/Contents/MacOS/ygopro
Then you can click on ygopro.app
to run, or ./ygopro.app/Contents/MacOS/ygopro
(TODO: Generate a normal package and put the static files inside the .app like other software on macOS, not outside)