New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Linux: Drop the ".bin" binary suffix (i.e. encode the data path into the binary?) #57
Comments
Hi @akien-mageia :) Well, I'll need to have a more careful look at how it is done, but there is something surprising me. Maybe you can tell:
What I saw elsewhere is that usually, such a variable is hard-coded by cmake at compilation time depending on the platform, making the launch script useless. Example: ... What do you think? |
I think the only reason is that the initial design of this system would be to put both the "OpenDungeons" script and the "OpenDungeons.bin" binary in the /usr/games (or /usr/bin) folder. That's somewhat messy because the OpenDungeons.bin binary can't be run as is, so it shouldn't be in the $PATH; but likewise it's bad practice (or so I've gathered from my packaging experience) to include binaries in data dirs such /usr/share/games/opendungeons. I have seldom has to use such a trick, since as you said, most project retrieve the data path from the cmake call. So yes ideally, we want a cmake variable that can be set by the user and that determines the location of the game data. Same things for the binary btw, and potentially for additional stuff on Linux (desktop file, icons, man page, etc.). We'll probably need something along those lines:
Being declined for all platform in a big old IF(...). I could take care of the cmake part (I've already started it btw in issue #58), but this needs some tweaking in the code too to hardcode the cmake variable into the code. And maybe add the possibility to use additional data paths for user-made content, such as ~/.local/share/opendungeons? |
I guess this would mean changing the getenv() calls in the resource manager to a plain old define, and make the binary do a cd there when run.
Why not in a second step. But IMHO, this is out of scope for 0.4.9 and this issue. Let's first make a standard & working binary. |
Agreed :-) |
PR #184 made this issue really easy to solve, I'm on it. |
Drop bin suffix on Linux and the launch script (fixes #57)
I've started some work on the CMakeLists.txt (I'll push it to my fork soon so that it can be reviewed), and dropping the ".bin" binary suffix is not as straight-forward as it looks like.
Currently the file cmake/config/OpenDungeons.in is used to generate a bash script that runs OpenDungeons.bin with the needed environment variable to let OD find its data:
If we want to drop the ".bin" suffix (and set the binary name in lower case on Linux if possible), we need to find another way to let OpenDungeons know the location of the data directory (currently defined as OPENDUNGEONS_DATA_PATH here: https://github.com/OpenDungeons/OpenDungeons/blob/development/CMakeLists.txt#L507 ).
Any idea about how this could be done (i.e. how most games do it)? It looks somewhat messy to have a broken (as in, you can't execute it properly) OpenDungeons.bin binary in /usr/games and a script to make it work.
The text was updated successfully, but these errors were encountered: