From fea58500093cbbfd506505b3ad5e16cb630db2c8 Mon Sep 17 00:00:00 2001 From: Cole Helbling Date: Thu, 22 Apr 2021 23:37:22 -0700 Subject: [PATCH 1/2] yarGen: patch get_abs_path function Otherwise, it would return a path inside the Nix store, which needs to be writable for proper operation. --- pkgs/tools/security/yarGen/default.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkgs/tools/security/yarGen/default.nix b/pkgs/tools/security/yarGen/default.nix index 1cbf736bd26..630718aedcb 100644 --- a/pkgs/tools/security/yarGen/default.nix +++ b/pkgs/tools/security/yarGen/default.nix @@ -22,6 +22,12 @@ python3.pkgs.buildPythonApplication rec { url = "https://github.com/Neo23x0/yarGen/commit/cae14ac8efeb5536885792cae99d1d0f7fb6fde3.patch"; sha256 = "0z6925r7n1iysld5c8li5nkm1dbxg8j7pn0626a4vic525vf8ndl"; }) + # 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="; + }) ]; installPhase = '' From 50ae69d07e28cabef26489d8ce92f1e027d31e9c Mon Sep 17 00:00:00 2001 From: Cole Helbling Date: Thu, 22 Apr 2021 23:38:28 -0700 Subject: [PATCH 2/2] yarGen: install strings.xml Rather than requiring the tool to be run inside the yarGen repo (or somewhere else with a strings.xml), add the strings.xml to the store and use it from there. --- pkgs/tools/security/yarGen/default.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkgs/tools/security/yarGen/default.nix b/pkgs/tools/security/yarGen/default.nix index 630718aedcb..8a2d51b8e19 100644 --- a/pkgs/tools/security/yarGen/default.nix +++ b/pkgs/tools/security/yarGen/default.nix @@ -30,10 +30,16 @@ python3.pkgs.buildPythonApplication rec { }) ]; + postPatch = '' + substituteInPlace yarGen.py \ + --replace "./3rdparty/strings.xml" "$out/share/yarGen/3rdparty/strings.xml" + ''; + installPhase = '' runHook preInstall install -Dt "$out/bin" yarGen.py + install -Dt "$out/share/yarGen/3rdparty" 3rdparty/strings.xml runHook postInstall '';