The issue is caused by Guix "bug" in package `extra-cmake-modules`.
The problem is that the function `ecm_find_qmlmodule` looks for Qt6 modules - well attempts by launching `Qt6::qmlplugindump`.
I've tried to specify the TARGET and QT_MAJOR to Qt::5 and also removing the Qt6 branch in `extra-cmake-modules/modules/ECMFindQmlModule.cmake.in`.
Here's the excerpt of the build of `kwin`:
```
-- Could NOT find hwdata (missing: hwdata_FOUND hwdata_PNPIDS_FILE)
-- Found QtQuick-QMLModule: TRUE (found version "")
-- qmlplugindump failed for QtQuick.Controls.
-- Could NOT find QtQuick.Controls-QMLModule (missing: QtQuick.Controls-QMLModule_FOUND)
-- Found QtQuick.Layouts-QMLModule: TRUE (found version "")
-- Found QtQuick.Window-QMLModule: TRUE (found version "")
-- Found QtMultimedia-QMLModule: TRUE (found version "")
-- Found org.kde.kquickcontrolsaddons-QMLModule: TRUE (found version "")
-- qmlplugindump failed for org.kde.plasma.core.
-- Could NOT find org.kde.plasma.core-QMLModule (missing: org.kde.plasma.core-QMLModule_FOUND)
```
And when we check for qmlplugindump we get this:
```
/tmp/guix-build-kwin-5.25.5.drv-2/kwin-5.25.5$ grep -r qmlplugindump
Findorg.kde.plasma.components-QMLModule.cmake: find_program(QMLPLUGINDUMP_PROGRAM NAMES qmlplugindump HINTS ${qt_binaries_dir})
Findorg.kde.plasma.components-QMLModule.cmake: get_target_property(QMLPLUGINDUMP_PROGRAM Qt6::qmlplugindump LOCATION)
Findorg.kde.plasma.components-QMLModule.cmake: message(WARNING "Could not find qmlplugindump. It is necessary to look up qml module dependencies.")
Findorg.kde.plasma.components-QMLModule.cmake: message(STATUS "qmlplugindump failed for org.kde.plasma.components.")
Findorg.kde.plasma.core-QMLModule.cmake: find_program(QMLPLUGINDUMP_PROGRAM NAMES qmlplugindump HINTS ${qt_binaries_dir})
Findorg.kde.plasma.core-QMLModule.cmake: get_target_property(QMLPLUGINDUMP_PROGRAM Qt6::qmlplugindump LOCATION)
Findorg.kde.plasma.core-QMLModule.cmake: message(WARNING "Could not find qmlplugindump. It is necessary to look up qml module dependencies.")
Findorg.kde.plasma.core-QMLModule.cmake: message(STATUS "qmlplugindump failed for org.kde.plasma.core.")
Findorg.kde.kquickcontrolsaddons-QMLModule.cmake: find_program(QMLPLUGINDUMP_PROGRAM NAMES qmlplugindump HINTS ${qt_binaries_dir})
Findorg.kde.kquickcontrolsaddons-QMLModule.cmake: get_target_property(QMLPLUGINDUMP_PROGRAM Qt6::qmlplugindump LOCATION)
Findorg.kde.kquickcontrolsaddons-QMLModule.cmake: message(WARNING "Could not find qmlplugindump. It is necessary to look up qml module dependencies.")
Findorg.kde.kquickcontrolsaddons-QMLModule.cmake: message(STATUS "qmlplugindump failed for org.kde.kquickcontrolsaddons.")
FindQtMultimedia-QMLModule.cmake: find_program(QMLPLUGINDUMP_PROGRAM NAMES qmlplugindump HINTS ${qt_binaries_dir})
FindQtMultimedia-QMLModule.cmake: get_target_property(QMLPLUGINDUMP_PROGRAM Qt6::qmlplugindump LOCATION)
FindQtMultimedia-QMLModule.cmake: message(WARNING "Could not find qmlplugindump. It is necessary to look up qml module dependencies.")
FindQtMultimedia-QMLModule.cmake: message(STATUS "qmlplugindump failed for QtMultimedia.")
FindQtQuick.Window-QMLModule.cmake: find_program(QMLPLUGINDUMP_PROGRAM NAMES qmlplugindump HINTS ${qt_binaries_dir})
FindQtQuick.Window-QMLModule.cmake: get_target_property(QMLPLUGINDUMP_PROGRAM Qt6::qmlplugindump LOCATION)
FindQtQuick.Window-QMLModule.cmake: message(WARNING "Could not find qmlplugindump. It is necessary to look up qml module dependencies.")
FindQtQuick.Window-QMLModule.cmake: message(STATUS "qmlplugindump failed for QtQuick.Window.")
FindQtQuick.Layouts-QMLModule.cmake: find_program(QMLPLUGINDUMP_PROGRAM NAMES qmlplugindump HINTS ${qt_binaries_dir})
FindQtQuick.Layouts-QMLModule.cmake: get_target_property(QMLPLUGINDUMP_PROGRAM Qt6::qmlplugindump LOCATION)
FindQtQuick.Layouts-QMLModule.cmake: message(WARNING "Could not find qmlplugindump. It is necessary to look up qml module dependencies.")
FindQtQuick.Layouts-QMLModule.cmake: message(STATUS "qmlplugindump failed for QtQuick.Layouts.")
FindQtQuick.Controls-QMLModule.cmake: find_program(QMLPLUGINDUMP_PROGRAM NAMES qmlplugindump HINTS ${qt_binaries_dir})
FindQtQuick.Controls-QMLModule.cmake: get_target_property(QMLPLUGINDUMP_PROGRAM Qt6::qmlplugindump LOCATION)
FindQtQuick.Controls-QMLModule.cmake: message(WARNING "Could not find qmlplugindump. It is necessary to look up qml module dependencies.")
FindQtQuick.Controls-QMLModule.cmake: message(STATUS "qmlplugindump failed for QtQuick.Controls.")
FindQtQuick-QMLModule.cmake: find_program(QMLPLUGINDUMP_PROGRAM NAMES qmlplugindump HINTS ${qt_binaries_dir})
FindQtQuick-QMLModule.cmake: get_target_property(QMLPLUGINDUMP_PROGRAM Qt6::qmlplugindump LOCATION)
FindQtQuick-QMLModule.cmake: message(WARNING "Could not find qmlplugindump. It is necessary to look up qml module dependencies.")
FindQtQuick-QMLModule.cmake: message(STATUS "qmlplugindump failed for QtQuick.")
```
However, the `extra-cmake-modules` depends only on `qtbase-5` and just for tests. The incriminated program is part of different package:
```
find /gnu/store -iname qmlplugindump
/gnu/store/7dpp0vpli7f4j4idaj5iwcpra8hl3xfb-qtdeclarative-5.15.2/bin/qmlplugindump
```
So the solution is probably to add `qtdeclarative-5` to list of inputs. However the same problem might happen with Qt6 and maybe more extra modules.
Stay tuned for this one as I have to rebuild majority of the packages :-D
There is also bug about this in earlier verions of `extra-cmake-modules` but the code is deprecated if I apply the patch [1] and it does not solve the problem that Guix stores all in the `/gnu/store/`.
To add to my curiosity Nix does not appear to have this problem [2] but they use some `setup-hook.sh` [2] - needs more studying.