Merge pull request #319634 from diniamo/ananicy-cpp-patch-for-wrappers

ananicy-cpp: support wrapped applications
This commit is contained in:
Artturin 2024-06-20 13:09:18 +03:00 committed by GitHub
commit 65b6baea6f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 18 additions and 0 deletions

View File

@ -0,0 +1,16 @@
diff --git a/src/worker.cpp b/src/worker.cpp
index 0cf8955..b9dc70f 100644
--- a/src/worker.cpp
+++ b/src/worker.cpp
@@ -29,7 +29,10 @@ void Worker::work(const std::stop_token &stop_token) {
while (!stop_token.stop_requested()) {
while ((proc = process_queue->poll(500ms)).has_value()) {
const auto &p = proc.value();
- const auto &rule = rules->get_rule(p.name);
+ auto name = p.name;
+ if (name.starts_with('.') && name.ends_with("-wrapped"))
+ name = name.substr(1, name.find_last_of('-') - 1);
+ const auto &rule = rules->get_rule(name);
processed_count++;

View File

@ -33,6 +33,7 @@ clangStdenv.mkDerivation rec {
url = "https://gitlab.com/ananicy-cpp/ananicy-cpp/-/commit/6ea2dccceec39b6c4913f617dad81d859aa20f24.patch";
hash = "sha256-C+7x/VpVwewXEPwibi7GxGfjuhDkhcjTyGbZHlYL2Bs=";
})
./match-wrappers.patch
];
strictDeps = true;
@ -80,6 +81,7 @@ clangStdenv.mkDerivation rec {
maintainers = with lib.maintainers; [
artturin
johnrtitor
diniamo
];
mainProgram = "ananicy-cpp";
};