Windows dependencies build process
Step1 - Setup PSDK Project
The PSDK project has several dependencies comming from RubyInstaller, in order to be independent from any Ruby Installation (on player side) you need to perform the following steps:
- In root delete all
.dlland.exefiles - In
<PROJECT>/lib/delete the ruby folder, delete all.sofiles. - Copy the folder
<RUBY>/lib/rubyto<PROJECT>/lib/ - In
<PROJECT>/ruby_builtin_dlls/delete all.dllfiles. - Copy all the
.dllfiles from<RUBY>/bin/ruby_builtin_dllsto<PROJECT>/ruby_builtin_dlls/ - Update
<PROJECT>/ruby_builtin_dlls/ruby_builtin_dlls.manifestwith information commin from<RUBY>/bin/ruby_builtin_dlls/ruby_builtin_dlls.manifest - Copy the
msvcrt-ruby<VER>.dllfrom<RUBY>/binto your project root. - Copy the file
<RUBY>/msys32/mingw32/bin/libstdc++-6.dllto<PROJECT>/ruby_builtin_dlls/ [Optional]Compress all the DLL (putting asidelibcrypto-<VER>.dll,libgcc_s_dw2-1.dll) withupx
Note: In the futur those steps won't apply to PSDK, we'll write a universal launcher that will need those steps but that will be able to run mostly all PSDK games.
Step2 - Build Game.exe
- Outside of the project, pull
https://github.com/NuriYuri/Windows-PSDK-Game.exe.git - Setup a Visual Studio 20XX solution from that (if you're using Windows you should know how to do that, I'm not your mother)
- Convert the file
<RUBY>/lib/libmsvcrt-ruby300.dll.atoruby.libwithobjconv. Copy this file to the folder containingGame.cpp. - Grab the configuration file of Ruby for your MSVC installation. (See ruby/ruby git)
- Give the configuration folder path without including the
rubyparent folder ofconfig.hto Visual Studio 20XX - Give the header path to Visual Studio 20XX, it should be
<RUBY>/include/ruby-<VER>/ - Build
Game.exe(with MT) and copy it to the project - Build
Game-noconsole.exe(with MT, & NO_CONSOLE) and copy it to the project
Step3 - Build SFML
- Download the source code from this link
- Extract it somewhere, set the
SFML_DIRenvironment variable as the folder containing the fileCONTRIBUTING.md - Go to the
SFML_DIRfolder, opencmdand execute the commandridk enable - Run the command
cmake -G "MinGW Makefiles" -DSFML_BUILD_EXAMPLES=False . - Run the command
mingw32-make - Copy all the
.dllfiles from<SFML_DIR>/lib/to<PROJECT>/ruby_builtin_dlls/ - Copy all the
.dllfiles from<SFML_DIR>/lib/to<RUBY>/msys32/mingw32/bin/ - Copy all the
.afiles from<SFML_DIR>/lib/to<RUBY>/msys32/mingw32/lib/ - Copy the folder
include/SFMLto<RUBY>/msys32/mingw32/include/ - Copy the file
extlibs/bin/x86/openal32.dllto<PROJECT>/ruby_builtin_dlls/
Step4 - Build LiteRGSS2
This part is still a bit experimental and subject to change.
- Outside of the project, pull
git@gitlab.com:pokemonsdk/litergss2.git - Run the command
git submodule update --init --recursive - Run the command
depclean - You should be in the litecgss folder
- Run the command
ruby -e"Dir.mkdir('generated') rescue nil;File.write('generated/build.cache','')" - Run the command
cd ../.. - Run the command
rake release - You should be in the litcgss folder
- copy all the
.afiles fromlib/to<RUBY>/msys32/mingw32/lib/ - Copy all the
bin/libLiteCGSS_engine.dllto<RUBY>/msys32/mingw32/bin/ - Copy all the
bin/libLiteCGSS_engine.dllto<PROJECT>/ruby_builtin_dlls/ - If the compilation of liteRGSS2 failed
- Go back to the LiteRGSS2 project (
cd ../..) - Run the
rake cleancommand - Run the
rake releasecommand
- Go back to the LiteRGSS2 project (
- Copy the
lib/LiteRGSS.sofile to<PROJECT>/lib
Step 5 - Build Ruby-Fmod
- Download FMOD 2.x and Install it on your system
- Copy the file
<FMOD>/api/code/lib/x86/libfmod.ato<RUBY>/msys32/mingw32/lib/ - Copy the file
<FMOD>/api/code/lib/x86/fmod.dllto<RUBY>/msys32/mingw32/bin/ - Copy the file
<FMOD>/api/code/lib/x86/fmod.dllto<PROJECT>/ruby_builtin_dlls/ - Copy all the headers from
<FMOD>/api/code/incto<RUBY>/msys32/mingw32/include/ - Outside of the project, pull
https://github.com/NuriYuri/Ruby-Fmod.git - Run the command
rake clean - Run the command
rake compile - Copy the file
lib/RubyFmod.soto<PROJECT>/lib/
Step 6 - Build sfeMovie (hacky)
- Outside of the project, pull
https://github.com/Yalir/sfeMovie - Run the command
pacman -S tar yasm make - Run the command
pacman -S mingw32/mingw-w64-i686-ffmpeg(x86, you can add yyu after S if some package doesn't download) - Run the command
cmake -G "MSYS Makefiles" .- You'll see the error message "Only Visual Studio (2013 and later) is supported on Windows"
- Open CMakeLists.txt and comment the condition showing this error message (line 42 to 44)
- Run the command
cmake .(it'll fail) - Run the command
cmake -DSFEMOVIE_BUILD_FFMPEG=FALSE -DSFML_INCLUDE_DIR=<SFML_DIR>/include - Run the command
make(it'll fail because of some avutil stuff) - Delete the folder
FFmpeg/include/libavutil - Copy the folder
<RUBY>/msys32/mingw32/include/libavutiltoFFmpeg/include/ - Open the file
src/Stream.cppand replace the missing constants toAV_<constant_name> - Open the file
src/VideoStream.cppand replace the missing constants toAV_<constant_name>(line 63 & 280) - Copy the file
bin/libsfeMovie.dll.ato<RUBY>/msys32/mingw32/lib/ - Copy the file
bin/libsfeMovie.dllto<RUBY>/msys32/mingw32/bin/ - Copy the file
bin/libsfeMovie.dllto<PROJECT>/ruby_builtin_dlls/ - Copy the folder
include/sfeMovieto<RUBY>/msys32/mingw32/include/
Source: Build sfeMovie by following this tutorial
Step 7 - Build SFEMovie (the ruby library)
- Outside of the project, pull
git@gitlab.com:NuriYuri/sfemovie.git - Run the command
rake clean - Run the command
rake compile - Copy the file
lib/SFEMovie.soto<PROJECT>/lib - Go to the folder
<RUBY>/msys32/mingw32/bin/and copy the following files to<PROJECT>/ruby_builtin_dlls/- libmfx-1.dll
- libgsm.dll
- libcelt0-2.dll
- libgnutls-30.dll
- libbz2-1.dll
- libmodplug-1.dll
- librtmp-1.dll
- libsrt.dll
- liblzma-5.dll
- libmp3lame-0.dll
- libopencore-amrnb-0.dll
- libopencore-amrwb-0.dll
- libopenjp2-7.dll
- libopus-0.dll
- libspeex-1.dll
- libtheoradec-1.dll
- libtheoraenc-1.dll
- libvorbis-0.dll
- libvorbisenc-2.dll
- libvpx-1.dll
- libwebp-7.dll
- libwavpack-1.dll
- libwebpmux-3.dll
- libx264-159.dll
- libx265.dll
- xvidcore.dll
- libxml2-2.dll
- libfreetype-6.dll
- libhogweed-6.dll
- libogg-0.dll
- libnettle-8.dll
- libpng16-16.dll
- libharfbuzz-0.dll
- libglib-2.0-0.dll
- libgraphite2.dll
- libidn2-0.dll
- libp11-kit-0.dll
- libtasn1-6.dll
- libunistring-2.dll
- libpcre-1.dll
- avcodec-58.dll
- avformat-58.dll
- avutil-56.dll
- libbluray-2.dll
- swresample-3.dll
- swscale-5.dll
- libaom.dll
- libbrotlicommon.dll
- libbrotlidec.dll
- libdav1d.dll
- libvulkan-1.dll