From 68ee9b1a650ee13448b101dba8d3e8527662ab8f Mon Sep 17 00:00:00 2001 From: antipatico Date: Sat, 15 Mar 2025 20:27:30 +0100 Subject: [PATCH] lovely-injector: fix build Fixed hashes to build version 0.7.1 instead of 0.6.0 Added versionCheckHook to verify that the correct version is being built --- pkgs/by-name/lo/lovely-injector/package.nix | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/pkgs/by-name/lo/lovely-injector/package.nix b/pkgs/by-name/lo/lovely-injector/package.nix index 58eb5be8cd07..ef370f100781 100644 --- a/pkgs/by-name/lo/lovely-injector/package.nix +++ b/pkgs/by-name/lo/lovely-injector/package.nix @@ -2,6 +2,9 @@ fetchFromGitHub, rustPlatform, lib, + versionCheckHook, + writeShellScript, + lua, }: let version = "0.7.1"; @@ -13,14 +16,26 @@ rustPlatform.buildRustPackage { owner = "ethangreen-dev"; repo = "lovely-injector"; tag = "v${version}"; - hash = "sha256-fzkuuu6pmvqeJa7qlX8jhtCLC4oYRLUm1hqHTRiYEX8="; + hash = "sha256-j03/DOnLFfFYTwGGh+7BalS779jyg+p0UqtcTTyHgv4="; }; useFetchCargoVendor = true; - cargoHash = "sha256-Mkmj+ENdUge1V1cVAQOV2K01sYKEyhxTse0f5o6H6Xc="; + cargoHash = "sha256-hHq26kSKcqEldxUb6bn1laTpKGFplP9/2uogsal8T5A="; # no tests doCheck = false; # lovely-injector depends on nightly rust features env.RUSTC_BOOTSTRAP = 1; + nativeBuildInputs = [ + lua + ]; + nativeInstallCheckInputs = [ + versionCheckHook + ]; + doInstallCheck = true; + versionCheckProgramArg = [ "${placeholder "out"}" ]; + versionCheckProgram = writeShellScript "lovely-version-check" '' + export LD_PRELOAD="$1/lib/liblovely.so" + exec ${lua}/bin/lua < /dev/null + ''; meta = { description = "Runtime lua injector for games built with LÖVE";