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

22
flake.lock generated
View file

@ -36,11 +36,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1736344531, "lastModified": 1737632463,
"narHash": "sha256-8YVQ9ZbSfuUk2bUf2KRj60NRraLPKPS0Q4QFTbc+c2c=", "narHash": "sha256-38J9QfeGSej341ouwzqf77WIHAScihAKCt8PQJ+NH28=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "bffc22eb12172e6db3c5dde9e3e5628f8e3e7912", "rev": "0aa475546ed21629c4f5bbf90e38c846a99ec9e9",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -67,11 +67,11 @@
"sweet-ambar-blue": { "sweet-ambar-blue": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1736465217, "lastModified": 1737320044,
"narHash": "sha256-8sPz6pFZbLtX7w+Lb9KsmnpdZZnEA7kl/h/Xx7cf1hU=", "narHash": "sha256-I3lwKo+kcv2QEZ880NZ+Ox7zFlGi9/wI86j9S96BGpo=",
"ref": "Ambar-Blue", "ref": "Ambar-Blue",
"rev": "2b3d23728b0b8a5aaaf4682b67eebd2aa382c6b3", "rev": "4e0f071dfe2ddfcbb59f702cf01ebb0f582b88da",
"revCount": 316, "revCount": 318,
"type": "git", "type": "git",
"url": "https://github.com/EliverLara/Sweet" "url": "https://github.com/EliverLara/Sweet"
}, },
@ -84,11 +84,11 @@
"sweet-ambar-blue-dark": { "sweet-ambar-blue-dark": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1736465280, "lastModified": 1737319507,
"narHash": "sha256-Yt/PL9OrkjxB2eU9iEaE1xyS8Y0zIloLGbUsgx1HWVs=", "narHash": "sha256-LPpjfs/clxK1/1/TlclZU0c6/rcS3yRBbqdGevgqGJ8=",
"ref": "Ambar-Blue-Dark", "ref": "Ambar-Blue-Dark",
"rev": "c3e85d084dcd4238b3a63af447a3e9432b4b91c9", "rev": "76a35f8dba0b55429b5f43d136f151c76214cb15",
"revCount": 400, "revCount": 402,
"type": "git", "type": "git",
"url": "https://github.com/EliverLara/Sweet" "url": "https://github.com/EliverLara/Sweet"
}, },

View file

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

View file

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