Repository navigation
Compiling on Linux
See.
Get the source code from the releases page then extract it on some place, make sure the directory is named gosu after the extraction. Create a directory named build/, cd to it and:
cmake ..
makeThen move the generated libgosu.so and ffi/libgosu-ffi.so to lib64/
Get the source code from the tags page, extract it on the same directory where the gosu folder from the previous step is, in a way that the directory structure will be like this:
.
├── gosu
| ├── ffi
| | └── headers needed for compilation
│ └── lib64
│ ├── libgosu.so
│ └── libgosu-ffi.so
└── mrubyYou can use the following MRuby configuration:
MRuby::Build.new do |conf|
conf.toolchain :gcc
conf.gembox 'default'
conf.gem github: 'chadowo/mruby-gosu'
conf.gem github: 'mattn/mruby-require' # Add require and load functionality to MRuby
# C compiler settings
conf.cc.defines = %w(MRB_USE_DEBUG_HOOK MRB_INT64)
conf.cc.flags << '-fpermissive' # Needed for mruby-require
conf.enable_debug
conf.enable_cxx_abi
endSave it as gosu.rb in the MRuby build_config directory, then we use the MRUBY_COFIG environment variable to select our configuration:
MRUBY_CONFIG=gosu rakeRemember to run it on the root MRuby directory. As the compilation finalizes, you'll get the libmruby.a file, in the build/host/lib/ directory.
Get the source code from releases page and extract it, on the vendor directory, under mruby/ put libmruby.a, and create another directory there named gosu, as you guessed, the .so files we built earlier will go there. then proceed to create the build directory in the source code directory, and cd to it, then do the following:
cmake ..
makeAnd that's it!
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.