Unverified Commit 9f4d81ef authored by Felix Schröter's avatar Felix Schröter Committed by GitHub
Browse files

pixelorama: Pin Godot version (#410887)

parents 8c00e8f7 055f524a
Loading
Loading
Loading
Loading
+13 −2
Original line number Diff line number Diff line
@@ -2,7 +2,7 @@
  lib,
  stdenv,
  fetchFromGitHub,
  godot_4,
  godot_4_4,
  nix-update-script,
}:

@@ -16,7 +16,7 @@ let
    presets.${stdenv.hostPlatform.system}
      or (throw "Unsupported system: ${stdenv.hostPlatform.system}");

  godot = godot_4;
  godot = godot_4_4;
in
stdenv.mkDerivation (finalAttrs: {
  pname = "pixelorama";
@@ -35,6 +35,17 @@ stdenv.mkDerivation (finalAttrs: {
    godot
  ];

  # Pixelorama is tightly coupled to the version of Godot that it is meant to be built with,
  # and Godot does not follow semver, they break things in minor releases.
  preConfigure = ''
    godot_ver="${lib.versions.majorMinor godot.version}"
    godot_expected=$(sed -n -E 's@config/features=PackedStringArray\("([0-9]+\.[0-9]+)"\)@\1@p' project.godot)
    [ "$godot_ver" == "$godot_expected" ] || {
      echo "Expected Godot version: $godot_expected; found: $godot_ver" >&2
      exit 1
    }
  '';

  buildPhase = ''
    runHook preBuild