Closed akien-mga closed 7 years ago
I think you can set CDOGS_DATA_DIR
in cmake i.e. cmake -DCDOGS_DATA_DIR=/path/to/dir ...
, see https://github.com/cxong/cdogs-sdl/blob/master/CMakeLists.txt#L116-L123
I don't use this option myself though, haven't really tested it. Please try it out and let me know if it's broken.
Oh, thanks, somehow I missed it. I'll try and report back.
It seems not to work out of the box, the C code must be prefixing the pwd
somewhere:
internal error: cannot create temp file /home/akien/Mageia/Checkout/cdogs-sdl//usr/share/games/cdogs-sdl/data/gamecontrollerdb.txt
Internal error: cannot delete temp file /home/akien/Mageia/Checkout/cdogs-sdl//usr/share/games/cdogs-sdl/data/gamecontrollerdb.txt
Cannot resolve relative path /home/akien/Mageia/Checkout/cdogs-sdl//usr/share/games/cdogs-sdl/data/gamecontrollerdb.txt: No such file or directory
I defined -DCDOGS_DATA_DIR=/usr/share/games/cdogs-sdl/
Indeed, it's done here: https://github.com/cxong/cdogs-sdl/blob/master/src/cdogs/utils.c#L360
I hacked away the $cwd/
from the path and now the game starts up fine. I'm still getting many warnings which hint that the current C-Dogs might not be designed to work with a read-only data directory:
internal error: cannot create temp file missions/AntiHukkanen/trilogy/CORPS.CPN
Internal error: cannot delete temp file missions/AntiHukkanen/trilogy/CORPS.CPN
Cannot resolve relative path missions/AntiHukkanen/trilogy/CORPS.CPN: No such file or directory
internal error: cannot create temp file missions/AntiHukkanen/trilogy/GANGS.CPN
Internal error: cannot delete temp file missions/AntiHukkanen/trilogy/GANGS.CPN
Cannot resolve relative path missions/AntiHukkanen/trilogy/GANGS.CPN: No such file or directory
and so on for all missions and dogfights.
The fact that it tries to create temp file
is a bit surprising, but is it just a fallback of the way you're trying to open files (I'm not so familiar with C)? I can see that e.g. /usr/share/games/cdogs-sdl/missions/AntiHukkanen/trilogy/GANGS.CPN
is a file which is properly installed, so:
/usr
is read-only for non-root users. Typically the user-writable path available for cdogs would be ~/.local/share/cdogs-sdl/
(or ~/.config/cdogs-sdl/
that you're already using, most project that I know use either one or the other and rarely try to really separate config from data).Please try again with the latest master revision. The data files can be read-only.
Thanks, it's working great :) I've now updated my Mageia package to a current snapshot of the master branch: http://svnweb.mageia.org/packages/cauldron/cdogs-sdl/current/SPECS/cdogs-sdl.spec?view=markup&pathrev=1003133
I'm using a couple patches to have make install
behave as I wanted, as well as unbundle enet and yajl, but I need to find some time to make them less intrusive if I want to push them as a PR (especially for enet and yajl, I should ask CMake instructions to look for the system-wide package before decide to use the bundled version or not):
Thanks, this also allows me to update my Arch Linux package! :+1:
Hi there,
I package cdogs for Mageia but I'm having trouble packaging recent versions (currently Mageia still ships 0.5.7). I've managed to unbundle libenet and yajl relatively easily, but there does not seem to be support for loading data at the system-wide level, e.g. installed in
/usr/share/games/cdogs-sdl/
, it always looks for data in../data
.Two questions:
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.