This commit is contained in:
Andreas Schaafsma 2025-07-15 03:45:46 +02:00
parent 3a59ef19f6
commit bd75aecb14

View File

@ -51,6 +51,32 @@ pkgs.kdePackages.mkKdeDerivation rec {
# Disable the scene backend since it's missing CMakeLists.txt
postPatch = ''
sed -i 's|add_subdirectory(backend_scene)|# add_subdirectory(backend_scene)|' src/CMakeLists.txt
# Remove wescene-renderer-qml library link dependency
sed -i 's|wescene-renderer-qml|# wescene-renderer-qml|' src/CMakeLists.txt
# Remove SceneBackend dependencies from PluginInfo.cpp
sed -i '/^#include "SceneBackend.hpp"/d' src/PluginInfo.cpp
sed -i 's|QString::fromStdString(scenebackend::SceneObject::GetDefaultCachePath())|QStandardPaths::writableLocation(QStandardPaths::CacheLocation) + "/wallpaper-engine-kde-plugin"|' src/PluginInfo.cpp
# Add missing includes to PluginInfo.cpp
sed -i '/#include <QCoreApplication>/a #include <QStandardPaths>' src/PluginInfo.cpp
sed -i '/#include <QCoreApplication>/a #include <QUrl>' src/PluginInfo.cpp
# Remove SceneBackend dependencies from plugin.cpp
sed -i '/^#include "SceneBackend.hpp"/d' src/plugin.cpp
sed -i '/qmlRegisterType<scenebackend::SceneObject>/d' src/plugin.cpp
# Fix Qt6 deprecation warnings in MouseGrabber.cpp
sed -i 's|event->localPos()|event->position()|g' src/MouseGrabber.cpp
sed -i 's|event->screenPos()|event->globalPosition()|g' src/MouseGrabber.cpp
sed -i 's|event->posF()|event->position()|g' src/MouseGrabber.cpp
# Fix QMouseEvent and QHoverEvent constructors for Qt6 (cast device to QPointingDevice*)
sed -i 's|event->modifiers());|event->modifiers(), static_cast<const QPointingDevice*>(event->device()));|g' src/MouseGrabber.cpp
# Fix Qt6 deprecation warning in qthelper.hpp
sed -i 's|v.type()|v.metaType().id()|g' src/backend_mpv/qthelper.hpp
'';
cmakeFlags = [
@ -67,8 +93,6 @@ pkgs.kdePackages.mkKdeDerivation rec {
cd $out/share/plasma/wallpapers/com.github.catsout.wallpaperEngineKde
chmod +x ./contents/pyext.py
patchShebangs --build ./contents/pyext.py
substituteInPlace ./contents/ui/Pyext.qml \
--replace-fail NIX_STORE_PACKAGE_PATH ${placeholder "out"}
cd -
'';