ivan-hc / KDE-games-suite-appimage

Arch Linux suite of KDE games: 41 apps in one AppImage (juNest's ArchImage)
https://github.com/ivan-hc/ArchImage
3 stars 1 forks source link

Kajongg is missing #3

Closed yarons closed 2 months ago

yarons commented 4 months ago

Hey, can you please add the Kajongg game to the package? Thanks.

ivan-hc commented 4 months ago

10 minutes and it should be ready

yarons commented 4 months ago

Already part of the image, downloading for testing.

ivan-hc commented 4 months ago

I had to add python, wait 10 minutes again

yarons commented 4 months ago

Just went back to report it, thanks.

yarons commented 4 months ago

Still not working:

Traceback (most recent call last):
  File "/usr/bin/kajongg", line 20, in <module>
    from qt import QObject, QCommandLineParser, QCommandLineOption, Qt, QGuiApplication
  File "/usr/share/kajongg/qt.py", line 12, in <module>
    from qtpy import uic
ModuleNotFoundError: No module named 'qtpy'
ivan-hc commented 4 months ago

yes, just seen... I'm adding it, package name python-qtpy

ivan-hc commented 4 months ago

Also pythyon-packaging is needed

ivan-hc commented 4 months ago
Traceback (most recent call last):
  File "/usr/bin/kajongg", line 20, in <module>
    from qt import QObject, QCommandLineParser, QCommandLineOption, Qt, QGuiApplication
  File "/usr/share/kajongg/qt.py", line 12, in <module>
    from qtpy import uic
  File "/usr/lib/python3.12/site-packages/qtpy/__init__.py", line 287, in <module>
    raise QtBindingsNotFoundError from None
qtpy.QtBindingsNotFoundError: No Qt bindings could be found
yarons commented 4 months ago

Is there a way to create a JuNest playground to try and play with it?

ivan-hc commented 4 months ago

sure https://github.com/fsquillace/junest

ivan-hc commented 4 months ago

As I've said in the other issue, I've also installed kajongg into a normal JuNest installation... but in this case I've got the same errors of the AppImage. It seems to be broken.

ivan-hc commented 4 months ago

Also, I've built kdegames (version 22.08) using the Debian Stable base, using this script: https://github.com/ivan-hc/KDE-games-suite-appimage/blob/main/kdegames but both kajongg and palapeli refuse to work and the latter goes in crash if I try (for example) to see the scores.

yarons commented 3 months ago

Maybe we should try and get some help from the KDE guys?

ivan-hc commented 3 months ago

can you tag someone?

ivan-hc commented 2 months ago

now that https://github.com/ivan-hc/KDE-games-suite-appimage/issues/4 has been fixed, I must try my best to fix this issue

ivan-hc commented 2 months ago

just noticed that also knetwalk and kubrick are black due to this error

    112570: find library=libd3d12.so [0]; searching
    112570:  search cache=/etc/ld.so.cache
    112570:  search path=/usr/lib       (system search path)
    112570:   trying file=/usr/lib/libd3d12.so
    112570: 
failed to create drawable
    112570: 
    112570: calling init: /usr/lib/qt6/plugins/imageformats/libqgif.so
    112570: 
    112570: 
    112570: calling init: /usr/lib/qt6/plugins/imageformats/libqico.so
    112570: 
    112570: find library=libjpeg.so.8 [0]; searching
    112570:  search path=/usr/lib/qt6/plugins/imageformats/../../../glibc-hwcaps/x86-64-v3:/usr/lib/qt6/plugins/imageformats/../../../glibc-hwcaps/x86-64-v2:/usr/lib/qt6/plugins/imageformats/../../..     (RUNPATH from file /usr/lib/qt6/plugins/imageformats/libqjpeg.so)
    112570:   trying file=/usr/lib/qt6/plugins/imageformats/../../../glibc-hwcaps/x86-64-v3/libjpeg.so.8
    112570:   trying file=/usr/lib/qt6/plugins/imageformats/../../../glibc-hwcaps/x86-64-v2/libjpeg.so.8
    112570:   trying file=/usr/lib/qt6/plugins/imageformats/../../../libjpeg.so.8
    112570: 
    112570: 
    112570: calling init: /usr/lib/qt6/plugins/imageformats/../../../libjpeg.so.8
    112570: 
    112570: 
    112570: calling init: /usr/lib/qt6/plugins/imageformats/libqjpeg.so
    112570: 
    112570: 
    112570: calling init: /usr/lib/qt6/plugins/imageformats/libqsvg.so
    112570: 
failed to create drawable
ivan-hc commented 2 months ago

I think qt6 have broken a lot of things here

ivan-hc commented 2 months ago

I'm not sure if I get issues because I use Nvidia on my host system, @yarons are you able to reproduce the issue with knetwalk, kreversi and kubrick?

@Samueru-sama can you test this too?

For example

./*.AppImage knetwalk

I don't know what library or variable I should det to made them work

Samueru-sama commented 2 months ago

I will look at it tomorrow

ivan-hc commented 2 months ago

What Arch Linux package provides "libd3d12.so"?

yarons commented 2 months ago

@ivan-hc it looks like a proprietary closed-source solution for WSL, this is a blog post from Microsoft: https://devblogs.microsoft.com/directx/directx-heart-linux/

I couldn't find it on Arch, the AUR is a different story yet there are directx packages (directx-header and shaders), I can't tell if they contain the file you mentioned.

yarons commented 2 months ago

knetwalk

image

kubrick

image

kajongg

Traceback (most recent call last):
  File "/usr/bin/kajongg", line 20, in <module>
    from qt import QObject, QCommandLineParser, QCommandLineOption, Qt, QGuiApplication
  File "/usr/share/kajongg/qt.py", line 12, in <module>
    from qtpy import uic
ModuleNotFoundError: No module named 'qtpy'
ivan-hc commented 2 months ago

If knetwalk, kubrik, kreversi and kbreakout are working for you I'm pretty sure that this is because I use Nvidia, and Archimages have not hardware accelleration.

At this point we need to investigate the reason because kajingg does not work. I've read somewhere that it uses qt5 or something, while in the messages I only see that the "qtpy" is missing. This is strange, because I've included a python-qtpy package in the AppImage.

ivan-hc commented 2 months ago

As I've suspected... I've uninstalled the Nvidia drivers and now with the Nouveaus this happens

Istantanea_2024-06-24_14-32-24 Istantanea_2024-06-24_14-31-56 Istantanea_2024-06-24_14-30-38 Istantanea_2024-06-24_14-31-33

ivan-hc commented 2 months ago

And if I remove the internal drivers, the app still works, but with error messages

Istantanea_2024-06-24_14-35-45

ivan-hc commented 2 months ago

And this is what happens if I try to bind/mount the "dri" directory (option --bind /usr/lib/x86_64-linux-gnu/dri /usr/lib/dri)

Istantanea_2024-06-24_14-39-00

yarons commented 2 months ago

I'm just wondering where you get the translations from.

ivan-hc commented 2 months ago

"bind" because JuNest uses Bubblewrap to integrate the Arch Linux container with the host, and binds/mounts some common paths.

I'm just wondering where you get the translations from.

This is the content of the AppRun

Click here to expand ``` #!/bin/sh HERE="$(dirname "$(readlink -f $0)")" export UNION_PRELOAD=$HERE export JUNEST_HOME=$HERE/.junest export PATH=$PATH:$HERE/.local/share/junest/bin if test -f /etc/resolv.conf; then ETC_RESOLV=' --bind /etc/resolv.conf /etc/resolv.conf '; fi if test -d /media; then MNT_MEDIA_DIR=' --bind /media /media '; fi if test -d /mnt; then MNT_DIR=' --bind /mnt /mnt '; fi if test -d /opt; then OPT_DIR=' --bind /opt /opt '; fi if test -d /run/user; then USR_LIB_LOCALE_DIR=' --bind /usr/lib/locale /usr/lib/locale '; fi if test -d /usr/share/fonts; then USR_SHARE_FONTS_DIR=' --bind /usr/share/fonts /usr/share/fonts '; fi if test -d /usr/share/themes; then USR_SHARE_THEMES_DIR=' --bind /usr/share/themes /usr/share/themes '; fi BINDS=" $ETC_RESOLV $MNT_MEDIA_DIR $MNT_DIR $OPT_DIR $USR_LIB_LOCALE_DIR $USR_SHARE_FONTS_DIR $USR_SHARE_THEMES_DIR " case $1 in '') echo " USAGE: [GAME] [GAME] [OPTION] See -h to know the names of the available games. "; exit;; -h|--help) echo " AVAILABLE KDE GAMES: bomber bovo granatier kajongg kapman katomic kblackbox kblocks kbounce kbreakout kdiamond kfourinline kgoldrunner kigo killbots kiriki kjumpingcube klickety klines kmahjongg kmines knavalbattle knetwalk knights kolf kollision konquest kpat kreversi kshisen ksirk ksnakeduel kspaceduel ksquares ksudoku ktuberling kubrick lskat palapeli picmi skladnik ";; bomber|bovo|granatier|kajongg|kapman|katomic|kblackbox|kblocks|kbounce|kbreakout|kdiamond|kfourinline|kgoldrunner|kigo|killbots|kiriki|kjumpingcube|klickety|klines|kmahjongg|kmines|knavalbattle|knetwalk|knights|kolf|kollision|konquest|kpat|kreversi|kshisen|ksirk|ksnakeduel|kspaceduel|ksquares|ksudoku|ktuberling|kubrick|lskat|palapeli|picmi|skladnik) $HERE/.local/share/junest/bin/junest -n -b "$BINDS" -- "$@" ;; *) echo " $1 does not exists, see -h";; esac ```

this is the line responsible of locale

if test -d /run/user; then USR_LIB_LOCALE_DIR=' --bind /usr/lib/locale /usr/lib/locale '; fi

this is for the fonts

if test -d /usr/share/fonts; then USR_SHARE_FONTS_DIR=' --bind /usr/share/fonts /usr/share/fonts '; fi

this is for themes

if test -d /usr/share/themes; then USR_SHARE_THEMES_DIR=' --bind /usr/share/themes /usr/share/themes '; fi
ivan-hc commented 2 months ago

this is the line responsible of locale

if test -d /run/user; then USR_LIB_LOCALE_DIR=' --bind /usr/lib/locale /usr/lib/locale '; fi

I use Debian, and in Arch Linux the path is the same, /usr/lib/locale

ivan-hc commented 2 months ago

when a directory of the host is mounted with bubblewrap, the related one on the guest/container does not exists

ivan-hc commented 2 months ago

hardware accelleration is a known issue https://github.com/ivan-hc/ArchImage/issues/20

ivan-hc commented 2 months ago

kajongg requires qt5

ivan@debian:~$ ./.local/share/junest/bin/junest -n -b " --bind /usr/lib/locale /usr/lib/locale --bind /usr/share/fonts /usr/share/fonts " -- kajongg
PySide6/__init__.py: Unable to import Shiboken from /usr/share/kajongg, /usr/lib/python312.zip, /usr/lib/python3.12, /usr/lib/python3.12/lib-dynload, /usr/lib/python3.12/site-packages
Traceback (most recent call last):
  File "/usr/bin/kajongg", line 18, in <module>
    from qtpy import QT5
  File "/usr/lib/python3.12/site-packages/qtpy/__init__.py", line 287, in <module>
    raise QtBindingsNotFoundError from None
qtpy.QtBindingsNotFoundError: No Qt bindings could be found
ivan-hc commented 2 months ago

Out of pyside6 and python-pyqt6 I added the package python-pyqt5 and this is what happened

ivan@debian:~$ ./.local/share/junest/bin/junest -n -b " --bind /usr/lib/locale /usr/lib/locale --bind /usr/share/fonts /usr/share/fonts " -- kajongg
PySide6/__init__.py: Unable to import Shiboken from /usr/share/kajongg, /usr/lib/python312.zip, /usr/lib/python3.12, /usr/lib/python3.12/lib-dynload, /usr/lib/python3.12/site-packages
Traceback (most recent call last):
  File "/usr/bin/kajongg", line 18, in <module>
    from qtpy import QT5
  File "/usr/lib/python3.12/site-packages/qtpy/__init__.py", line 287, in <module>
    raise QtBindingsNotFoundError from None
qtpy.QtBindingsNotFoundError: No Qt bindings could be found
ivan-hc commented 2 months ago

Extracted shiboken6 and this is the message

ivan@debian:~$ ./.local/share/junest/bin/junest -n -b " --bind /usr/lib/locale /usr/lib/locale --bind /usr/share/fonts /usr/share/fonts " -- kajongg
Traceback (most recent call last):
  File "/usr/bin/kajongg", line 19, in <module>
    from qt import QObject, QCommandLineParser, QCommandLineOption, Qt, QGuiApplication
  File "/usr/share/kajongg/qt.py", line 12, in <module>
    from qtpy import uic, QT5, QT6
  File "/usr/lib/python3.12/site-packages/qtpy/uic.py", line 76, in <module>
    from PySide6.QtUiTools import QUiLoader, loadUiType
ImportError: libQt6UiTools.so.6: cannot open shared object file: No such file or directory
ivan-hc commented 2 months ago

Extracted qt6-tools

ivan@debian:~$ ./.local/share/junest/bin/junest -n -b " --bind /usr/lib/locale /usr/lib/locale --bind /usr/share/fonts /usr/share/fonts " -- kajongg
Traceback (most recent call last):
  File "/usr/bin/kajongg", line 19, in <module>
    from qt import QObject, QCommandLineParser, QCommandLineOption, Qt, QGuiApplication
  File "/usr/share/kajongg/qt.py", line 147, in <module>
    from PyQt6 import sip  # type:ignore[no-redef]
    ^^^^^^^^^^^^^^^^^^^^^
ImportError: cannot import name 'sip' from 'PyQt6' (/usr/lib/python3.12/site-packages/PyQt6/__init__.py)
ivan-hc commented 2 months ago

python-pyqt6-sip

ivan-hc commented 2 months ago

python-twisted

ivan-hc commented 2 months ago

python-incremental

ivan-hc commented 2 months ago

python-attrs

ivan-hc commented 2 months ago

python-typing_extensions

PS: this is why I hate Python

ivan-hc commented 2 months ago
ivan@debian:~$ ./.local/share/junest/bin/junest -n -b " --bind /usr/lib/locale /usr/lib/locale --bind /usr/share/fonts /usr/share/fonts " -- kajongg
Traceback (most recent call last):
  File "/usr/bin/kajongg", line 163, in <module>
    parseOptions()
  File "/usr/bin/kajongg", line 135, in parseOptions
    from query import initDb
  File "/usr/share/kajongg/query.py", line 22, in <module>
    from log import logInfo, logWarning, logException, logError, logDebug
  File "/usr/share/kajongg/log.py", line 23, in <module>
    from dialogs import Sorry, Information, NoPrompt
  File "/usr/share/kajongg/dialogs.py", line 15, in <module>
    from twisted.internet.defer import Deferred, succeed
  File "/usr/lib/python3.12/site-packages/twisted/internet/defer.py", line 48, in <module>
    from twisted.internet.interfaces import IDelayedCall, IReactorTime
  File "/usr/lib/python3.12/site-packages/twisted/internet/interfaces.py", line 26, in <module>
    from zope.interface import Attribute, Interface
ModuleNotFoundError: No module named 'zope'

what package should I pick from https://archlinux.org/packages/?sort=&q=python+zope&maintainer=&flagged= ?

ivan-hc commented 2 months ago

python-zope-interface

ivan-hc commented 2 months ago

python-constantly

ivan-hc commented 2 months ago

@yarons the app is launched, but crashes if i try to play

https://github.com/ivan-hc/KDE-games-suite-appimage/assets/88724353/c3ff508d-1a07-4c83-92ab-f14abf4f6d51

ivan-hc commented 2 months ago

this is the message I get

ivan@debian:~$ ./.local/share/junest/bin/junest -n -b " --bind /usr/lib/locale /usr/lib/locale --bind /usr/share/fonts /usr/share/fonts " -- kajongg
Traceback (most recent call last):
  File "/usr/share/kajongg/mainwindow.py", line 321, in playGame
    self.startPlayingGame()
  File "/usr/share/kajongg/mainwindow.py", line 326, in startPlayingGame
    HumanClient()
  File "/usr/share/kajongg/humanclient.py", line 412, in __init__
    Connection(self).login().addCallbacks(
    ^^^^^^^^^^^^^^^^
  File "/usr/share/kajongg/login.py", line 475, in __init__
    self.dlg = LoginDlg()
               ^^^^^^^^^^
  File "/usr/share/kajongg/login.py", line 277, in __init__
    self.serverChanged()
  File "/usr/share/kajongg/login.py", line 328, in serverChanged
    self.cbUser.addItem(user.fullName() or user.loginName())
                        ^^^^^^^^^^^^^^^
  File "/usr/share/kajongg/kdestub.py", line 320, in fullName
    return pwd.getpwnam(self.loginName()).pw_gecos.replace(',', '')
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
KeyError: "getpwnam(): name not found: 'ivan'"

what should I do now?

ivan-hc commented 2 months ago

I think that kajongg has so many requirements that deserve a standalone AppImage.

Each kde game as a standalone game is about 120-200 MB, this is why I distribute all of them into one single AppImage. Its more convenient.

However, no other kde game require so many python modules to be in place.

ivan-hc commented 2 months ago

Just rebuilt from scratch, the AppImage is 550 MB and the game does not crashes... but I get these messages when I try to start a new game

ivan@debian:~/Scrivania/tmp$ ./KDE-GAMES-SUITE_24.05-1-archimage3.4.2-x86_64.AppImage kajongg
Setting $HOME to /home/ivan/Scrivania/tmp/KDE-GAMES-SUITE_24.05-1-archimage3.4.2-x86_64.AppImage.home
Traceback (most recent call last):
  File "/usr/lib/python3.12/site-packages/twisted/internet/unix.py", line 410, in startListening
    skt.bind(self.port)
OSError: AF_UNIX path too long

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/share/kajongg/server.py", line 484, in kajonggServer
    reactor.listenUNIX(Options.socket, factory)
  File "/usr/lib/python3.12/site-packages/twisted/internet/posixbase.py", line 265, in listenUNIX
    p.startListening()
  File "/usr/lib/python3.12/site-packages/twisted/internet/unix.py", line 412, in startListening
    raise error.CannotListenError(None, self.port, le)
twisted.internet.error.CannotListenError: Couldn't listen on any:b'/home/ivan/Scrivania/tmp/KDE-GAMES-SUITE_24.05-1-archimage3.4.2-x86_64.AppImage.home/.kajonggserver/socket8302': AF_UNIX path too long.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/kajonggserver", line 14, in <module>
    kajonggServer()
  File "/usr/share/kajongg/server.py", line 490, in kajonggServer
    logWarning(errObj)
  File "/usr/share/kajongg/log.py", line 161, in logWarning
    return logMessage(msg, logging.WARNING, True, withGamePrefix=withGamePrefix)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/share/kajongg/log.py", line 124, in logMessage
    msg = __exceptionToString(msg)
          ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/share/kajongg/log.py", line 105, in __exceptionToString
    f'[Errno {arg.errno}] {i18n(arg.strerror)}')
                           ^^^^^^^^^^^^^^^^^^
  File "/usr/share/kajongg/mi18n.py", line 88, in i18n
    result = __insertArgs(_, *args)
             ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/share/kajongg/mi18n.py", line 59, in __insertArgs
    if '\004' in translatedTemplate:
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: argument of type 'NoneType' is not iterable
--- Logging error ---
Traceback (most recent call last):
  File "/usr/lib/python3.12/logging/handlers.py", line 1001, in emit
    self.socket.send(msg)
OSError: [Errno 9] Descrittore di file errato

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.12/logging/handlers.py", line 869, in _connect_unixsocket
    self.socket.connect(address)
FileNotFoundError: [Errno 2] File o directory non esistente

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.12/logging/handlers.py", line 1004, in emit
    self._connect_unixsocket(self.address)
  File "/usr/lib/python3.12/logging/handlers.py", line 880, in _connect_unixsocket
    self.socket.connect(address)
FileNotFoundError: [Errno 2] File o directory non esistente
Call stack:
  File "/usr/bin/kajongg", line 193, in <module>
    Internal.app.exec()
  File "/usr/share/kajongg/qtreactor.py", line 234, in _iterate
    self.runUntilCurrent()
  File "/usr/lib/python3.12/site-packages/twisted/internet/base.py", line 1090, in runUntilCurrent
    call.func(*call.args, **call.kw)
  File "/usr/lib/python3.12/site-packages/twisted/internet/defer.py", line 877, in callback
    self._startRunCallbacks(result)
  File "/usr/lib/python3.12/site-packages/twisted/internet/defer.py", line 984, in _startRunCallbacks
    self._runCallbacks()
  File "/usr/lib/python3.12/site-packages/twisted/internet/defer.py", line 1078, in _runCallbacks
    current.result = callback(  # type: ignore[misc]
  File "/usr/lib/python3.12/site-packages/twisted/internet/task.py", line 872, in cb
    return callable(*args, **kw)
  File "/usr/share/kajongg/login.py", line 137, in startServer
    logDebug(f'Game {SingleshotOptions.game}: Server {self} not available after 30 seconds, aborting')
  File "/usr/share/kajongg/log.py", line 156, in logDebug
    return logMessage(msg, logging.DEBUG, False, showStack=showStack, withGamePrefix=withGamePrefix)
  File "/usr/share/kajongg/log.py", line 127, in logMessage
    __logUnicodeMessage(prio, __enrichMessage(msg, withGamePrefix))
  File "/usr/share/kajongg/log.py", line 62, in __logUnicodeMessage
    Internal.logger.log(prio, msg)
Message: 'C: Game None: Server /home/ivan/Scrivania/tmp/KDE-GAMES-SUITE_24.05-1-archimage3.4.2-x86_64.AppImage.home/.kajonggserver/socket8302 not available after 30 seconds, aborting'
Arguments: ()
C: Game None: Server /home/ivan/Scrivania/tmp/KDE-GAMES-SUITE_24.05-1-archimage3.4.2-x86_64.AppImage.home/.kajonggserver/socket8302 not available after 30 seconds, aborting

the table is blank

Istantanea_2024-06-24_16-29-33

ivan-hc commented 2 months ago

@yarons I don't think that this is normal

ivan-hc commented 2 months ago

@yarons I've found the issue!

Every time I create an AppImage I add a directory with the same name and extension .home not to create dotfiles in my $HOME directory.

Kajongg requires to work into an absolute path, so I've removed that directory and this is what happens

https://github.com/ivan-hc/KDE-games-suite-appimage/assets/88724353/38be7c54-6221-4692-8b8a-4d8ce1a00776

@Samueru-sama I don't know how much this will work with the --sandbox option of our "AM" package manager, but I'm sure it will do!

For now I'm going update this AppImage.

About 3d hardware accelleration, this is something I need to solve at https://github.com/ivan-hc/ArchImage/issues/20

I'll close this issue with the next commit.

@yarons You may need to wait the next release, from about 10-15 minutes from this message.