diff --git a/.gitignore b/.gitignore index a569a44d..24274dc3 100644 --- a/.gitignore +++ b/.gitignore @@ -59,3 +59,4 @@ assets/icon.ico !build-entrypoint-windows.bat .vscode +out/ diff --git a/README.md b/README.md index 9887dda1..e68af57a 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,8 @@ Thanks to [hunternet93](https://github.com/hunternet93) for starting the reimple Thanks to [rkevin-arch](https://github.com/rkevin-arch) for the docker build! +Thanks to [somedevfox](https://github.com/somedevfox) for helping ModShot ditch conan! + > mkxp is a project that seeks to provide a fully open source implementation of the Ruby Game Scripting System (RGSS) interface used in the popular game creation software "RPG Maker XP", "RPG Maker VX" and "RPG Maker VX Ace" (trademark by Enterbrain, Inc.), with focus on Linux. The goal is to be able to run games created with the above software natively without changing a single file. > > It is licensed under the GNU General Public License v2+. @@ -15,35 +17,69 @@ Thanks to [rkevin-arch](https://github.com/rkevin-arch) for the docker build! *ModShot* also makes use of [steamshim](https://hg.icculus.org/icculus/steamshim/) for GPL compliance while making use of Steamworks features. See LICENSE.steamshim.txt for details. You can compile ModShot with steam without compiling steamshim, but you will need to source the steamshim binary yourself. +## Building + +Conan is no longer supported. Long live conan. +Instead, ModShot now makes use of meson, bash, and make, in a fairly simple setup. You only need to compile dependencies once. + +Because of this, compiling with Visual Studio as was standard before is no longer supported, and instead compiling using the msys2 toolset is required. +The main upshot of this, of course, is remaining on par with ruby in terms of gem support. (at least for windows) + +Previously, C extensions were very jank with ModShot, **however** now you can use a C extension right from your own Ruby install! +(Provided the version is the same, and the msys2 evironment is the same. I'll get back to this later.) + +# Building on Windows + +First, you'll need to download [msys2](https://www.msys2.org/) and install it. +Then, you'll want to determine what Ruby version you're using, as this will determine what build environment you'll be using. +As is, ModShot is set up to use Ruby 3.1, so keep that in mind. Please refer to this table to determine the environment. +(You *can* use the wrong environment and it will work fine, just not with C extensions.) + +``` +Ruby >3.1 UCRT64 +Ruby 3.0-2.0 MINGW64 +Ruby <1.9 MINGW32 +``` + +Once you've figured out the environment you need to use, pull up an msys2 shell of it. +(You can search the environment name in the Windows search box to open it) +From there, it's pretty much identical to the Linux setup. + +```sh +# Install dependencies from package manager +sh setup.sh + +# Build extra dependencies (like ruby) +cd windows; make +source vars.sh + +cd ..; meson build --prefix="$PWD/build.out" --bindir=. +cd build && ninja install +``` + +# Building on Linux + +Building on Linux is fairly easy, as long as you're using one of the supported distros. (Manjaro, Debian/Ubuntu, Fedora/Red Hat) +Unlinke Windows, you don't have to worry about msys2 environments. Just use gcc and you'll be good to go. +If you're not, fear not, as you can usually just install all the dependencies right from your package manager. See `setup.sh`. -# Usage -Please credit the project in some wayy, either by a direct title card, or some other means. - - Main features currently: - - Ruby gem support - - Vertical sprite mirroring - - Net::HTTP support - - Custom audio bindings - - Docker containers - - Simplified build process - +```sh +# Install dependencies from package manager +sh setup.sh -# Wiki +# Build extra dependencies (like ruby) +cd linux; make +source vars.sh -> A wiki is in progress and will be made when more features are added. +cd ..; meson build --prefix="$PWD/build.out" --bindir=. +cd build && ninja install +``` -### Supported image/audio formats -These depend on the SDL auxiliary libraries. *ModShot* only makes use of bmp/png for images and oggvorbis/wav for audio. +This should create a folder called `out` with your build of ModShot all ready to go! -To run *ModShot*, you should have a graphics card capable of at least **OpenGL (ES) 2.0** with an up-to-date driver installed. +## Sepecific ruby versions -To run *ModShot*, you must also have a x64 system. Currently, compiling for x86 is unsupported. +#TODO this ## Configuration @@ -61,4 +97,3 @@ Modshot builds come pre-packaged with the ruby standard library in `/lib/ruby/`. You can ship your own gems by finding the gem install location (Typically `C:\Ruby27-x64\lib\ruby\gems\2.7.0\gems`), going inside the gem, and copying over all the files inside lib. -Some gems may ship with external dlls/sos, those are a little buggy at the moment, and may throw a loaderror when trying to use them. You may have some success putting the dlls/sos found in `//ext/` in `/lib/`. diff --git a/meson.build b/meson.build index 3aa256b7..770d90c4 100644 --- a/meson.build +++ b/meson.build @@ -65,7 +65,7 @@ if host_system == 'windows' global_include_dirs += include_directories('windows') else subdir('linux') - rpath = '$ORIGIN/lib' + rpath = '$ORIGIN' endif exe_name = meson.project_name()