nspire-emus / firebird

Multi-platform emulator of TI Nspire calculators
GNU General Public License v3.0
697 stars 69 forks source link

MobileUI with a custom AppImage #354

Open cgloeckner opened 4 days ago

cgloeckner commented 4 days ago

Hey, I've created an AppImage using the help of ChatGPT but the emulator states that it cannot create the mobile UI. The AppImage stops working. Disabling the mobile UI and switching back to the desktop UI allows the AppImage to start. But personally I prefer the mobile UI because it fills the screen.

I'm fairly new to AppImages. Maybe the steps provided by ChatGPT are not correct... idk. Maybe linuxdeployqt does not gather all required Qt-libs...

I've attached ChatGPT's answer about creating the AppImage: chatgpt.md

And here's the terminal output of the bundled application (using the latest git version, compiled myself).

$ ./Firebird_Emu-x86_64.AppImage 
qrc:/qml/qml/ScrollingKeypad.qml:2:1: module "QtQuick.Controls" is not installed
qrc:/qml/qml/ScrollingKeypad.qml:1:1: module "QtQuick" is not installed
qrc:/qml/qml/ScrollingKeypad.qml:2:1: module "QtQuick.Controls" is not installed
qrc:/qml/qml/ScrollingKeypad.qml:1:1: module "QtQuick" is not installed
Could not create QML config dialog: "qrc:/qml/qml/FBConfigDialog.qml:2 module \"QtQuick.Window\" is not installed\nqrc:/qml/qml/FBConfigDialog.qml:1 module \"QtQuick\" is not installed\nqrc:/qml/qml/FBConfigDialog.qml:3 module \"QtQuick.Controls\" is not installed\nqrc:/qml/qml/FBConfigDialog.qml:4 module \"QtQuick.Layouts\" is not installed\nqrc:/qml/qml/FBConfigDialog.qml:2 module \"QtQuick.Window\" is not installed\nqrc:/qml/qml/FBConfigDialog.qml:1 module \"QtQuick\" is not installed\nqrc:/qml/qml/FBConfigDialog.qml:3 module \"QtQuick.Controls\" is not installed\nqrc:/qml/qml/FBConfigDialog.qml:4 module \"QtQuick.Layouts\" is not installed\nqrc:/qml/qml/FBConfigDialog.qml:2 module \"QtQuick.Window\" is not installed\nqrc:/qml/qml/FBConfigDialog.qml:1 module \"QtQuick\" is not installed\nqrc:/qml/qml/FBConfigDialog.qml:3 module \"QtQuick.Controls\" is not installed\nqrc:/qml/qml/FBConfigDialog.qml:4 module \"QtQuick.Layouts\" is not installed\nqrc:/qml/qml/FBConfigDialog.qml:2 module \"QtQuick.Window\" is not installed\nqrc:/qml/qml/FBConfigDialog.qml:1 module \"QtQuick\" is not installed\nqrc:/qml/qml/FBConfigDialog.qml:3 module \"QtQuick.Controls\" is not installed\nqrc:/qml/qml/FBConfigDialog.qml:4 module \"QtQuick.Layouts\" is not installed\n"
Could not create flash dialog component: "qrc:/qml/qml/FlashDialog.qml:1 module \"QtQuick\" is not installed\nqrc:/qml/qml/FlashDialog.qml:4 module \"QtQuick.Dialogs\" is not installed\nqrc:/qml/qml/FlashDialog.qml:2 module \"QtQuick.Layouts\" is not installed\nqrc:/qml/qml/FlashDialog.qml:3 module \"QtQuick.Controls\" is not installed\nqrc:/qml/qml/FlashDialog.qml:1 module \"QtQuick\" is not installed\nqrc:/qml/qml/FlashDialog.qml:4 module \"QtQuick.Dialogs\" is not installed\nqrc:/qml/qml/FlashDialog.qml:2 module \"QtQuick.Layouts\" is not installed\nqrc:/qml/qml/FlashDialog.qml:3 module \"QtQuick.Controls\" is not installed\nqrc:/qml/qml/FlashDialog.qml:1 module \"QtQuick\" is not installed\nqrc:/qml/qml/FlashDialog.qml:4 module \"QtQuick.Dialogs\" is not installed\nqrc:/qml/qml/FlashDialog.qml:2 module \"QtQuick.Layouts\" is not installed\nqrc:/qml/qml/FlashDialog.qml:3 module \"QtQuick.Controls\" is not installed\nqrc:/qml/qml/FlashDialog.qml:1 module \"QtQuick\" is not installed\nqrc:/qml/qml/FlashDialog.qml:4 module \"QtQuick.Dialogs\" is not installed\nqrc:/qml/qml/FlashDialog.qml:2 module \"QtQuick.Layouts\" is not installed\nqrc:/qml/qml/FlashDialog.qml:3 module \"QtQuick.Controls\" is not installed\n"
Could not create mobile UI component: "qrc:/qml/qml/MobileUI.qml:6 module \"QtQuick.Dialogs\" is not installed\nqrc:/qml/qml/MobileUI.qml:7 module \"QtQuick.Layouts\" is not installed\nqrc:/qml/qml/MobileUI.qml:5 module \"QtQuick.Controls\" is not installed\nqrc:/qml/qml/MobileUI.qml:4 module \"QtQuick\" is not installed\nqrc:/qml/qml/MobileUI.qml:6 module \"QtQuick.Dialogs\" is not installed\nqrc:/qml/qml/MobileUI.qml:7 module \"QtQuick.Layouts\" is not installed\nqrc:/qml/qml/MobileUI.qml:5 module \"QtQuick.Controls\" is not installed\nqrc:/qml/qml/MobileUI.qml:4 module \"QtQuick\" is not installed\nqrc:/qml/qml/MobileUI.qml:6 module \"QtQuick.Dialogs\" is not installed\nqrc:/qml/qml/MobileUI.qml:7 module \"QtQuick.Layouts\" is not installed\nqrc:/qml/qml/MobileUI.qml:5 module \"QtQuick.Controls\" is not installed\nqrc:/qml/qml/MobileUI.qml:4 module \"QtQuick\" is not installed\nqrc:/qml/qml/MobileUI.qml:6 module \"QtQuick.Dialogs\" is not installed\nqrc:/qml/qml/MobileUI.qml:7 module \"QtQuick.Layouts\" is not installed\nqrc:/qml/qml/MobileUI.qml:5 module \"QtQuick.Controls\" is not installed\nqrc:/qml/qml/MobileUI.qml:4 module \"QtQuick\" is not installed\n"
QQmlComponent: Component is not ready
Could not create mobile UI!

Cheers glocke

Vogtinator commented 4 days ago

Maybe the steps provided by ChatGPT are not correct... idk.

Probably. LLMs are good at producing broken stuff that only looks good at first glance.

In this case it looks like linuxdeployqt didn't install any QML modules, which is odd. Maybe you need to pass similar parameters like done for windeployqt: https://github.com/nspire-emus/firebird/blob/5b2a1a3a7aff68442e4117c2918c495e993a1552/.github/workflows/windows.yml#L51

cgloeckner commented 4 days ago

Specifying the qml-folder was the missing piece! The AppImage seems to function as normal, I'll test it tomorrow on another machine.

Here's how I've created it inside the cloned git repo's build directory:

cd firebird/build

# download deployment tool
wget https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage
chmod a+x linuxdeployqt-continuous-x86_64.AppImage

# prepare AppDir
mkdir -p AppDir/usr/bin
cp firebird-emu AppDir/usr/bin/
cp ../resources/org.firebird-emus.firebird-emu.desktop AppDir/
cp ../resources/org.firebird-emus.firebird-emu.png AppDir/

# create AppImage
./linuxdeployqt-continuous-x86_64.AppImage AppDir/usr/bin/firebird-emu -qmldir=../qml -appimage

Maybe that's useful to integrate AppImage creation into the github workflow.

Vogtinator commented 3 days ago

Yes, or maybe just OBS which can build AppImage relatively easily such that they also run on older platforms.

An AppImage.yml would be needed for that.