Simulator support for Ubuntu 24.04

I am uncertain if this can be considered a bug, or a feature request.

I initially posted detail of the issue in the SDK Get Help category:
https://devforum.play.date/t/issue-while-launching-the-playdate-simulator-on-ubuntu-24-04/

While running the latest SDK (2.4.2) on Ubuntu 24.04, attempting to launch the simulator results in the following error:

PlaydateSimulator: error while loading shared libraries: libwebkit2gtk-4.0.so.37: cannot open shared object file: No such file or directory

It appears that the package version requested is not part of the OS and appears to be unavailable from the Ubuntu 24.04 repositories.

I tried running:

sudo apt-get install libwebkit2gtk-4.0-37

Which gave:

Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package libwebkit2gtk-4.0-37
E: Couldn't find any package by glob 'libwebkit2gtk-4.0-37'
E: Couldn't find any package by regex 'libwebkit2gtk-4.0-37'

Running the following command, to check what is available:

apt-cache search libwebkit

Returns:

libwebkit2gtk-4.0-doc - WebKitGTK documentation (transitional dummy package)
libwebkit2gtk-4.1-0 - Web content engine library for GTK
libwebkitgtk-6.0-4 - Web content engine library for GTK
libwebkitgtk-doc - Web content engine library for GTK - documentation
libwebkit2gtk-4.1-dev - Web content engine library for GTK - development files
libwebkitgtk-6.0-dev - Web content engine library for GTK - development files

main, universe, restricted and multiverse repositories are enabled.

Does the SDK need to be updated to work with the more recent version of libwebkit2gtk supplied as part of Ubuntu 24.04?

Thanks for your help!

2 Likes

Thanks for the report! I'll add it to our bug tracker.

3 Likes

Could an AppImage (https://appimage.org/) be a solution for the Simulator ?

I was able to fix this issue with the simulator on Linux Mint and it should work for you.

I had two errors:

/PlaydateSimulator: error while loading shared libraries: libwebkit2gtk-4.0.so.37: cannot open shared object file: No such file or directory

I fixed this by creating a symbolic link to have the simulator think it was opening libwebkit2gtk-4.0.so.37 but it was really opening what I have installed.

sudo ln -s /usr/lib/x86_64-linux-gnu/libwebkit2gtk-4.1.so.0 /usr/lib/x86_64-linux-gnu/libwebkit2gtk-4.0.so.37

Then I got a second error, but fixable in the same way.

./PlaydateSimulator: error while loading shared libraries: libjavascriptcoregtk-4.0.so.18: cannot open shared object file: No such file or directory

Created a symbolic link

sudo ln -s /usr/lib/x86_64-linux-gnu/libjavascriptcoregtk-4.1.so.0 /usr/lib/x86_64-linux-gnu/libjavascriptcoregtk-4.0.so.18

Not an ideal situation, but now the simulator runs!

1 Like

I just realized this was from a year ago... :upside_down_face:

Yeah yeah. It was me resurrecting an old thread.
Btw, I eventually made an appimage.

version: 1

script:
  - mkdir -p $TARGET_APPDIR/bin $TARGET_APPDIR/lib/x86_64-linux-gnu
  - cp "$PLAYDATE_SDK_PATH/bin/PlaydateSimulator" $TARGET_APPDIR/bin
  - cp "$(dirname $RECIPE)/../dependencies/hashlink/libhl.so" $TARGET_APPDIR/lib/x86_64-linux-gnu
  - cp -R "$PLAYDATE_SDK_PATH/Disk" $TARGET_APPDIR

AppDir:
  app_info:
    id: panic.PlaydateSimulator
    name: playdate-simulator
    version: 2.6.2
    exec: bin/PlaydateSimulator
    exec_args: $@

  apt:
    arch: amd64
    sources:
      - sourceline: 'deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ jammy main restricted universe multiverse'
        key_url: 'http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x871920D1991BC93C'
      - sourceline: 'deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ jammy-updates main restricted universe multiverse'
      - sourceline: 'deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ jammy-backports main restricted universe multiverse'

    include:
      - libwebkit2gtk-4.0-37
      - libjavascriptcoregtk-4.0-18
      - libgdk-pixbuf2.0-0
      - librsvg2-common
      - shared-mime-info
    exclude:
      - adwaita-icon-theme
      - humanity-icon-theme

  files:
    exclude:
      - usr/lib/x86_64-linux-gnu/gconv
      - usr/share/man
      - usr/share/doc/*/README.*
      - usr/share/doc/*/changelog.*
      - usr/share/doc/*/NEWS.*
      - usr/share/doc/*/TODO.*

  after_bundle: |
    cp $TARGET_APPDIR/usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-svg.so $TARGET_APPDIR/usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader_svg.so

  runtime:
    env:
      APPDIR_LIBRARY_PATH: '$APPDIR/lib/systemd:$APPDIR/lib/x86_64:$APPDIR/lib/x86_64-linux-gnu:$APPDIR/lib/x86_64-linux-gnu/security:$APPDIR/usr/lib/aspell/x86_64-linux-gnu:$APPDIR/usr/lib/x86_64-linux-gnu:$APPDIR/usr/lib/x86_64-linux-gnu/caca:$APPDIR/usr/lib/x86_64-linux-gnu/enchant-2:$APPDIR/usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders:$APPDIR/usr/lib/x86_64-linux-gnu/gstreamer-1.0:$APPDIR/usr/lib/x86_64-linux-gnu/gtk-3.0/3.0.0/immodules:$APPDIR/usr/lib/x86_64-linux-gnu/gtk-3.0/3.0.0/printbackends:$APPDIR/usr/lib/x86_64-linux-gnu/krb5/plugins/preauth:$APPDIR/usr/lib/x86_64-linux-gnu/libv4l:$APPDIR/usr/lib/x86_64-linux-gnu/libv4l/plugins:$APPDIR/usr/lib/x86_64-linux-gnu/pulseaudio:$APPDIR/lib/x86_64'

AppImage:
  arch: amd64