···120 name = "rename-lerp.patch";
121 url = "https://github.com/DFHack/dfhack/commit/389dcf5cfcdb8bfb8deeb05fa5756c9f4f5709d1.patch";
122 hash = "sha256-QuDtGURhP+nM+x+8GIKO5LrMcmBkl9JSHHIeqzqGIPQ=";
123- });
00000124125 # gcc 11 fix
126 CXXFLAGS = optionalString (versionOlder version "0.47.05-r3") "-fpermissive";
127-128- # As of
129- # https://github.com/DFHack/dfhack/commit/56e43a0dde023c5a4595a22b29d800153b31e3c4,
130- # dfhack gets its goodies from the directory above the Dwarf_Fortress
131- # executable, which leads to stock Dwarf Fortress and not the built
132- # environment where all the dfhack resources are symlinked to (typically
133- # ~/.local/share/df_linux). This causes errors like `tweak is not a
134- # recognized command` to be reported and dfhack to lose some of its
135- # functionality.
136- postPatch = ''
137- sed -i 's@cached_path = path_string.*@cached_path = getenv("DF_DIR");@' library/Process-linux.cpp
138- '';
139140 nativeBuildInputs = [
141 cmake
···120 name = "rename-lerp.patch";
121 url = "https://github.com/DFHack/dfhack/commit/389dcf5cfcdb8bfb8deeb05fa5756c9f4f5709d1.patch";
122 hash = "sha256-QuDtGURhP+nM+x+8GIKO5LrMcmBkl9JSHHIeqzqGIPQ=";
123+ })
124+ # Newer versions use SDL_GetBasePath and SDL_GetPrefPath with a Windows-esque directory
125+ # that mismatches where we have historically stored data in nixpkgs:
126+ # https://github.com/libsdl-org/SDL/blob/release-2.24.x/src/filesystem/unix/SDL_sysfilesystem.c#L136
127+ # Use SDL_GetPrefPath since this takes XDG_DATA_HOME into account (which is correct).
128+ ++ optional (versionAtLeast version "52.02-r2") ./use-df-linux-dir.patch;
129130 # gcc 11 fix
131 CXXFLAGS = optionalString (versionOlder version "0.47.05-r3") "-fpermissive";
000000000000132133 nativeBuildInputs = [
134 cmake
···74 local orig_md5="$2"
75 local patched_md5="$3"
76 echo "It doesn't support DF $dfVersion out of the box, so we're doing it the hard way."
77- export NIXPKGS_DF_HOME="$(mktemp -dt dfhack.XXXXXX)"
078 expect ${dfHackExpectScript}
79- local ini="$NIXPKGS_DF_HOME/therapist.ini"
80 if [ -f "$ini" ]; then
81 if grep -q "$patched_md5" "$ini"; then
82 cp -v "$ini" "$output"
···74 local orig_md5="$2"
75 local patched_md5="$3"
76 echo "It doesn't support DF $dfVersion out of the box, so we're doing it the hard way."
77+ export HOME="$(mktemp -dt dfhack.XXXXXX)"
78+ export XDG_DATA_HOME="$HOME/.local/share"
79 expect ${dfHackExpectScript}
80+ local ini="$XDG_DATA_HOME/df_linux/therapist.ini"
81 if [ -f "$ini" ]; then
82 if grep -q "$patched_md5" "$ini"; then
83 cp -v "$ini" "$output"
+1-1
pkgs/games/dwarf-fortress/update.rb
···571572 # Returns an array containing all versions.
573 def all_versions
574- self.game.versions.keys.map {"DF #{_1}"}.to_a + ["DT #{self.therapist.version}"]
575 end
576577 # Loads this DFLock.
···571572 # Returns an array containing all versions.
573 def all_versions
574+ [self.game.versions.keys.lazy.map {"DF #{_1}"}.first] + ["DT #{self.therapist.version}"]
575 end
576577 # Loads this DFLock.