Files
nixpkgs/pkgs/by-name/ya/yara-x/package.nix
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

61 lines
1.5 KiB
Nix

{
lib,
rust,
stdenv,
fetchFromGitHub,
rustPlatform,
installShellFiles,
cargo-c,
testers,
yara-x,
}:
rustPlatform.buildRustPackage (finalAttrs: {
pname = "yara-x";
version = "1.6.0";
src = fetchFromGitHub {
owner = "VirusTotal";
repo = "yara-x";
tag = "v${finalAttrs.version}";
hash = "sha256-LpdpdzUof+Buz5QQcWUr23AsSyfvUQYPp7RhHWXRb+I=";
};
cargoHash = "sha256-IO8ER92vWO3Q9MntaGwdhEFgy9G35Q3LOG5GU5rJpQY=";
nativeBuildInputs = [
installShellFiles
cargo-c
];
postBuild = ''
${rust.envVars.setEnv} cargo cbuild --release --frozen --prefix=${placeholder "out"} --target ${stdenv.hostPlatform.rust.rustcTarget}
'';
postInstall = ''
${rust.envVars.setEnv} cargo cinstall --release --frozen --prefix=${placeholder "out"} --target ${stdenv.hostPlatform.rust.rustcTarget}
''
+ 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${finalAttrs.version}";
license = lib.licenses.bsd3;
maintainers = with lib.maintainers; [
fab
lesuisse
];
mainProgram = "yr";
};
})