Unverified Commit 4734e563 authored by tomberek's avatar tomberek Committed by GitHub
Browse files

dwarf-fortress: purge minor versions, add autoupdate, and fix audio (#356659)

parents 178623cb ab31da02
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -207,6 +207,8 @@

- `pnpm` was updated to version 10. If your project is incompatible, you can install the previous version from the package attribute `pnpm_9`.

- `dwarf-fortress-packages` now only contains one minor version for each major version since version 0.44. Saves should still be compatible, but you may have to change which minor version you were using if it was one other than the newest.

- `zig_0_9` and `zig_0_10` have been removed, you should upgrade to `zig_0_13` (also available as just `zig`), `zig_0_12` or `zig_0_11` instead.

- `webpack-cli` was updated to major version 6, which has breaking changes from the previous version 5.1.4. See the [upstream release notes](https://github.com/webpack/webpack-cli/releases/tag/webpack-cli%406.0.0) for details on these changes.
@@ -347,6 +349,8 @@
  - Many androidenv packages are now searchable on [search.nixos.org](https://search.nixos.org).
  - We now use the latest Google repositories, which should improve aarch64-darwin compatibility. The SDK now additionally evaluates on aarch64-linux, though not all packages are functional.

- `dwarf-fortress` audio now works again. Additionally, the `dfhack` and `dwarf-fortress-full` packages are now exposed at toplevel, making it easier to install and play Dwarf Fortress. Note that `dwarf-fortress-full` is the Nixpkgs equivalent of the Dwarf Fortress Lazy Pack.

- `gerbera` now has wavpack support.

- GOverlay has been updated to 1.2, please check the [upstream changelog](https://github.com/benjamimgois/goverlay/releases) for more details.
+9 −0
Original line number Diff line number Diff line
# dwarf-fortress

Maintainers, please read me!

The policy for updates is currently keeping one major version of DF around since 0.44.
See [Save Compatibility](https://dwarffortresswiki.org/index.php/Save_compatibility)
on the DF wiki. Note that saves are backwards compatible, but not forwards-compatible.

This policy has been in effect since Nixpkgs 25.05.
+44 −31
Original line number Diff line number Diff line
@@ -7,8 +7,6 @@
  libsForQt5,
  newScope,
  perlPackages,
  jdk8,
  jre8,
}:

# To whomever it may concern:
@@ -61,12 +59,14 @@ let
  # out, ensure that (unfuck|dfhack|twbt) are all up to date before changing
  # this. Note that unfuck and twbt are not required for 50.
  latestVersion =
    self.dfVersions.game.latest.${
      if stdenv.hostPlatform.isLinux then
      "50.13"
        "linux"
      else if stdenv.hostPlatform.isDarwin then
      "0.47.05"
        "darwin"
      else
      throw "Unsupported system";
        throw "Unsupported system"
    };

  # Converts a version to a package name.
  versionToName = version: "dwarf-fortress_${replaceStrings [ "." ] [ "_" ] version}";
@@ -96,18 +96,15 @@ let
            stdenv = gccStdenv;
          };

          dwarf-therapist = libsForQt5.callPackage ./dwarf-therapist/wrapper.nix {
            inherit dwarf-fortress;
            dwarf-therapist = (libsForQt5.callPackage ./dwarf-therapist { }).override (
              optionalAttrs (!isAtLeast50) {
                # 41.2.5 is the last version to support Dwarf Fortress 0.47.
                version = "41.2.5";
                hash = "sha256-xfYBtnO1n6OcliVt07GsQ9alDJIfWdVhtuyWwuvXSZs=";
              }
            );
          };
        in
        callPackage ./wrapper {
          mkDfWrapper =
            {
              dwarf-fortress,
              dfhack,
              dwarf-therapist ? null,
              ...
            }@args:
            callPackage ./wrapper (
              {
                inherit (self) themes;
                inherit
                  dwarf-fortress
@@ -115,14 +112,32 @@ let
                  dfhack
                  dwarf-therapist
                  ;
              }
              // args
            );

          jdk = jdk8; # TODO: remove override https://github.com/NixOS/nixpkgs/pull/89731
          dwarf-therapist = libsForQt5.callPackage ./dwarf-therapist/wrapper.nix {
            inherit dwarf-fortress dfhack mkDfWrapper;
            dwarf-therapist =
              (libsForQt5.callPackage ./dwarf-therapist {
                inherit (self) dfVersions;
              }).override
                (
                  optionalAttrs (!isAtLeast50) {
                    # 41.2.5 is the last version to support Dwarf Fortress 0.47.
                    version = "41.2.5";
                    maxDfVersion = "0.47.05";
                    hash = "sha256-xfYBtnO1n6OcliVt07GsQ9alDJIfWdVhtuyWwuvXSZs=";
                  }
                );
          };
    }) (attrNames self.df-hashes)
        in
        mkDfWrapper { inherit dwarf-fortress dfhack dwarf-therapist; };
    }) (attrNames self.dfVersions.game.versions)
  );

  self = rec {
    df-hashes = importJSON ./game.json;
    dfVersions = importJSON ./df.lock.json;

    # Aliases for the latest Dwarf Fortress and the selected Therapist install
    dwarf-fortress = getAttr (versionToName latestVersion) df-games;
@@ -135,9 +150,7 @@ let

    soundSense = callPackage ./soundsense.nix { };

    legends-browser = callPackage ./legends-browser {
      jre = jre8; # TODO: remove override https://github.com/NixOS/nixpkgs/pull/89731
    };
    legends-browser = callPackage ./legends-browser { };

    themes = recurseIntoAttrs (
      callPackage ./themes {
+107 −0
Original line number Diff line number Diff line
{
  "game": {
    "latest": {
      "linux": "51.10",
      "darwin": "0.47.05"
    },
    "versions": {
      "51.10": {
        "df": {
          "version": "51.10",
          "urls": {
            "linux": {
              "url": "https://www.bay12games.com/dwarves/df_51_10_linux.tar.bz2",
              "outputHash": "sha256-r4dadc/nch2smNHt4Ixa2FG2Sc1NFmY88iSnFFeMcz0="
            }
          }
        },
        "hack": {
          "version": "51.10-r1",
          "git": {
            "url": "https://github.com/DFHack/dfhack.git",
            "revision": "51.10-r1",
            "outputHash": "sha256-TsgafCiLX/IZXgBdqQaRt7hmATwKz80x2xclCwdE3fM="
          },
          "xmlRev": "ec3ab067aef716817d9c5b84a6fb85bc22516caa"
        }
      },
      "50.15": {
        "df": {
          "version": "50.15",
          "urls": {
            "linux": {
              "url": "https://www.bay12games.com/dwarves/df_50_15_linux.tar.bz2",
              "outputHash": "sha256-KkKcXfXjD7dUjQDfKtXiaKfoieRN8wJSYxyN6liBwU4="
            }
          }
        },
        "hack": {
          "version": "50.15-r2",
          "git": {
            "url": "https://github.com/DFHack/dfhack.git",
            "revision": "50.15-r2",
            "outputHash": "sha256-6T1RXdBJdo/tvHXwYATS8emLIfDg7/0cGL4i982iHdY="
          },
          "xmlRev": "c6c8f15afec05d457813c003a869509901993af4"
        }
      },
      "0.47.05": {
        "df": {
          "version": "0.47.05",
          "urls": {
            "linux": {
              "url": "https://www.bay12games.com/dwarves/df_47_05_linux.tar.bz2",
              "outputHash": "sha256-rHSm27fX2WIfQwQFCAMiq1DDX2YyNS/y6pI/bcWv/KM="
            },
            "darwin": {
              "url": "https://www.bay12games.com/dwarves/df_47_05_osx.tar.bz2",
              "outputHash": "sha256-vHmpKtuWSX1ZVGN46MmrLvZ8oiq/vZdjYW3pwuAOXyQ="
            }
          }
        },
        "hack": {
          "version": "0.47.05-r8",
          "git": {
            "url": "https://github.com/DFHack/dfhack.git",
            "revision": "0.47.05-r8",
            "outputHash": "sha256-y5XluaNU0ewUg2uAd77+h80CYDwNr1rsxB8IslZWip8="
          },
          "xmlRev": "afe7e908e9e7e863412e8983f9feb2b999fae498"
        }
      },
      "0.44.12": {
        "df": {
          "version": "0.44.12",
          "urls": {
            "linux": {
              "url": "https://www.bay12games.com/dwarves/df_44_12_linux.tar.bz2",
              "outputHash": "sha256-Wi0Vcw0htBpo2gnOPDtww+Km/RW5XGy/toV47S0tuXk="
            },
            "darwin": {
              "url": "https://www.bay12games.com/dwarves/df_44_12_osx.tar.bz2",
              "outputHash": "sha256-IY1TGZ9+ufWMA146XUTYgvG2ngfvY/mKZZDWGm/IptU="
            }
          }
        },
        "hack": {
          "version": "0.44.12-r3",
          "git": {
            "url": "https://github.com/DFHack/dfhack.git",
            "revision": "0.44.12-r3",
            "outputHash": "sha256-8ChD4P7SpSNlhhOsrbIxoJ/T/CWobwvOY7QswxP0KK0="
          },
          "xmlRev": "4053321b202a29f667d64d824ba8339ec1b1df4f"
        }
      }
    }
  },
  "therapist": {
    "version": "42.1.12",
    "maxDfVersion": "51.10",
    "git": {
      "url": "https://github.com/Dwarf-Therapist/Dwarf-Therapist.git",
      "revision": "v42.1.12",
      "outputHash": "sha256-/6tiFjfrAziw7XeEzPoNFgrsXk8Z7ea2PGjCvJlRt+A="
    }
  }
}
+7 −63
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@
  binutils,
  gnused,
  dfVersion,
  dfVersions,
}:

let
@@ -40,77 +41,20 @@ let
    versionAtLeast
    ;

  dfhack-releases = {
    "0.44.10" = {
      dfHackRelease = "0.44.10-r2";
      hash = "sha256-0RikMwFv/eJk26Hptnam6J97flekapQhjWvw3+HTfaU=";
      xmlRev = "321bd48b10c4c3f694cc801a7dee6be392c09b7b";
    };
    "0.44.11" = {
      dfHackRelease = "0.44.11-beta2.1";
      hash = "sha256-Yi/8BdoluickbcQQRbmuhcfrvrl02vf12MuHmh5m/Mk=";
      xmlRev = "f27ebae6aa8fb12c46217adec5a812cd49a905c8";
      prerelease = true;
    };
    "0.44.12" = {
      dfHackRelease = "0.44.12-r1";
      hash = "sha256-3j83wgRXbfcrwPRrJVHFGcLD+tXy1M3MR2dwIw2mA0g=";
      xmlRev = "23500e4e9bd1885365d0a2ef1746c321c1dd5094";
    };
    "0.47.02" = {
      dfHackRelease = "0.47.02-alpha0";
      hash = "sha256-ScrFcfyiimuLgEaFjN5DKKRaFuKfdJjaTlGDit/0j6Y=";
      xmlRev = "23500e4e9bd1885365d0a2ef1746c321c1dd509a";
      prerelease = true;
    };
    "0.47.04" = {
      dfHackRelease = "0.47.04-r5";
      hash = "sha256-0s+/LKbqsS/mrxKPDeniqykE5+Gy3ZzCa8yEDzMyssY=";
      xmlRev = "be0444cc165a1abff053d5893dc1f780f06526b7";
    };
    "0.47.05" = {
      dfHackRelease = "0.47.05-r7";
      hash = "sha256-vBKUTSjfCnalkBzfjaIKcxUuqsGGOTtoJC1RHJIDlNc=";
      xmlRev = "f5019a5c6f19ef05a28bd974c3e8668b78e6e2a4";
    };
    "50.10" = {
      dfHackRelease = "50.10-r1.1";
      hash = "sha256-k2j8G4kJ/RYE8W0YDOxcsRb5qjjn4El+rigf0v3AqZU=";
      xmlRev = "041493b221e0799c106abeac1f86df4535ab80d3";
      needsPatches = true;
    };
    "50.11" = {
      dfHackRelease = "50.11-r7";
      hash = "sha256-3KsFc0i4XkzoeRvcl5GUlx/fJB1HyqfZm+xL6T4oT/A=";
      xmlRev = "cca87907c1cbfcf4af957b0bea3a961a345b1581";
      needsPatches = true;
    };
    "50.12" = {
      dfHackRelease = "50.12-r3";
      hash = "sha256-2mO8DpNmZRCV7IRY0arf3SMvlO4Pxs61Kxfh3q3k3HU=";
      xmlRev = "980b1af13acc31660dce632f913c968f52e2b275";
    };
    "50.13" = {
      dfHackRelease = "50.13-r3";
      hash = "sha256-WbkJ8HmLT5GdZgDmcuFh+1uzhloKM9um0b9YO//uR7Y=";
      xmlRev = "f0530a22149606596e97e3e17d941df3aafe29b9";
    };
  };

  release =
    if isAttrs dfVersion then
      dfVersion
    else if hasAttr dfVersion dfhack-releases then
      getAttr dfVersion dfhack-releases
    else if hasAttr dfVersion dfVersions.game.versions then
      (getAttr dfVersion dfVersions.game.versions).hack
    else
      throw "[DFHack] Unsupported Dwarf Fortress version: ${dfVersion}";

  version = release.dfHackRelease;
  inherit (release) version;
  isAtLeast50 = versionAtLeast version "50.0";
  needs50Patches = isAtLeast50 && (release.needsPatches or false);

  # revision of library/xml submodule
  xmlRev = release.xmlRev;
  inherit (release) xmlRev;

  arch =
    if stdenv.hostPlatform.system == "x86_64-linux" then
@@ -149,8 +93,8 @@ stdenv.mkDerivation {
  src = fetchFromGitHub {
    owner = "DFHack";
    repo = "dfhack";
    rev = release.dfHackRelease;
    inherit (release) hash;
    tag = release.git.revision;
    hash = release.git.outputHash;
    fetchSubmodules = true;
  };

Loading