tkashkin / GameHub

All your games in one place
https://tkashkin.github.io/projects/gamehub
GNU General Public License v3.0
2.23k stars 129 forks source link

Gamehub cannot detect cores of flatpak version of RetroArch, even after doing #421 #624

Closed ghost closed 2 years ago

ghost commented 2 years ago
Expected behavior

Gamehub detects RetroArch cores in settings.

Actual behavior

Gamehub detects RetroArch but not its cores.

Steps to reproduce

After adding a script called "retroarch" to a local bin directory and making it executable:

!/bin/bash

flatpak run org.libretro.RetroArch "@$"

I also tried changing the core and core info default directories to /var/lib/flatpak/app/org.libretro.RetroArch/x86_64/stable/[bunch of numbers]/files/share/libretro and /var/lib/flatpak/app/org.libretro.RetroArch/x86_64/stable/[bunch of numbers]/files/share/libretro/info

to no avail.

By the way, when talking about "Libretro core directory", we're talking about the "main" directory, right? "core" is also used for "emulation cores" so it can be confusing.

Version and environment
PASTE VERSION INFO HERE

GameHub Version: 0.16.2-448a0bd-dev Branch: dev Commit: 448a0bd505606d4151986838356ddc8fff9977fd

ghost commented 2 years ago

Here's what finally worked for me:

Like #421 suggested, adding a script called "retroarch" to my /bin directory and making it executable: The script contains the following lines:

!/bin/bash

flatpak run org.libretro.RetroArch "@$"

Then, the correct location for "Libretro core directory" is /home/nigel/.var/app/org.libretro.RetroArch/config/retroarch/cores, and the correct location for "Libretro core info directory" is /usr/share/libretro/info

However, I'm not sure that the "Libretro core info directory" and its files were created when I installed the flatpak version of RetroArch. There's a chance it might come from the Software Manager version, which is quite old, and doesn't let you download cores from within the app. Some icons are also missing. That is why we need to use the flatpak version, at least on Debian-based distributions.

Hopefully, something more straightforward can be done directly from Gamehub that would make things easier and automatic in the future.

By the way, I kind of understand what "#!" is now, but I have no idea what "@$" means. When searching for its meaning, all I could find what the meaning of "$@". Just out of curiosity, I tried it, and it still works... Strange.

jamie-belanger commented 2 years ago

Thanks, this config fixed my issue with the flatpak retroarch

By the way, I kind of understand what "#!" is now, but I have no idea what "@$"

It's a bash special parameter used to pass arguments through the shell script into the program you are calling. And it's actually backward; it should be "$@"

Source: https://www.gnu.org/software/bash/manual/html_node/Special-Parameters.html