Skip to content

SailfishOS support based on SDL2

savegame requested to merge github/fork/savegame/3.1_sailfish_sdl2 into master

This PR add to Godot Engine support for exporting Godot GLES2 games to SailfishOS binary format.
With this export templates already exists few demos and games:

PR bugs fixed :

  • clang-fomat code styling fixed
  • fix glitches on screen rotation fixed

This pull request fix #26018 issue I am using sources from two pull request

and build Godot engine for SaiflsihOS.

What is done:

  • touch screen input
  • dynamic orientation events ( Sailfish 3.* have update SDL2 to 2.0.9 👍 )
  • dynamic orientation change ( with SDL_SetHint(SDL_HINT_QTWAYLAND_CONTENT_ORIENTATION,"") - not documented in SDL2 wiki, only in SDL_Hints.h header )
  • normal application life cycle
  • sound initialization
  • joypad (just compile already exists libudev implementation of LinuxJoypad, works nice )

What is not done (in next update):

  • device vibrations
  • use d-bus for disable screen blank (sleep) while engine run in foreground
  • pause engiene when application not in foreground
  • gyroscope events (not implemented in SDL2 (not try in new SDL2 ) )
  • build RPM with exported project (now i use make_rpm.sh script, and that instructions )
  • show native keyboard (maliit keyboard) when use text edit UI items

Known bugs:

  • dont work on Jolla 1, cant debug it, dont have that device
  • have shader compilation error on Jolla Tablet (i try to fix it, now wait test result from users - becuse dont have that device by my self) fixed
  • SailfishOS platfrom dont support GLES3 for now, waiting for pull request to libhybris

Build Instructions:

For build this branch on SailfishOS, need SailfishSDK (or Sailfish Docker image), all build commands are looks like:

export SAILFISH_SDK=$HOME/SailfishOS/
export SSH_MER_KEY=${SAILFISH_SDK}/vmshare/ssh/private_keys/engine/mersdk
export MERSSH_PORT=2222
export MERSSH="ssh  -o "IdentitiesOnly=yes" -i \"$SSH_MER_KEY\" -p $MERSSH_PORT"
# GODOT_PATH - path to godot sources inside MerSDK (SailfishSDK) build machine
export GODOT_PATH=/home/mersdk/share/Projects/Sailfish/godot
# version of taget Sailfish platform, should be more than or equal to 3.1.0.12 (becuse of SDL2 version)
export MER_TARGET_VERSION=3.2.0.12
# architecture can be i486 or armv7hl
export MER_TARGET_ARCH=armv7hl
export GODOT_ARCH=`[ "$MER_TARGET_ARCH" == "armv7hl" ] && echo arm || echo x86`
export MER_TARGET=SailfishOS-${MER_TARGET_VERSION}-${MER_TARGET_ARCH}
#first install dependencies
$MERSSH "sb2 -t ${MER_TARGET} -R zypper in -y SDL2-debugsource SDL2-devel libaudioresource-devel pulseaudio-devel openssl-devel wayland-devel libpng-devel libxkbcommon-devel libudev-devel scons"
#than build 
$MERSSH "cd $GODOT_PATH && sb2 -t ${MER_TARGET}  scons -j 8 platform=sailfish target=release arch=${GODOT_ARCH} bits=32"

and here is instructions how use docker with sailfish SDK (thanks to @coderus 👍 )

Latest build release

Merge request reports