mkxp for Dummies
  • Landing
  • Links
  • Gitlab
  • Binaries
  • Linux & Windows
  • Build Options
  • Building with Meson
  • macOS
    • Building with Xcode
  • Extensions
    • RGSS
    • System
    • MiniFFI
    • SteamLite
    • HTTPLite
Powered by GitBook
On this page
  • Compilation
  • Packaging (Linux)

Building with Meson

PreviousBuild OptionsNextBuilding with Xcode

Last updated 3 years ago

Compilation

First, install the tools necessary to build all the dependencies:

You must install . Afterwards:

  1. Launch any of the MSYS2 command prompts from your Start Screen.

  2. Type pacman -Syuu to begin updating MSYS. When the process is over, it will ask you to close the window.

  3. Open the MSYS2 MinGW 64-bit command prompt from your Start Screen. Type pacman -Syuu again, and allow it to finish updating.

pacman -S git ruby vim base-devel \
          mingw-w64-x86_64-cmake \
          mingw-w64-x86_64-meson \
          mingw-w64-x86_64-autotools \
          mingw-w64-x86_64-gcc
sudo apt install git build-essential cmake autoconf automake libtool pkg-config ruby bison zlib1g-dev libbz2-dev xorg-dev lib32z1 libgl1-mesa-dev libasound2-dev python3-pip libpulse-dev

# Meson from apt is too old, but also be sure not to get one too new
sudo python3 -m pip install meson==0.57.2 ninja==1.10.2
sudo apt install git build-essential cmake meson autoconf automake libtool pkg-config ruby bison zlib1g-dev libbz2-dev xorg-dev libgl1-mesa-dev libasound2-dev libpulse-dev

Next, clone mkxp-z's git repository, cd into your platform-specific directory, and run the build script:

git clone https://gitlab.com/mkxp-z/mkxp-z --recursive
cd mkxp-z/windows
make
git clone https://gitlab.com/mkxp-z/mkxp-z --recursive
cd mkxp-z/linux
make

All you should need to do now is build mkxp-z itself.

# Export the variables necessary to find the stuff we built
source vars.sh

# Configure the build
cd ..; meson build

# Build the thing
cd build && ninja

# Copy dependent libraries to the same folder
# for fun and profit
cp ${MKXPZ_PREFIX}/bin/x64-msvcrt-ruby310.dll $PWD
cp /mingw64/bin/zlib1.dll $PWD

# Strip it to save space
strip mkxp-z.exe

# Feast your eyes upon your work
start .
# Export the variables necessary to find the stuff we built
source vars.sh

# Configure the build
cd ..; meson build

# Build the thing
cd build && ninja

# Feast your eyes upon your work
xdg-open .

Packaging (Linux)

You have two options for grouping everything together to distribute: loose files or AppImage.

This will set up the executable to load dependencies from an adjacent lib/lib64 folder, so that it is easier to distribute.

# Set up the build to install everything locally
meson configure --bindir=. --prefix=$PWD/local

# Do the thing
ninja install

# See the thing
xdg-open $PWD/local

This will package everything into an AppImage, making it so that the executable and all of its dependencies are contained within a single file (imagine if you had a completely static executable).

# Mark AppImageTool as executable
chmod +x PATH_TO_APPIMAGETOOL

# I wanna make an AppImage
meson configure --prefix=`mktemp -d` --bindir=usr/bin \
    -Dappimage=true -Dappimagekit_path=PATH_TO_APPIMAGETOOL

# Do the thing
ninja install

# See the thing
xdg-open .

Firstly, you need to download . Keep note of where you stored it. Afterwards:

MSYS2
AppImageTool