nixpkgs/pkgs/by-name/fl/flare-floss/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

73 lines
1.5 KiB
Nix

{
lib,
python3,
fetchFromGitHub,
}:
python3.pkgs.buildPythonPackage rec {
pname = "flare-floss";
version = "3.1.1";
pyproject = true;
src = fetchFromGitHub {
owner = "mandiant";
repo = "flare-floss";
rev = "refs/tags/v${version}";
fetchSubmodules = true; # for tests
hash = "sha256-ciyF1Pt5KdUsmpTgvfgE81hhTHBM5zMBcZpom99R5GY=";
};
postPatch = ''
substituteInPlace floss/main.py \
--replace 'sigs_path = os.path.join(get_default_root(), "sigs")' 'sigs_path = "'"$out"'/share/flare-floss/sigs"'
'';
pythonRelaxDeps = [ "networkx" ];
build-system = with python3.pkgs; [
setuptools
setuptools-scm
];
dependencies =
with python3.pkgs;
[
binary2strings
dncil
halo
networkx
pefile
pydantic
rich
tabulate
tqdm
viv-utils
vivisect
]
++ viv-utils.optional-dependencies.flirt;
nativeCheckInputs = with python3.pkgs; [
pytest-sugar
pytestCheckHook
pyyaml
];
postInstall = ''
mkdir -p $out/share/flare-floss/
cp -r floss/sigs $out/share/flare-floss/
'';
preCheck = ''
export HOME=$(mktemp -d)
'';
meta = with lib; {
description = "Automatically extract obfuscated strings from malware";
homepage = "https://github.com/mandiant/flare-floss";
changelog = "https://github.com/mandiant/flare-floss/releases/tag/v${version}";
license = licenses.asl20;
mainProgram = "floss";
maintainers = with maintainers; [ fab ];
};
}