Update How To Build

2025-10-28 08:50:06 +03:00
parent 33f5479ddc
commit 9e90a9347e

@@ -1,85 +1,85 @@
## Building PMT from source ## Building PMT from source
This guide teaches you how to compile PMT from source. It is aimed at enthusiasts and developers. This guide teaches you how to compile PMT from source. It is aimed at enthusiasts and developers.
### Requirements ### Requirements
- Android NDK - Android NDK
- Git, CMake and Ninja packages - Git, CMake and Ninja packages
- Linux system (any distro, it doesn't matter) - Linux system (any distro, it doesn't matter)
- Patience - Patience
--- ---
### Set upping Android NDK ### Set upping Android NDK
- Download latest Android NDK release from [Android Developers](https://developer.android.com/ndk/downloads). - Download latest Android NDK release from [Android Developers](https://developer.android.com/ndk/downloads).
- Extract the NDK archive you downloaded in a convenient place in the terminal with the following command: - Extract the NDK archive you downloaded in a convenient place in the terminal with the following command:
```bash ```bash
unzip android-ndk-*-linux.zip unzip android-ndk-*-linux.zip
``` ```
- The reason we use the script is that some file managers do not create a direct symbolic link when extracting. For example, dolphin. If we were to use it, NDK's `clang` would not work properly. - The reason we use the script is that some file managers do not create a direct symbolic link when extracting. For example, dolphin. If we were to use it, NDK's `clang` would not work properly.
- Copy the path to the directory that the Android NDK files are in. You'll need it! - Copy the path to the directory that the Android NDK files are in. You'll need it!
--- ---
### Installing required packages ### Installing required packages
- For `pacman` package manager (Arch Linux and Arch Linux based distros): - For `pacman` package manager (Arch Linux and Arch Linux based distros):
```bash ```bash
sudo pacman -S git cmake ninja sudo pacman -S git cmake ninja
``` ```
- For `dnf` package manager (Fedora and Fedora based distros): - For `dnf` package manager (Fedora and Fedora based distros):
```bash ```bash
sudo dnf install git cmake ninja-build sudo dnf install git cmake ninja-build
``` ```
- For `apt` package manager (Debian/Ubuntu and Debian/Ubuntu based distros): - For `apt` package manager (Debian/Ubuntu and Debian/Ubuntu based distros):
```bash ```bash
sudo apt install git cmake ninja-build sudo apt install git cmake ninja-build
``` ```
- For `zypper` package manager (OpenSUSE and OpenSUSE based distros): - For `zypper` package manager (OpenSUSE and OpenSUSE based distros):
```bash ```bash
sudo zypper install git cmake ninja sudo zypper install git cmake ninja
``` ```
--- ---
### Downloading PMT from GitHub ### Downloading PMT from GitHub
- PMT is managed from a single branch. In general, it is always in the development phase. There may be bugs, etc. So my suggestion is to clone the repository via published tags. - PMT is managed from a single branch. In general, it is always in the development phase. There may be bugs, etc. So my suggestion is to clone the repository via published tags.
```bash ```bash
# Example: clone 1.1.0 version release tag. You can also look at tags from the repository on GitHub. # Example: clone 1.1.0 version release tag. You can also look at tags from the repository on GitHub.
git clone -b 20250821 https://github.com/ShawkTeam/pmt-renovated git clone -b 20250821 https://git.yzbruh.space/YZBruh/pmt-renovated
``` ```
- Or you can clone the repository directly (don't specify a branch only with `-b`) and switch between tags with `git switch`. - Or you can clone the repository directly (don't specify a branch only with `-b`) and switch between tags with `git switch`.
- Or just to work on or try out the unreleased version that may be in development... - Or just to work on or try out the unreleased version that may be in development...
### Building PMT with build script ### Building PMT with build script
- Enter the cloned repository directory. - Enter the cloned repository directory.
- Save the path to the NDK directory you copied earlier to the variable named `ANDROID_NDK` using `export`. If you want, you can also add `bashrc` or `zshrc` to your files so that you don't repeat the continuous process. For me, the command is like this: - Save the path to the NDK directory you copied earlier to the variable named `ANDROID_NDK` using `export`. If you want, you can also add `bashrc` or `zshrc` to your files so that you don't repeat the continuous process. For me, the command is like this:
```bash ```bash
# I extracted it on my desktop. # I extracted it on my desktop.
export ANDROID_NDK="/home/yzbruh/Desktop/Development/android-ndk-r28c" export ANDROID_NDK="/home/yzbruh/Desktop/Development/android-ndk-r28c"
``` ```
- Now all you have to do is run build.sh! - Now all you have to do is run build.sh!
```bash ```bash
bash build.sh build bash build.sh build
``` ```
--- ---
#### Extra Notes #### Extra Notes
- To clean up the compiled files, use the following command: - To clean up the compiled files, use the following command:
```bash ```bash
bash build.sh clean bash build.sh clean
``` ```
- To recompile (clean + build), use the following command: - To recompile (clean + build), use the following command:
```bash ```bash
bash build.sh rebuild bash build.sh rebuild
``` ```
- Currently, only `arm64-v8a` and `armeabi-v7a` are compiled. If you want to compile in other ABIs, etc., you need to edit the `TARGET_ABI_LIST` string on line 19 in the `build.sh`. Also, only the following ABIs are supported by the Android NDK: `arm64-v8a` `armeabi-v7a` `x86_64` `x86` - Currently, only `arm64-v8a` and `armeabi-v7a` are compiled. If you want to compile in other ABIs, etc., you need to edit the `TARGET_ABI_LIST` string on line 19 in the `build.sh`. Also, only the following ABIs are supported by the Android NDK: `arm64-v8a` `armeabi-v7a` `x86_64` `x86`
- The thread to use is calculated based on: - The thread to use is calculated based on:
```bash ```bash
$(($(nproc) - 2)) $(($(nproc) - 2))
# The two threads are not used during compilation to make your computer a little more comfortable. You can also edit it within build.sh if you want # The two threads are not used during compilation to make your computer a little more comfortable. You can also edit it within build.sh if you want
``` ```
--- ---
#### Notes for developers #### Notes for developers
- I would be glad if you could let me know all the help you can do for PMT by opening a pull request! Your help will always be valuable! - I would be glad if you could let me know all the help you can do for PMT by opening a pull request! Your help will always be valuable!