nbtscanner: add versionCheckHook

This commit is contained in:
Fabian Affolter
2024-12-03 21:49:55 +01:00
parent efa0a14b3b
commit 2187a09269
@@ -4,6 +4,7 @@
rustPlatform,
fetchFromGitHub,
Security,
versionCheckHook,
}:
rustPlatform.buildRustPackage rec {
@@ -23,8 +24,20 @@ rustPlatform.buildRustPackage rec {
./Cargo.lock.patch
];
postPatch = ''
# https://github.com/jonkgrimes/nbtscanner/issues/4
substituteInPlace src/main.rs \
--replace-fail '.version("0.1")' '.version("${version}")'
'';
buildInputs = lib.optional stdenv.hostPlatform.isDarwin Security;
nativeInstallCheckInputs = [ versionCheckHook ];
doInstallCheck = true;
versionCheckProgramArg = [ "--version" ];
meta = with lib; {
description = "NetBIOS scanner written in Rust";
homepage = "https://github.com/jonkgrimes/nbtscanner";