mirror of
https://forgejo.xatacraft.ru/Sunshine/mkxp-sunshine.git
synced 2026-08-19 13:29:54 +00:00
Linux AppImage support
This commit is contained in:
parent
8c3ffd303d
commit
8572f65917
6 changed files with 114 additions and 93 deletions
|
|
@ -277,6 +277,8 @@ source_group("Binding Source" FILES ${BINDING_SOURCE} ${BINDING_HEADERS})
|
||||||
|
|
||||||
## Setup main executable ##
|
## Setup main executable ##
|
||||||
|
|
||||||
|
set(CMAKE_CXX_STANDARD 11)
|
||||||
|
|
||||||
add_executable(${PROJECT_NAME} MACOSX_BUNDLE WIN32
|
add_executable(${PROJECT_NAME} MACOSX_BUNDLE WIN32
|
||||||
${MAIN_HEADERS}
|
${MAIN_HEADERS}
|
||||||
${MAIN_SOURCE}
|
${MAIN_SOURCE}
|
||||||
|
|
|
||||||
153
README.md
153
README.md
|
|
@ -1,91 +1,62 @@
|
||||||
# mkxp-oneshot
|
# mkxp-oneshot
|
||||||
|
|
||||||
This is a specialized fork of [mkxp by Ancurio](https://github.com/Ancurio/mkxp) designed for [*OneShot*](http://oneshot-game.com/).
|
This is a specialized fork of [mkxp by Ancurio](https://github.com/Ancurio/mkxp) designed for [*OneShot*](http://oneshot-game.com/).
|
||||||
|
|
||||||
Thanks to [hunternet93](https://github.com/hunternet93) for starting the reimplementation of the journal program!
|
Thanks to [hunternet93](https://github.com/hunternet93) for starting the reimplementation of the journal program!
|
||||||
|
|
||||||
> 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.
|
> 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+.
|
> It is licensed under the GNU General Public License v2+.
|
||||||
|
|
||||||
*OneShot* 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.
|
*OneShot* 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.
|
||||||
|
|
||||||
## Dependencies / Building
|
## Building (Supported on Windows, Ubuntu Linux, in progress on macOS)
|
||||||
|
|
||||||
* Qt5
|
Preface: This only supports Visual Studio on Windows and Xcode on macOS. Ubuntu should work with either GCC or clang. You can probably compile with other platforms/setups, but beware.
|
||||||
* CMake
|
|
||||||
* Conan
|
With Python 3 and pip installed, install Conan via `pip3 install conan`. Afterwards, add the necessary package repositories by adding running the following commands:
|
||||||
* Boost.Unordered (headers only)
|
|
||||||
* Boost.Program_options
|
```sh
|
||||||
* Boost.CRC
|
conan remote add eliza "https://api.bintray.com/conan/eliza/conan"
|
||||||
* Vim XXD (vim-common in apt)
|
conan remote add bincrafters "https://api.bintray.com/conan/bincrafters/public-conan"
|
||||||
* libsigc++ 2.0
|
```
|
||||||
* PhysFS (latest hg)
|
|
||||||
* OpenAL
|
Prepare to build *OneShot* by installing the necessary dependencies with Conan.
|
||||||
* SDL2
|
|
||||||
* SDL2_image
|
```sh
|
||||||
* SDL2_ttf
|
cd mkxp-oneshot
|
||||||
* [Ancurio's SDL_sound fork](https://github.com/Ancurio/SDL_sound)
|
mkdir build
|
||||||
* vorbisfile
|
cd build
|
||||||
* pixman
|
conan install .. --build=missing
|
||||||
* OpenGL header (alternatively GLES2 with `DEFINES+=GLES2_HEADER`)
|
```
|
||||||
* Ruby
|
|
||||||
* Python 3 (journal reimplementation only)
|
Hopefully, this should complete without error. It may take quite a while to build all of the dependencies.
|
||||||
* PyQt5 for Python 3 (journal reimplementation only)
|
|
||||||
* Steamworks SDK (optional, place contents of sdk folder in ZIP into "steamworks" folder in root)
|
On Ubuntu, make sure you install the necessary dependencies before building *OneShot* proper:
|
||||||
|
|
||||||
### Building with QMake
|
```sh
|
||||||
|
sudo apt install libgtk2.0-dev libxfconf-0-dev
|
||||||
The `make-oneshot-mac.command` and `make-oneshot-linux.sh` files automate the entire process for you. Just run the applicable file to compile and install the engine into OneShot's default Steam directory.
|
```
|
||||||
|
|
||||||
qmake will use pkg-config to locate the respective include/library paths. If you installed any dependencies into non-standard prefixes, make sure to adjust your `PKG_CONFIG_PATH` variable accordingly.
|
Finally, you can build the project by running the following:
|
||||||
|
|
||||||
The exception is boost, which is weird in that it still hasn't managed to pull off pkg-config support (seriously?). *If you installed boost in a non-standard prefix*, you will need to pass its include path via `BOOST_I` and library path via `BOOST_L`, either as direct arguments to qmake (`qmake BOOST_I="/usr/include" ...`) or via environment variables. You can specify a library suffix (eg. "-mt") via `BOOST_LIB_SUFFIX` if needed.
|
```sh
|
||||||
|
conan build ..
|
||||||
By default, *OneShot* switches into the directory where its binary is contained and then starts reading the configuration and resolving relative paths. In case this is undesired (eg. when the binary is to be installed to a system global, read-only location), it can be turned off by adding `DEFINES+=WORKDIR_CURRENT` to qmake's arguments.
|
```
|
||||||
|
|
||||||
pkg-config will look for `ruby-2.3.pc`, but you can override the version with `MRIVERSION=2.5` ('2.5' being an example). This is the default binding, so no arguments to qmake needed (`BINDING=MRI` to be explicit).
|
On Ubuntu, you may now run `../make-appimage.sh .. . /path/to/game/files /some/path/OneShot.AppImage` to create an AppImage. Requires [linuxdeploy](https://github.com/linuxdeploy/linuxdeploy) and [AppImageTool](https://github.com/AppImage/AppImageKit) in your `PATH`.
|
||||||
|
|
||||||
### Building with Conan (Supported on Windows, in progress on macOS/Linux)
|
### Supported image/audio formats
|
||||||
|
These depend on the SDL auxiliary libraries. *OneShot* only makes use of bmp/png for images and oggvorbis/wav for audio.
|
||||||
Preface: This currently only supports Visual Studio on Windows and Xcode on macOS. Linux should work with either GCC or clang.
|
|
||||||
|
To run *OneShot*, you should have a graphics card capable of at least **OpenGL (ES) 2.0** with an up-to-date driver installed.
|
||||||
*OneShot* used to employ the `qmake` build system, but is now migrating to `conan`, so you'll need to install that beforehand (via `pip install conan`). You'll also want to add the following remotes to `conan`:
|
|
||||||
|
## Configuration
|
||||||
```sh
|
|
||||||
conan remote add eliza "https://api.bintray.com/conan/eliza/conan"
|
*OneShot* reads configuration data from the file "oneshot.conf". The format is ini-style. Do *not* use quotes around file paths (spaces won't break). Lines starting with '#' are comments. See 'oneshot.conf.sample' for a list of accepted entries.
|
||||||
conan remote add bincrafters "https://api.bintray.com/conan/bincrafters/public-conan"
|
|
||||||
```
|
All option entries can alternatively be specified as command line options. Any options that are not arrays (eg. preloaded scripts) specified as command line options will override entries in oneshot.conf. Note that you will have to wrap values containing spaces in quotes (unlike in oneshot.conf).
|
||||||
|
|
||||||
On Windows, you may need to edit `C:\Users\[username]\.conan\profiles\default` and add the following line in `[settings]` ("v141" is the current toolset version at the time of this writing):
|
The syntax is: `--<option>=<value>`
|
||||||
|
|
||||||
```sh
|
Example: `./oneshot --gameFolder="oneshot" --vsync=true`
|
||||||
compiler.toolset=v141
|
|
||||||
```
|
|
||||||
|
|
||||||
Next, you can install all the required packages:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
conan install . --build=missing
|
|
||||||
```
|
|
||||||
|
|
||||||
Finally, you can build the project by running the following:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
conan build .
|
|
||||||
```
|
|
||||||
|
|
||||||
### Supported image/audio formats
|
|
||||||
These depend on the SDL auxiliary libraries. *OneShot* only makes use of bmp/png for images and oggvorbis/wav for audio.
|
|
||||||
|
|
||||||
To run *OneShot*, you should have a graphics card capable of at least **OpenGL (ES) 2.0** with an up-to-date driver installed.
|
|
||||||
|
|
||||||
## Configuration
|
|
||||||
|
|
||||||
*OneShot* reads configuration data from the file "oneshot.conf". The format is ini-style. Do *not* use quotes around file paths (spaces won't break). Lines starting with '#' are comments. See 'oneshot.conf.sample' for a list of accepted entries.
|
|
||||||
|
|
||||||
All option entries can alternatively be specified as command line options. Any options that are not arrays (eg. preloaded scripts) specified as command line options will override entries in oneshot.conf. Note that you will have to wrap values containing spaces in quotes (unlike in oneshot.conf).
|
|
||||||
|
|
||||||
The syntax is: `--<option>=<value>`
|
|
||||||
|
|
||||||
Example: `./oneshot --gameFolder="oneshot" --vsync=true`
|
|
||||||
|
|
|
||||||
9
assets/oneshot.desktop
Normal file
9
assets/oneshot.desktop
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
[Desktop Entry]
|
||||||
|
Type=Application
|
||||||
|
Name=OneShot
|
||||||
|
Exec=oneshot %F
|
||||||
|
Comment=A surreal puzzle adventure game with unique mechanics / capabilities.
|
||||||
|
Icon=oneshot
|
||||||
|
Categories=Game;
|
||||||
|
Terminal=false
|
||||||
|
X-AppImage-Arch=x86_64
|
||||||
BIN
assets/oneshot.png
Normal file
BIN
assets/oneshot.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.2 KiB |
39
make-appimage.sh
Executable file
39
make-appimage.sh
Executable file
|
|
@ -0,0 +1,39 @@
|
||||||
|
#!/bin/bash -eu
|
||||||
|
|
||||||
|
LINUXDEPLOY=linuxdeploy-x86_64.AppImage
|
||||||
|
APPIMAGETOOL=appimagetool-x86_64.AppImage
|
||||||
|
|
||||||
|
if [ $# -lt 3 ]; then
|
||||||
|
echo "usage: linuxdeploy.sh SOURCE_PATH CONAN_INSTALL_PATH GAME_PATH APPIMAGE_FILE"
|
||||||
|
fi
|
||||||
|
|
||||||
|
source_path="$1"
|
||||||
|
conan_install_path="$2"
|
||||||
|
game_path="$3"
|
||||||
|
appimage_file="$4"
|
||||||
|
appdir="$(mktemp -d)"
|
||||||
|
|
||||||
|
function atexit {
|
||||||
|
[ -n "$appdir" ] && rm -rf "$appdir"
|
||||||
|
}
|
||||||
|
|
||||||
|
trap atexit EXIT
|
||||||
|
|
||||||
|
$LINUXDEPLOY -e "$conan_install_path/bin/oneshot" \
|
||||||
|
-l "$conan_install_path/lib/libruby.so.2.5.3" \
|
||||||
|
-i "$source_path/assets/oneshot.png" \
|
||||||
|
-d "$source_path/assets/oneshot.desktop" \
|
||||||
|
--appdir "$appdir"
|
||||||
|
|
||||||
|
# Populate remaining AppImage spec files
|
||||||
|
# ln -sf bin/oneshot "$appdir/AppRun"
|
||||||
|
# cp -f "$source_path/assets/oneshot.png" "$appdir/oneshot.png"
|
||||||
|
|
||||||
|
# Bundle game data
|
||||||
|
for dir in Audio Data Fonts Graphics Languages Wallpaper; do
|
||||||
|
cp -ra "$game_path/$dir" "$appdir/usr/bin/"
|
||||||
|
done
|
||||||
|
cp -a "$conan_install_path/bin/Data/xScripts.rxdata" "$appdir/usr/bin/Data/"
|
||||||
|
|
||||||
|
# Create AppImage
|
||||||
|
ARCH=x86_64 $APPIMAGETOOL "$appdir" "$appimage_file"
|
||||||
|
|
@ -118,11 +118,11 @@ find_program(RUBY_EXE ruby
|
||||||
set(game_dir "${CMAKE_BINARY_DIR}/bin")
|
set(game_dir "${CMAKE_BINARY_DIR}/bin")
|
||||||
set(data_dir "${game_dir}/Data")
|
set(data_dir "${game_dir}/Data")
|
||||||
set(xscripts "${data_dir}/xScripts.rxdata")
|
set(xscripts "${data_dir}/xScripts.rxdata")
|
||||||
add_custom_target(build-time-make-directory ALL
|
add_custom_target(data_dir ALL
|
||||||
COMMAND ${CMAKE_COMMAND} -E make_directory "${data_dir}")
|
COMMAND ${CMAKE_COMMAND} -E make_directory "${data_dir}")
|
||||||
add_custom_command(
|
add_custom_command(
|
||||||
OUTPUT "${xscripts}"
|
OUTPUT "${xscripts}"
|
||||||
COMMAND "${RUBY_EXE}" "${CMAKE_SOURCE_DIR}/rpgscript.rb" "${CMAKE_CURRENT_LIST_DIR}" "${game_dir}"
|
COMMAND "${RUBY_EXE}" "${CMAKE_SOURCE_DIR}/rpgscript.rb" "${CMAKE_CURRENT_LIST_DIR}" "${game_dir}"
|
||||||
DEPENDS _scripts.txt ${scripts}
|
DEPENDS _scripts.txt ${scripts} data_dir
|
||||||
COMMENT "Bundling xScripts.rxdata")
|
COMMENT "Bundling xScripts.rxdata")
|
||||||
add_custom_target(xScripts ALL DEPENDS "${xscripts}")
|
add_custom_target(xScripts ALL DEPENDS "${xscripts}")
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue