Sorry for the weird phrasing, but basically, I’m trying to package a source port of a game for which the default game data install location is ../share/vanillatd or ../share/vanillara(it covers the original Command & Conquer as well as Red Alert).
Because I don’t want to ask users to create folders and install the game data in /var/lib/flatpak/app/com.github.vanillaconquer.Vanilla-Conquer/x86_64/master/26fefaf6c137637293569700598454a6749cb1ef0bc445355d087f60d970e0ec/files/share because that’s silly, I want to create the folder structure and barebone config files pointing to /home/hazelnot/.var/app/com.github.vanillaconquer.Vanilla-Conquer/data/vanillatd/.
The problem is that I’m not really sure how to do that, since it seems like the config files only point the executables to the exact path defined in the file. I assume there has to be some shell script-y way of defining it before installing the config file, but I’m not sure how to do that? Since if I hardcode it in the file itself it looks like it would have to directly use the username of the current user
It’s my first time attempting to create a Flatpak (and it’s actually already functional, though it does currently require the user to manually set a data path in the config file, and it also doesn’t have icons or desktop files yet), so I would really appreciate any help with this!
You cannot touch this path, that stores the checkout of the actual app and is managed by Flatpak. So the correct path is this indeed
barebone config files pointing to /home/hazelnot/.var/app/com.github.vanillaconquer.Vanilla-Conquer/data/vanillatd/.
since it seems like the config files only point the executables to the exact path defined in the file. I assume there has to be some shell script-y way of defining it before installing the config file, but I’m not sure how to do that?
It’s not entirely clear what the problem is here or how it relates to Flatpak. The above correct path would be XDG_DATA_HOME inside the sandbox so simply create your game folder relative to that variable in the source code.
Since if I hardcode it in the file itself it looks like it would have to directly use the username of the current user
No just resolve it relative to XDG_DATA_HOME in your code. It will automatically expand to the absolute path.
I’m not actually a programmer, I’m just packaging the app more as a learning experience, and the actual lead dev of the project doesn’t think it’s a good idea to do that (he doesn’t want people to have to install the game data separately per user in the case of multiple users).
It does turn out that there’s another location it looks for the data in - ~/.config/vanilla[td/ra], which does get pointed to usable locations inside the sandbox, so I’ll just ask users to place the game data in ~/var/app/io.github.theassemblyarmada/config/vanilla[td/ra] (I renamed the package after reading the Flathub submission requirements lol).