2024-05-20 19:32:31 +00:00
|
|
|
{ lib
|
2024-07-08 09:33:40 +00:00
|
|
|
, stdenv
|
2024-05-20 19:32:31 +00:00
|
|
|
, fetchFromGitHub
|
|
|
|
, rustPlatform
|
|
|
|
, cmake
|
|
|
|
, installShellFiles
|
|
|
|
, testers
|
|
|
|
, yara-x
|
|
|
|
}:
|
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "yara-x";
|
2024-07-31 11:17:35 +00:00
|
|
|
version = "0.6.0";
|
2024-05-20 19:32:31 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "VirusTotal";
|
|
|
|
repo = "yara-x";
|
|
|
|
rev = "refs/tags/v${version}";
|
2024-07-31 11:17:35 +00:00
|
|
|
hash = "sha256-KcUBaEn28hNpy1d+uqGQZUlZKCnaLcrB8th9KXHXnuQ=";
|
2024-05-20 19:32:31 +00:00
|
|
|
};
|
|
|
|
|
2024-07-31 11:17:35 +00:00
|
|
|
cargoHash = "sha256-9W68Lm1Jc1GZ7wcS0FROZYGZkrzKn9wVBKdqlBjVOxk=";
|
2024-05-20 19:32:31 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [ cmake installShellFiles ];
|
|
|
|
|
2024-07-08 09:33:40 +00:00
|
|
|
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
|
2024-05-20 19:32:31 +00:00
|
|
|
installShellCompletion --cmd yr \
|
|
|
|
--bash <($out/bin/yr completion bash) \
|
|
|
|
--fish <($out/bin/yr completion fish) \
|
|
|
|
--zsh <($out/bin/yr completion zsh)
|
|
|
|
'';
|
|
|
|
|
|
|
|
passthru.tests.version = testers.testVersion {
|
|
|
|
package = yara-x;
|
|
|
|
};
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "Tool to do pattern matching for malware research";
|
|
|
|
homepage = "https://virustotal.github.io/yara-x/";
|
|
|
|
changelog = "https://github.com/VirusTotal/yara-x/releases/tag/v${version}";
|
|
|
|
license = lib.licenses.bsd3;
|
2024-05-21 21:17:02 +00:00
|
|
|
maintainers = with lib.maintainers; [ fab lesuisse ];
|
2024-05-20 19:32:31 +00:00
|
|
|
mainProgram = "yr";
|
|
|
|
};
|
|
|
|
}
|