depot/third_party/nixpkgs/pkgs/by-name/ya/yara-x/package.nix
Default email f34ce41345 Project import generated by Copybara.
GitOrigin-RevId: b73c2221a46c13557b1b3be9c2070cc42cf01eb3
2024-07-27 08:49:29 +02:00

45 lines
1.1 KiB
Nix

{ lib
, stdenv
, fetchFromGitHub
, rustPlatform
, cmake
, installShellFiles
, testers
, yara-x
}:
rustPlatform.buildRustPackage rec {
pname = "yara-x";
version = "0.5.0";
src = fetchFromGitHub {
owner = "VirusTotal";
repo = "yara-x";
rev = "refs/tags/v${version}";
hash = "sha256-/5UYweF/+oshJlZaTnbr1TJMYgenRZmb8EZudyxcTU0=";
};
cargoHash = "sha256-BXYegw1Rl8HvUxlBg3xwF3ZJemzJnJZPoPNMXYBgoF0=";
nativeBuildInputs = [ cmake installShellFiles ];
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
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;
maintainers = with lib.maintainers; [ fab lesuisse ];
mainProgram = "yr";
};
}