nbtscanner: add versionCheckHook
This commit is contained in:
@@ -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";
|
||||
|
||||
Reference in New Issue
Block a user