Building on Ubuntu - Fluorohydride/ygopro GitHub Wiki
YGOPro Ubuntu Compilation Guide
1. Preparation
1.1 Required Software
-
YGOPro distribution
- Used to obtain card database and card images, the database is essential
-
Git
-
build-essential
-
- The project supports both Premake and CMake build systems, but CMake has not been maintained recently, so Premake is recommended
1.2 Dependencies
Install the following system dependencies via APT:
sudo apt install libevent-dev libfreetype6-dev libgl1-mesa-dev libglu1-mesa-dev libxxf86vm-dev libsqlite3-dev libopusfile-dev libvorbis-dev
Dependencies that need to be manually downloaded (source code) and statically compiled:
-
- This is a modified version of Irrlicht with added Chinese support and other features
- The original Irrlicht is not supported
-
- Only versions 5.3.x and 5.4.x are supported
- Needs to be compiled with C++ instead of the default C compiler, so static compilation is suggested
- On Ubuntu, you can also install
liblua5.4-dev
via APT, but you need to manually specify the library name and header file path when generating project files
-
- Due to project specifics, it cannot be installed through APT or other package managers, static compilation is required
- Only version 0.11.22 is supported, and you need to use the
miniaudio_split
version from it
2. Getting the Source Code
2.1 Clone the Repository
Use Git to clone the repository, making sure to include all submodules:
# Complete clone of code and submodules (recommended)
git clone --recursive https://github.com/Fluorohydride/ygopro.git
cd ygopro
# Or step by step
git clone https://github.com/Fluorohydride/ygopro.git
cd ygopro
git submodule update --init
# Switch submodules to the correct branch
cd ocgcore
git checkout master
cd ..
cd script
git checkout master
cd ..
2.2 Install Dependencies
- Extract the downloaded Irrlicht to the project root directory and rename it to
irrlicht
- Extract the downloaded Lua to the project root directory and rename it to
lua
- Download miniaudio, and copy the c and h files from
miniaudio/extras/miniaudio_split
to theminiaudio
folder in the project root directory (please create this folder manually)
2.3 Copy Description Files
Copy all subfolders in the premake folder to the project root directory. These folders contain the premake description files needed to compile each dependency library.
cp -r premake/* .
3. Generate Project and Compile
3.1 Generate Project Files
Download the premake5 executable, give it execution permissions and run:
chmod +x premake5
./premake5 gmake
If you have installed Lua via APT, use the following command instead:
./premake5 gmake --no-build-lua --lua-lib-name="lua5.4-c++" --lua-include-dir="/usr/include/lua5.4/"
This will generate a Makefile in the build folder.
3.2 Directory Structure
After successful configuration, the project directory structure should look like this (some files omitted):
├── build
├── gframe
├── irrlicht
│ ├── include
│ └── source
│ └── Irrlicht
├── lua
│ └── src
├── miniaudio
├── ocgcore
├── script
├── sound
└── textures
3.3 Compile the Project
From the project root directory, run:
cd build
make config=release # or make config=debug
After compilation, the generated executable will be located in the bin/release
or bin/debug
directory.
4. Running and Debugging
4.1 Basic Running
-
Copy the following files from the YGOPro distribution to the project root directory:
cards.cdb
pics
folderdeck
folder
-
Create a symbolic link for easier execution:
ln -s bin/release/YGOPro ./ygopro # or ln -s bin/debug/YGOPro ./ygopro
-
Run
./ygopro
5. Common Issues
See FAQ for Building