Unverified Commit 7f72350d authored by Leona Maroni's avatar Leona Maroni Committed by GitHub
Browse files

lovely-injector: fix build hash, add versionCheckHook (#389854)

parents 85d436e8 68ee9b1a
Loading
Loading
Loading
Loading
+17 −2
Original line number Diff line number Diff line
@@ -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";