From: bentoo overlay <bentoo@local>
Date: Thu, 15 May 2026 00:00:00 +0000
Subject: [PATCH] Make Corrosion optional (drop kameleon-qmk-helper when missing)

Corrosion (and the full Rust crate dependency tree pulled in by
kameleon-qmk-helper) is not yet packaged in Gentoo / bentoo. Make the
find_package call non-REQUIRED and guard the only consumer subdirectory
so the C++ kameleon kded module still builds; the QMK Rust helper just
won't be installed (the colour-LED feature for QMK keyboards will be
unavailable until corrosion + crates are properly packaged).

See also: gentoo bug 911819, 927072 (akonadi-search / kdepim-addons).
---
 CMakeLists.txt              | 2 +-
 kdeds/kameleon/CMakeLists.txt | 4 +++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -111,7 +111,7 @@ set_package_properties(Qt6Quick3D PROPERTIES
     TYPE RUNTIME
 )

-find_package(Corrosion REQUIRED)
+find_package(Corrosion)

 add_definitions(
     -DQT_DEPRECATED_WARNINGS
diff --git a/kdeds/kameleon/CMakeLists.txt b/kdeds/kameleon/CMakeLists.txt
--- a/kdeds/kameleon/CMakeLists.txt
+++ b/kdeds/kameleon/CMakeLists.txt
@@ -48,5 +48,7 @@ ecm_qt_declare_logging_category(kameleonhelper

 # FreeBSD is missing dependencies to CI.
 if(NOT CMAKE_SYSTEM_NAME MATCHES FreeBSD)
-    add_subdirectory(qmk/kameleon-qmk-helper)
+    if(Corrosion_FOUND)
+        add_subdirectory(qmk/kameleon-qmk-helper)
+    endif()
 endif()
