Compiling Opensource Games for PortMaster¶
Since PortMaster is platform-independent and delivers its own dependencies, we don't rely on the build mechanism of the CFWs out there. To compile games for the AARCH64 architecture, you can do so in various ways. Most of the porters build on Ubuntu 20.04, this relatively old version is required to prevent issues with glibc requirements on some CFW's.
Info
Many porting methods do not require you to set up a build environment. This is only necessary when you need to build games and/or libraries from source!
Build environment options¶
Below you will find several options for build environments suited for PortMaster.
1. WSL2 Chroot (Change root)¶
For more information, visit the GitHub Repository.
Instructions¶
Install required packages on Ubuntu 20.04/22.04 LTS WSL 2:
sudo apt install build-essential binfmt-support daemonize libarchive-tools qemu-system qemu-user qemu-user-static gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
-
Download 20.04 Focal server-cloudimg-arm64-wsl.rootfs.tar.gz from Ubuntu Cloud Image.
-
Extract the tarball in a folder:
-
Copy qemu static binary into that folder:
-
Start systemd with daemonize:
-
Check if AARCH64 binfmt entry is present:
-
Mount and chroot into the environment:
-
In the chroot, delete /etc/resolv.conf file and write a name server to it.
-
Exit chroot
```bash mkdir -p folder/tmp/.X11-unix ```
-
Create chroot.sh:
-
Make the chroot.sh executable:
-
Chroot into the new environment:
-
Update & Upgrade the chroot:
-
Helpful development tools & libraries to have in the chroot:
apt-get install --no-install-recommends build-essential git wget libdrm-dev python3 python3-pip python3-setuptools python3-wheel ninja-build libopenal-dev premake4 autoconf libevdev-dev ffmpeg libboost-tools-dev magics++ libboost-thread-dev libboost-all-dev pkg-config zlib1g-dev libsdl-mixer1.2-dev libsdl1.2-dev libsdl-gfx1.2-dev libsdl2-mixer-dev clang cmake cmake-data libarchive13 libcurl4 libfreetype6-dev librhash0 libuv1 mercurial mercurial-common libgbm-dev libsdl-image1.2-dev
-
Install custom SDL2 Libraries for better compatibility:
2. Docker¶
Multi Arch compilation with this Docker Guide
3. AARCH64 chroot development VM by Christian¶
This is a Virtual Box VM with two chroot instances (AARCH64 & ARMHF).
For More Info: Forum Post
Getting Into Chroots:¶
-
For 32-bit Arm environment:
or create an Arm32 shortcut on the desktop GUI and click on it. -
For 64-bit Arm environment:
or create an Arm64 shortcut on the desktop GUI and click on it.
Helpful Tools to Install:¶
apt -y install build-essential git wget libdrm-dev python3 python3-pip python3-setuptools python3-wheel ninja-build libopenal-dev premake4 autoconf libevdev-dev ffmpeg libsnappy-dev libboost-tools-dev magics++ libboost-thread-dev libboost-all-dev pkg-config zlib1g-dev libpng-dev libsdl2-dev clang cmake cmake-data libarchive13 libcurl4 libfreetype6-dev libjsoncpp1 librhash0 libuv1 mercurial mercurial-common libgbm-dev libsdl2-ttf-2.0-0 libsdl2-ttf-dev
4. Create Your Own chroot¶
As per this guide.
5. Cross-Compiling Tools for AARCH64¶
With the arm64 SDL2 library, etc.