2021-04-17 19:00:17 +02:00
|
|
|
{ lib
|
|
|
|
, python3
|
|
|
|
, fetchFromGitHub
|
2021-04-23 08:05:16 +02:00
|
|
|
, fetchpatch
|
2021-04-17 19:00:17 +02:00
|
|
|
}:
|
|
|
|
python3.pkgs.buildPythonApplication rec {
|
|
|
|
pname = "yarGen";
|
|
|
|
version = "0.23.4";
|
|
|
|
format = "other";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "Neo23x0";
|
|
|
|
repo = "yarGen";
|
|
|
|
rev = version;
|
|
|
|
sha256 = "6PJNAeeLAyUlZcIi0g57sO1Ex6atn7JhbK9kDbNrZ6A=";
|
|
|
|
};
|
|
|
|
|
2021-04-23 08:05:16 +02:00
|
|
|
patches = [
|
|
|
|
# https://github.com/Neo23x0/yarGen/pull/33
|
|
|
|
(fetchpatch {
|
|
|
|
name = "use-built-in-scandir.patch";
|
|
|
|
url = "https://github.com/Neo23x0/yarGen/commit/cae14ac8efeb5536885792cae99d1d0f7fb6fde3.patch";
|
|
|
|
sha256 = "0z6925r7n1iysld5c8li5nkm1dbxg8j7pn0626a4vic525vf8ndl";
|
|
|
|
})
|
2021-04-23 08:37:22 +02:00
|
|
|
# https://github.com/Neo23x0/yarGen/pull/34
|
|
|
|
(fetchpatch {
|
|
|
|
name = "use-cwd-for-abspath.patch";
|
|
|
|
url = "https://github.com/Neo23x0/yarGen/commit/441dafb702149f5728c2c6736fc08741a46deb26.patch";
|
|
|
|
sha256 = "lNp3oC2BM7tBzN4AetvPr+xJLz6KkZxQmsldeZaxJQU=";
|
|
|
|
})
|
2021-04-23 08:05:16 +02:00
|
|
|
];
|
|
|
|
|
2021-04-23 08:38:28 +02:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace yarGen.py \
|
|
|
|
--replace "./3rdparty/strings.xml" "$out/share/yarGen/3rdparty/strings.xml"
|
|
|
|
'';
|
|
|
|
|
2021-04-17 19:00:17 +02:00
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
|
2021-04-23 08:02:53 +02:00
|
|
|
install -Dt "$out/bin" yarGen.py
|
2021-04-23 08:38:28 +02:00
|
|
|
install -Dt "$out/share/yarGen/3rdparty" 3rdparty/strings.xml
|
2021-04-17 19:00:17 +02:00
|
|
|
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
|
|
|
propagatedBuildInputs = with python3.pkgs; [
|
|
|
|
pefile
|
|
|
|
lxml
|
|
|
|
];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "A generator for YARA rules";
|
|
|
|
homepage = "https://github.com/Neo23x0/yarGen";
|
|
|
|
license = licenses.bsd3;
|
|
|
|
maintainers = teams.determinatesystems.members;
|
|
|
|
};
|
|
|
|
}
|