Update flake

This commit is contained in:
Invariantspace 2025-01-25 15:42:15 +08:00
parent a1271d04c0
commit ee91d74867
Signed by: macronova
GPG key ID: CE969670FB4B4A56
3 changed files with 21 additions and 25 deletions

View file

@ -6,7 +6,6 @@
pkgs.kdePackages.callPackage (
{
extra-cmake-modules,
fetchFromGitHub,
kpackage,
libplasma,
lib,
@ -42,25 +41,22 @@ pkgs.kdePackages.callPackage (
];
extraCmakeFlags = [
"-DQML2_CMAKE_PATH=${
lib.makeSearchPath "lib/qt-6/qml" [
(lib.cmakeFeature "QML_LIB" (lib.makeSearchPathOutput "out" "lib/qt-6/qml" [
qtmultimedia
qtwebchannel
qtwebengine.dev
qtwebengine
qtwebsockets
]
}"
"-DQt6_DIR=${qtbase}/lib/cmake/Qt6"
"-DUSE_PLASMAPKG=ON"
]))
(lib.cmakeFeature "Qt6_DIR" "${qtbase}/lib/cmake/Qt6")
];
postInstall = let
py3-ws = python3.withPackages (ps: with ps; [websockets]);
in ''
cd ../plugin
cd $out/share/plasma/wallpapers/com.github.catsout.wallpaperEngineKde
chmod +x ./contents/pyext.py
PATH=${py3-ws}/bin:$PATH patchShebangs --build ./contents/pyext.py
substituteInPlace ./contents/ui/Pyext.qml --replace-fail NIX_STORE_PACKAGE_PATH ${placeholder "out"}
kpackagetool6 -i ./ -p $out/share/plasma/wallpapers/
'';
meta = with lib; {

View file

@ -1,12 +1,12 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e1298ba..1c9ddec 100644
index e1298ba..1af7d0a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -9,6 +9,7 @@ set(KF_MIN_VERSION "5.68.0")
project("WallpaperEngineKde")
+add_definitions(-DQML2_CMAKE_PATH="${QML2_CMAKE_PATH}")
+add_definitions(-DQML_LIB="${QML_LIB}")
set(CMAKE_SKIP_INSTALL_ALL_DEPENDENCY true)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
if(NOT OpenGL_GL_PREFERENCE)
@ -28,7 +28,7 @@ index 1a48f5e..7db2480 100644
return sh;
}
diff --git a/src/plugin.cpp b/src/plugin.cpp
index 4bc817e..2fa88a3 100644
index 4bc817e..a98cb4a 100644
--- a/src/plugin.cpp
+++ b/src/plugin.cpp
@@ -14,6 +14,18 @@ class Port : public QQmlExtensionPlugin {
@ -39,7 +39,7 @@ index 4bc817e..2fa88a3 100644
+ if (strcmp(uri, "com.github.catsout.wallpaperEngineKde") != 0) return;
+ if (!engine) return;
+
+ QString pathList = QML2_CMAKE_PATH;
+ QString pathList = QML_LIB;
+ QStringList paths = pathList.split(':', Qt::SkipEmptyParts);
+ for (const QString &path : paths) {
+ engine->addImportPath(path);