dwarf-fortress-packages: DF 51.11 -> DF 52.04; DT 42.1.13 -> DT 42.1.18 (#436336)

authored by tomberek and committed by GitHub 3c43b1ac e568c4e9

+68 -29
+33 -13
pkgs/games/dwarf-fortress/df.lock.json
··· 1 1 { 2 2 "game": { 3 3 "latest": { 4 - "linux": "51.11", 4 + "linux": "52.04", 5 5 "darwin": "0.47.05" 6 6 }, 7 7 "versions": { 8 - "51.11": { 8 + "52.04": { 9 9 "df": { 10 - "version": "51.11", 10 + "version": "52.04", 11 11 "urls": { 12 12 "linux": { 13 - "url": "https://www.bay12games.com/dwarves/df_51_11_linux.tar.bz2", 14 - "outputHash": "sha256-51cwIFMm5cwSaXjjhpz4pS3D8B5/Mt5+k1ALu1F+JWc=" 13 + "url": "https://www.bay12games.com/dwarves/df_52_04_linux.tar.bz2", 14 + "outputHash": "sha256-x/v4yWuojnbea0N7KUAINBdhPBjl0DoWy8Pi/eDCpec=" 15 15 } 16 16 } 17 17 }, 18 18 "hack": { 19 - "version": "51.11-r1.2", 19 + "version": "52.04-r1", 20 20 "git": { 21 21 "url": "https://github.com/DFHack/dfhack.git", 22 - "revision": "51.11-r1.2", 23 - "outputHash": "sha256-x8zY8IGDhnyoeNz24Mt00o+2XLzSHZG165MXQHXW+YA=" 22 + "revision": "52.04-r1", 23 + "outputHash": "sha256-DPW+fvurUYnwfGrEqV3JEN1TfllOJPHqGIlNJ3Wha90=" 24 24 }, 25 - "xmlRev": "6502bdefd1796315365a7bb58e30e0ce34359bea" 25 + "xmlRev": "7b691d256f9427036e7ff24fa795a0f9334739e7" 26 + } 27 + }, 28 + "51.13": { 29 + "df": { 30 + "version": "51.13", 31 + "urls": { 32 + "linux": { 33 + "url": "https://www.bay12games.com/dwarves/df_51_13_linux.tar.bz2", 34 + "outputHash": "sha256-Fdb3QS+P0xL4/U0z6nZyMh78KVHDiu9TI3fF6saAw3I=" 35 + } 36 + } 37 + }, 38 + "hack": { 39 + "version": "51.13-r1", 40 + "git": { 41 + "url": "https://github.com/DFHack/dfhack.git", 42 + "revision": "51.13-r1", 43 + "outputHash": "sha256-Z6ZmXl4BmSg9jRwPpYKMIw3fW6DYxBJEv8oboh+PbZQ=" 44 + }, 45 + "xmlRev": "ae7424d3f40bf60b3906b5b9b472cb9a7209a3a8" 26 46 } 27 47 }, 28 48 "50.15": { ··· 96 116 } 97 117 }, 98 118 "therapist": { 99 - "version": "42.1.13", 100 - "maxDfVersion": "51.11", 119 + "version": "42.1.18", 120 + "maxDfVersion": "52.03", 101 121 "git": { 102 122 "url": "https://github.com/Dwarf-Therapist/Dwarf-Therapist.git", 103 - "revision": "v42.1.13", 104 - "outputHash": "sha256-y/kUur/BTArznrEzw54FZBrxnD2KXHcwfrHE4WvoemA=" 123 + "revision": "v42.1.18", 124 + "outputHash": "sha256-RdBUpVkjvsNjTowHpQ2FQUCtJiwfqls4dnoUIwKoXGg=" 105 125 } 106 126 } 107 127 }
+6 -13
pkgs/games/dwarf-fortress/dfhack/default.nix
··· 120 120 name = "rename-lerp.patch"; 121 121 url = "https://github.com/DFHack/dfhack/commit/389dcf5cfcdb8bfb8deeb05fa5756c9f4f5709d1.patch"; 122 122 hash = "sha256-QuDtGURhP+nM+x+8GIKO5LrMcmBkl9JSHHIeqzqGIPQ="; 123 - }); 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; 124 129 125 130 # gcc 11 fix 126 131 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 - ''; 139 132 140 133 nativeBuildInputs = [ 141 134 cmake
+25
pkgs/games/dwarf-fortress/dfhack/use-df-linux-dir.patch
··· 1 + diff --git a/library/modules/Filesystem.cpp b/library/modules/Filesystem.cpp 2 + index 7a6b09a50..d5827f016 100644 3 + --- a/library/modules/Filesystem.cpp 4 + +++ b/library/modules/Filesystem.cpp 5 + @@ -232,17 +232,10 @@ std::filesystem::path Filesystem::canonicalize(std::filesystem::path p) noexcept 6 + 7 + std::filesystem::path Filesystem::getInstallDir() noexcept 8 + { 9 + - return std::filesystem::path{ DFSDL::DFSDL_GetBasePath() }; 10 + + return std::filesystem::path{ DFSDL::DFSDL_GetPrefPath("", "df_linux") }; 11 + } 12 + 13 + std::filesystem::path Filesystem::getBaseDir() noexcept 14 + { 15 + - auto getsavebase = []() { 16 + - // assume portable mode is _on_ if init is missing 17 + - if (!df::global::init || df::global::init->media.flag.is_set(df::enums::init_media_flags::PORTABLE_MODE)) 18 + - return DFSDL::DFSDL_GetBasePath(); 19 + - else 20 + - return DFSDL::DFSDL_GetPrefPath("Bay 12 Games", "Dwarf Fortress"); 21 + - }; 22 + - return std::filesystem::path{ getsavebase() }; 23 + + return std::filesystem::path{ DFSDL::DFSDL_GetPrefPath("", "df_linux") }; 24 + } 25 +
+3 -2
pkgs/games/dwarf-fortress/dwarf-therapist/wrapper.nix
··· 74 74 local orig_md5="$2" 75 75 local patched_md5="$3" 76 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)" 77 + export HOME="$(mktemp -dt dfhack.XXXXXX)" 78 + export XDG_DATA_HOME="$HOME/.local/share" 78 79 expect ${dfHackExpectScript} 79 - local ini="$NIXPKGS_DF_HOME/therapist.ini" 80 + local ini="$XDG_DATA_HOME/df_linux/therapist.ini" 80 81 if [ -f "$ini" ]; then 81 82 if grep -q "$patched_md5" "$ini"; then 82 83 cp -v "$ini" "$output"
+1 -1
pkgs/games/dwarf-fortress/update.rb
··· 571 571 572 572 # Returns an array containing all versions. 573 573 def all_versions 574 - self.game.versions.keys.map {"DF #{_1}"}.to_a + ["DT #{self.therapist.version}"] 574 + [self.game.versions.keys.lazy.map {"DF #{_1}"}.first] + ["DT #{self.therapist.version}"] 575 575 end 576 576 577 577 # Loads this DFLock.