Skip to content

Compiling on Linux

Chadow edited this page Aug 21, 2024 · 10 revisions

Contents

  1. Requirements
  2. Building Gosu
  3. Building The Wrapper
  4. Distributing

Requirements

For Gosu, check this out. You'll also need a working installation of Ruby, Git and CMake.

Building Gosu

Get the source code from the releases page then extract it on some place. And run the following commands there:

cmake -S . -B build
cmake --build build

Note the generated libgosu.so and ffi/libgosu-ffi.so, we'll need them later.

Building The Wrapper

Get the source code from the releases page and extract it, on the vendor directory, create a directory there named gosu, then move the ffi directory of Gosu there, and make another directory named lib64, place the .so files there. Your final directory structure should look like this:

.
├── assets
├── include
├── scripts
│   └── mruby
├── src
└── vendor
    ├── gosu
    │   ├── ffi
    │   │   └── Various headers needed for compilation...
    │   └── lib64
    │       ├── libgosu-ffi.so
    │       └── libgosu.so
    ├── mruby
    ├── physfs
    └── whereami

Then proceed to build the project as usual.

cmake -S . -B build
cmake --build build

And that's it!

Distributing

Since we can't expect every person to ever run the compiled binary to have Gosu installed on their system, we'll need to bundle the .so files with the binary, so just grab them from the vendor/gosu directory and put them with your binary. Simple as that.

Clone this wiki locally