dwarf-fortress: fix eval on darwin
This commit is contained in:
parent
d2111b0cbb
commit
880bea37bd
@ -49,7 +49,9 @@ let
|
||||
# The latest Dwarf Fortress version. Maintainers: when a new version comes
|
||||
# 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 = "50.13";
|
||||
latestVersion = if stdenv.isLinux then "50.13"
|
||||
else if stdenv.isDarwin then "0.47.05"
|
||||
else throw "Unsupported system";
|
||||
|
||||
# Converts a version to a package name.
|
||||
versionToName = version: "dwarf-fortress_${replaceStrings ["."] ["_"] version}";
|
||||
@ -62,7 +64,7 @@ let
|
||||
let
|
||||
isAtLeast50 = versionAtLeast dfVersion "50.0";
|
||||
|
||||
dwarf-fortress-unfuck = optionalAttrs (!isAtLeast50) (callPackage ./unfuck.nix { inherit dfVersion; });
|
||||
dwarf-fortress-unfuck = optionalAttrs (!isAtLeast50 && stdenv.isLinux) (callPackage ./unfuck.nix { inherit dfVersion; });
|
||||
|
||||
dwarf-fortress = callPackage ./game.nix {
|
||||
inherit dfVersion;
|
||||
|
@ -53,7 +53,7 @@ let
|
||||
patchVersion = elemAt dfVersionTuple (dfVersionBaseIndex + 1);
|
||||
|
||||
isAtLeast50 = baseVersion >= 50;
|
||||
enableUnfuck = !isAtLeast50 && dwarf-fortress-unfuck != null;
|
||||
enableUnfuck = !isAtLeast50 && dwarf-fortress-unfuck != null && (dwarf-fortress-unfuck.dfVersion or null) == dfVersion;
|
||||
|
||||
game =
|
||||
if hasAttr dfVersion df-hashes
|
||||
@ -95,7 +95,7 @@ stdenv.mkDerivation {
|
||||
fi
|
||||
'';
|
||||
|
||||
nativeBuildInputs = [ autoPatchelfHook ];
|
||||
nativeBuildInputs = optional stdenv.isLinux autoPatchelfHook;
|
||||
buildInputs = optionals isAtLeast50 [ SDL2 SDL2_image SDL2_mixer ]
|
||||
++ optional (!isAtLeast50) SDL
|
||||
++ optional enableUnfuck dwarf-fortress-unfuck
|
||||
|
@ -197,8 +197,8 @@ stdenv.mkDerivation rec {
|
||||
chmod 755 $out/bin/soundsense
|
||||
'';
|
||||
|
||||
doInstallCheck = true;
|
||||
nativeInstallCheckInputs = [ expect xvfb-run ];
|
||||
doInstallCheck = stdenv.isLinux;
|
||||
nativeInstallCheckInputs = lib.optionals stdenv.isLinux [ expect xvfb-run ];
|
||||
|
||||
installCheckPhase = let
|
||||
commonExpectStatements = fmod: lib.optionalString isAtLeast50 ''
|
||||
|
Loading…
Reference in New Issue
Block a user