Unverified Commit 3c43b1ac authored by tomberek's avatar tomberek Committed by GitHub
Browse files

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

parents e568c4e9 b290ef5c
Loading
Loading
Loading
Loading
+33 −13
Original line number Diff line number Diff line
{
  "game": {
    "latest": {
      "linux": "51.11",
      "linux": "52.04",
      "darwin": "0.47.05"
    },
    "versions": {
      "51.11": {
      "52.04": {
        "df": {
          "version": "51.11",
          "version": "52.04",
          "urls": {
            "linux": {
              "url": "https://www.bay12games.com/dwarves/df_51_11_linux.tar.bz2",
              "outputHash": "sha256-51cwIFMm5cwSaXjjhpz4pS3D8B5/Mt5+k1ALu1F+JWc="
              "url": "https://www.bay12games.com/dwarves/df_52_04_linux.tar.bz2",
              "outputHash": "sha256-x/v4yWuojnbea0N7KUAINBdhPBjl0DoWy8Pi/eDCpec="
            }
          }
        },
        "hack": {
          "version": "51.11-r1.2",
          "version": "52.04-r1",
          "git": {
            "url": "https://github.com/DFHack/dfhack.git",
            "revision": "51.11-r1.2",
            "outputHash": "sha256-x8zY8IGDhnyoeNz24Mt00o+2XLzSHZG165MXQHXW+YA="
            "revision": "52.04-r1",
            "outputHash": "sha256-DPW+fvurUYnwfGrEqV3JEN1TfllOJPHqGIlNJ3Wha90="
          },
          "xmlRev": "6502bdefd1796315365a7bb58e30e0ce34359bea"
          "xmlRev": "7b691d256f9427036e7ff24fa795a0f9334739e7"
        }
      },
      "51.13": {
        "df": {
          "version": "51.13",
          "urls": {
            "linux": {
              "url": "https://www.bay12games.com/dwarves/df_51_13_linux.tar.bz2",
              "outputHash": "sha256-Fdb3QS+P0xL4/U0z6nZyMh78KVHDiu9TI3fF6saAw3I="
            }
          }
        },
        "hack": {
          "version": "51.13-r1",
          "git": {
            "url": "https://github.com/DFHack/dfhack.git",
            "revision": "51.13-r1",
            "outputHash": "sha256-Z6ZmXl4BmSg9jRwPpYKMIw3fW6DYxBJEv8oboh+PbZQ="
          },
          "xmlRev": "ae7424d3f40bf60b3906b5b9b472cb9a7209a3a8"
        }
      },
      "50.15": {
@@ -96,12 +116,12 @@
    }
  },
  "therapist": {
    "version": "42.1.13",
    "maxDfVersion": "51.11",
    "version": "42.1.18",
    "maxDfVersion": "52.03",
    "git": {
      "url": "https://github.com/Dwarf-Therapist/Dwarf-Therapist.git",
      "revision": "v42.1.13",
      "outputHash": "sha256-y/kUur/BTArznrEzw54FZBrxnD2KXHcwfrHE4WvoemA="
      "revision": "v42.1.18",
      "outputHash": "sha256-RdBUpVkjvsNjTowHpQ2FQUCtJiwfqls4dnoUIwKoXGg="
    }
  }
}
+6 −13
Original line number Diff line number Diff line
@@ -120,23 +120,16 @@ stdenv.mkDerivation {
      name = "rename-lerp.patch";
      url = "https://github.com/DFHack/dfhack/commit/389dcf5cfcdb8bfb8deeb05fa5756c9f4f5709d1.patch";
      hash = "sha256-QuDtGURhP+nM+x+8GIKO5LrMcmBkl9JSHHIeqzqGIPQ=";
    });
    })
    # Newer versions use SDL_GetBasePath and SDL_GetPrefPath with a Windows-esque directory
    # that mismatches where we have historically stored data in nixpkgs:
    # https://github.com/libsdl-org/SDL/blob/release-2.24.x/src/filesystem/unix/SDL_sysfilesystem.c#L136
    # Use SDL_GetPrefPath since this takes XDG_DATA_HOME into account (which is correct).
    ++ optional (versionAtLeast version "52.02-r2") ./use-df-linux-dir.patch;

  # gcc 11 fix
  CXXFLAGS = optionalString (versionOlder version "0.47.05-r3") "-fpermissive";

  # As of
  # https://github.com/DFHack/dfhack/commit/56e43a0dde023c5a4595a22b29d800153b31e3c4,
  # dfhack gets its goodies from the directory above the Dwarf_Fortress
  # executable, which leads to stock Dwarf Fortress and not the built
  # environment where all the dfhack resources are symlinked to (typically
  # ~/.local/share/df_linux). This causes errors like `tweak is not a
  # recognized command` to be reported and dfhack to lose some of its
  # functionality.
  postPatch = ''
    sed -i 's@cached_path = path_string.*@cached_path = getenv("DF_DIR");@' library/Process-linux.cpp
  '';

  nativeBuildInputs = [
    cmake
    ninja
+25 −0
Original line number Diff line number Diff line
diff --git a/library/modules/Filesystem.cpp b/library/modules/Filesystem.cpp
index 7a6b09a50..d5827f016 100644
--- a/library/modules/Filesystem.cpp
+++ b/library/modules/Filesystem.cpp
@@ -232,17 +232,10 @@ std::filesystem::path Filesystem::canonicalize(std::filesystem::path p) noexcept
 
 std::filesystem::path Filesystem::getInstallDir() noexcept
 {
-    return std::filesystem::path{ DFSDL::DFSDL_GetBasePath() };
+    return std::filesystem::path{ DFSDL::DFSDL_GetPrefPath("", "df_linux") };
 }
 
 std::filesystem::path Filesystem::getBaseDir() noexcept
 {
-    auto getsavebase = []() {
-        // assume portable mode is _on_ if init is missing
-        if (!df::global::init || df::global::init->media.flag.is_set(df::enums::init_media_flags::PORTABLE_MODE))
-            return DFSDL::DFSDL_GetBasePath();
-        else
-            return DFSDL::DFSDL_GetPrefPath("Bay 12 Games", "Dwarf Fortress");
-        };
-    return std::filesystem::path{ getsavebase() };
+    return std::filesystem::path{ DFSDL::DFSDL_GetPrefPath("", "df_linux") };
 }
+3 −2
Original line number Diff line number Diff line
@@ -74,9 +74,10 @@ stdenv.mkDerivation {
        local orig_md5="$2"
        local patched_md5="$3"
        echo "It doesn't support DF $dfVersion out of the box, so we're doing it the hard way."
        export NIXPKGS_DF_HOME="$(mktemp -dt dfhack.XXXXXX)"
        export HOME="$(mktemp -dt dfhack.XXXXXX)"
        export XDG_DATA_HOME="$HOME/.local/share"
        expect ${dfHackExpectScript}
        local ini="$NIXPKGS_DF_HOME/therapist.ini"
        local ini="$XDG_DATA_HOME/df_linux/therapist.ini"
        if [ -f "$ini" ]; then
          if grep -q "$patched_md5" "$ini"; then
            cp -v "$ini" "$output"
+1 −1
Original line number Diff line number Diff line
@@ -571,7 +571,7 @@ class DFLock < Struct.new(:game, :therapist, keyword_init: true)

  # Returns an array containing all versions.
  def all_versions
    self.game.versions.keys.map {"DF #{_1}"}.to_a + ["DT #{self.therapist.version}"]
    [self.game.versions.keys.lazy.map {"DF #{_1}"}.first] + ["DT #{self.therapist.version}"]
  end

  # Loads this DFLock.