Hello there, I’ve made a WIP package file for this software, I have a couple of questions though. : )
Thank you for doing this!
Does this have an Icon? Usually we take Icons of other OSes and remake them in the Haiku icon style for ports.
Yes, the icon is in garglk/gargoyle-house.png.
What is up with the stuff it tries to put into libexec? Haiku does not have this directory, and i don’t understand what it does on linux either, is this just executables the main executable wants to find? Could they be put into the data directory instead?
EDIT: after updating to the proper cmake args in the recipe it no longer does this, hopefully it works regardless
Gargoyle is slightly odd here, in how it works. Briefly, there are a bunch of different “interpreters”, or game players, for various types of game (Infocom games, Magnetic Scrolls games, etc). Gargoyle provides an implementation of a common I/O interface called Glk, which was designed for these kinds of games. All the interpreters use Glk for their I/O, so ultimately all those files in libexec are the individual interpreters, each one linked to libgarglk, which provides the Glk implementation. These are the actual programs which run the games.
Finally, there is a launcher, which is the “gargoyle” binary. This is the main entry point, and all it does is determine which interpreter to run for a specific file, and calls it. Finding the interpreters is one of the few areas where some platform-specific code might be needed. On macOS, for example, the interpreters are all packaged into the disk image bundle, and it knows to look there. On Windows, the interpreters are installed alongside the gargoyle.exe, and it knows to look for interpreters in the same directory as gargoyle.exe. On Unix, $PREFIX/libexec/gargoyle is built in as the directory to use.
The relevant code is in garglk/launchqt.cpp, in
main. If it’s needed, I can add code specifically for Haiku to search for interpreters.
Where does the application look for config? it seems on linux this is some .rc file in $HOME, In haiku we have a proper API to locate these directories instead (The Haiku Book: FindDirectory.h File Reference), I had looked at the code, but i don’t really understand it to patch it.
Configuration with Gargoyle is messy for various reasons (some historical). On Unix platforms it uses $XDG_CONFIG_HOME to determine the config file location. I noticed that Haiku sets this environment variable, so I assumed it was safe to use it, which means that for now it looks in
$XDG_CONFIG_HOME/garglk.ini, which on my system expands to
I’m guessing that that’s just a hack to support Unix code which doesn’t know any better. And in fact, I’m aware of
find_directory(B_USER_SETTINGS_DIRECTORY, ..), given that I used it in one of the interpreters bundled with Gargoyle; somehow it just slipped my mind that it existed! I’ll add Haiku-specific code to look up the config file.
So ultimately, if it sounds right, the config file will be in
<B_USER_SETTINGS_DIRECTORY>/Gargoyle; but if there’s a better naming convention, do let me know, and I’ll conform to it.
Where are some scripts or files I can use to test this engine?
The IFDB is the best place to find all sorts of games that will work with Gargoyle.
For a specific one (so you don’t have to waste time searching), you can give Anchorhead a go. You can either run it with the gargoyle launcher (to see if it’s got paths to interpreters set up properly), or run it directly with the “bocfel” interpreter, which is used for .z8 games.
And here, my WIP recipe to play around with:
Thank you! I’ll start familiarizing myself with Haiku recipes.