pixelorama: Pin Godot version

This commit is contained in:
Kirill Elagin 2025-05-25 20:28:11 +02:00
parent 97ff9116a3
commit 055f524a04

View file

@ -2,7 +2,7 @@
lib, lib,
stdenv, stdenv,
fetchFromGitHub, fetchFromGitHub,
godot_4, godot_4_4,
nix-update-script, nix-update-script,
}: }:
@ -16,7 +16,7 @@ let
presets.${stdenv.hostPlatform.system} presets.${stdenv.hostPlatform.system}
or (throw "Unsupported system: ${stdenv.hostPlatform.system}"); or (throw "Unsupported system: ${stdenv.hostPlatform.system}");
godot = godot_4; godot = godot_4_4;
in in
stdenv.mkDerivation (finalAttrs: { stdenv.mkDerivation (finalAttrs: {
pname = "pixelorama"; pname = "pixelorama";
@ -35,6 +35,17 @@ stdenv.mkDerivation (finalAttrs: {
godot 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 = '' buildPhase = ''
runHook preBuild runHook preBuild