|Anonymous | Login | Signup for a new account||2022-12-04 03:46 PST|
|Main | My View | View Issues | Change Log | Roadmap|
|View Issue Details|
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0011800||Dwarf Fortress||Technical -- General||public||2021-08-27 04:44||2021-08-27 04:44|
|Target Version||Fixed in Version|
|Summary||0011800: Supporting different installation directories for various kinds of files.|
|Description||Currently Dwarf Fortress is designed to be downloaded as a tarball, unpacked and the run directly from that unpacked directory. This is of course totally fine for people who download Dwarf Fortress directly from the website. However, it makes the creation of packages for Linux distributions such as Debian kinda tricky.|
First some background: For Linux systems there are various standards that mandate where certain files ought to be installed. On one hand there's the Filesystem Hierarchy Standard (https://www.debian.org/doc/packaging-manuals/fhs/fhs-3.0.html [^]) which is mandatory for all Debian packages and there is the XDG Base Directory Specification (https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html [^]) which isn't strictly mandatory, but would be appropriate for Dwarf Fortress to follow. Most notably this is different from the way Dwarf Fortress currently works (and installations usually work on Windows), because files are sorted into directories depending on what kind of file they are, not what software they belong to. This means that files belonging to the same software still end up in different directories across the system.
For the files of Dwarf Fortress this means that they would have to be installed somewhat like this:
If I simply were to install Dwarf Fortress this way, of course it wouldn't find any of its data files, so that's not an option.
Even if it's not something to be taken care of in the current development state of Dwarf Fortress, I would really like to see this as a feature, even if only in the far future.
|Additional Information||For the Debian package I Currently use a workaround, where I install the files roughly as listed above. But before Dwarf_Fortress is started, a wrapper script is called, that creates a temporary directory and creates symlinks to all the relevant files where they are actually installed.|
This has to take care of some problems with file permissions. Namely, the installation directories I listed above aren't writable for regular users who run Dwarf Fortress. Since Dwarf Fortress needs to write some data (such as saves and changed configuration), we need to trick around a bit, so Dwarf Fortress is actually able to change the configuration. To do this, data files aren't only looked up in one directory, but in a list of directories. Changes to those files are always returned in the first directory in the list, which points to a directory inside the user's home directory, where Dwarf Fortess actually has write permissions.
The search paths for the different kinds of files are as follows:
This is largely the way the XDG Base Directory Specification lays out for searching for data files and configuration. This even brings in a feature that Dwarf Fortress currently doesn't have on its own. Namely you can install data extensions (such as tilesets or mods) without modifying the original files of Dwarf Fortress, by placing the extension files at the front of the search path. Fro example if you place some extension files on /usr/local/share/dwarf-fortress/my-mod, the files from the mod take precedence over those from vanilla Dwarf Fortress. If you later remove the directory /usr/local/share/dwarf-fortress/my-mod, the mod is cleanly gone and the original files from vanilla take over again.
If Dwarf Fortress were to implement this feature itself, I think it would do good to also implement this XDG style searching of data files.
|Tags||No tags attached.|
|2021-08-27 04:44||kritzefitz||New Issue|
|Copyright © 2000 - 2010 MantisBT Group|