Reformat
This commit is contained in:
parent
b7bde14d75
commit
246483e3d9
8 changed files with 187 additions and 178 deletions
49
flake.lock
generated
49
flake.lock
generated
|
|
@ -3,11 +3,11 @@
|
|||
"candy-icons": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1723591882,
|
||||
"narHash": "sha256-XAB+Ai7r5n/125mmkc/J0J1aPjFgQGeRPT+vc2LP6cE=",
|
||||
"lastModified": 1724623392,
|
||||
"narHash": "sha256-0wsSjK8WrwM/yh40a76cYblbv52tdJGTKAdxNU43frc=",
|
||||
"ref": "refs/heads/master",
|
||||
"rev": "eba39aed603a255ed756ed601e87349561217ef0",
|
||||
"revCount": 1211,
|
||||
"rev": "b92b133d0ad7ed5b5e376bd00216a05652277209",
|
||||
"revCount": 1217,
|
||||
"type": "git",
|
||||
"url": "https://github.com/EliverLara/candy-icons"
|
||||
},
|
||||
|
|
@ -36,11 +36,11 @@
|
|||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1723362943,
|
||||
"narHash": "sha256-dFZRVSgmJkyM0bkPpaYRtG/kRMRTorUIDj8BxoOt1T4=",
|
||||
"lastModified": 1726243404,
|
||||
"narHash": "sha256-sjiGsMh+1cWXb53Tecsm4skyFNag33GPbVgCdfj3n9I=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "a58bc8ad779655e790115244571758e8de055e3d",
|
||||
"rev": "345c263f2f53a3710abe117f28a5cb86d0ba4059",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
@ -59,7 +59,6 @@
|
|||
"sweet-ambar-blue-dark": "sweet-ambar-blue-dark",
|
||||
"sweet-folders": "sweet-folders",
|
||||
"sweet-kde": "sweet-kde",
|
||||
"wallpaper-engine-plasma5-plugin": "wallpaper-engine-plasma5-plugin",
|
||||
"wallpaper-engine-plasma6-plugin": "wallpaper-engine-plasma6-plugin",
|
||||
"yorha-grub-theme": "yorha-grub-theme",
|
||||
"yorha-sound-theme": "yorha-sound-theme"
|
||||
|
|
@ -68,11 +67,11 @@
|
|||
"sweet-ambar-blue": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1723587745,
|
||||
"narHash": "sha256-IdOwZM+r9yiWaNnobVGtMjGLGHjQHH0sf/yCFUxIT+0=",
|
||||
"lastModified": 1725663625,
|
||||
"narHash": "sha256-H6TEFHxGK/W39eR95v6dwBu7XyzsvajpD/Vn28fc0aI=",
|
||||
"ref": "Ambar-Blue",
|
||||
"rev": "e133a6b40b0a5d5c8c2163de9b36150b285d15f2",
|
||||
"revCount": 294,
|
||||
"rev": "2a5fc9cb672ecfd1f2a6f1f1d289a665891336f0",
|
||||
"revCount": 297,
|
||||
"type": "git",
|
||||
"url": "https://github.com/EliverLara/Sweet"
|
||||
},
|
||||
|
|
@ -85,11 +84,11 @@
|
|||
"sweet-ambar-blue-dark": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1723587757,
|
||||
"narHash": "sha256-qrbf1vrFgCxM8p5zAZvYCeoZlG6Mfy9UUbLx9PKUiKM=",
|
||||
"lastModified": 1725663779,
|
||||
"narHash": "sha256-ffQGwPhXHOZDhC/F1Enj0zMzbaXRkVbUkok3KfWZycY=",
|
||||
"ref": "Ambar-Blue-Dark",
|
||||
"rev": "b96bed2f0a22c4431f944489bb37a45bc16e9300",
|
||||
"revCount": 378,
|
||||
"rev": "ea071eb2979cd2bc5f9f2a352ab8534279d3c77e",
|
||||
"revCount": 381,
|
||||
"type": "git",
|
||||
"url": "https://github.com/EliverLara/Sweet"
|
||||
},
|
||||
|
|
@ -147,24 +146,6 @@
|
|||
"type": "github"
|
||||
}
|
||||
},
|
||||
"wallpaper-engine-plasma5-plugin": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1710844534,
|
||||
"narHash": "sha256-zVXvyUiigqIOKBKBv82SyjrEnoCNrc+o9Rkc8JXQt98=",
|
||||
"ref": "refs/heads/main",
|
||||
"rev": "34f7f01acba3bc8f94d478032cf86aef06b02d26",
|
||||
"revCount": 572,
|
||||
"submodules": true,
|
||||
"type": "git",
|
||||
"url": "https://github.com/catsout/wallpaper-engine-kde-plugin"
|
||||
},
|
||||
"original": {
|
||||
"submodules": true,
|
||||
"type": "git",
|
||||
"url": "https://github.com/catsout/wallpaper-engine-kde-plugin"
|
||||
}
|
||||
},
|
||||
"wallpaper-engine-plasma6-plugin": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
|
|
|
|||
32
flake.nix
32
flake.nix
|
|
@ -24,10 +24,6 @@
|
|||
flake = false;
|
||||
url = "git+https://github.com/EliverLara/Sweet-kde?ref=plasma6";
|
||||
};
|
||||
wallpaper-engine-plasma5-plugin = {
|
||||
flake = false;
|
||||
url = "git+https://github.com/catsout/wallpaper-engine-kde-plugin?submodules=1";
|
||||
};
|
||||
wallpaper-engine-plasma6-plugin = {
|
||||
flake = false;
|
||||
url = "git+https://github.com/catsout/wallpaper-engine-kde-plugin?ref=qt6&submodules=1";
|
||||
|
|
@ -42,27 +38,33 @@
|
|||
};
|
||||
};
|
||||
|
||||
outputs = inputs@{ self, flake-utils, nixpkgs, ... }:
|
||||
let
|
||||
outputs = inputs @ {
|
||||
self,
|
||||
flake-utils,
|
||||
nixpkgs,
|
||||
...
|
||||
}: let
|
||||
pkgDrvDir = ./packages;
|
||||
pkgDrvs = pkgs: pkgs.lib.attrsets.mapAttrs'
|
||||
(pkgDrv: _: rec {
|
||||
name = builtins.substring 0
|
||||
pkgDrvs = pkgs: (with pkgs.lib;
|
||||
builtins.listToAttrs
|
||||
(builtins.map
|
||||
(pkgDrv: rec {
|
||||
name =
|
||||
builtins.substring 0
|
||||
(
|
||||
builtins.sub (builtins.stringLength pkgDrv) 4
|
||||
)
|
||||
pkgDrv;
|
||||
value = import (pkgDrvDir + "/${pkgDrv}") { inherit inputs name pkgs; };
|
||||
value = import (pkgDrvDir + "/${pkgDrv}") {inherit inputs name pkgs;};
|
||||
})
|
||||
(builtins.readDir pkgDrvDir);
|
||||
(builtins.filter (pkgDrv: strings.hasSuffix ".nix" pkgDrv) (builtins.attrNames (builtins.readDir pkgDrvDir)))));
|
||||
in
|
||||
{
|
||||
overlays.default = _: prev: pkgDrvs prev;
|
||||
} // flake-utils.lib.eachDefaultSystem (system:
|
||||
let
|
||||
}
|
||||
// flake-utils.lib.eachDefaultSystem (system: let
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
in
|
||||
{
|
||||
in {
|
||||
packages = pkgDrvs pkgs;
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,9 +1,12 @@
|
|||
{ inputs, name, pkgs }:
|
||||
|
||||
{
|
||||
inputs,
|
||||
name,
|
||||
pkgs,
|
||||
}:
|
||||
pkgs.stdenv.mkDerivation {
|
||||
inherit name;
|
||||
srcs = [];
|
||||
buildInputs = [ pkgs.jdupes ];
|
||||
buildInputs = [pkgs.jdupes];
|
||||
dontUnpack = true;
|
||||
preInstall = with inputs; ''
|
||||
cp -r ${candy-icons}/ candy-icons/
|
||||
|
|
|
|||
|
|
@ -1,60 +0,0 @@
|
|||
{ inputs, name, pkgs }:
|
||||
|
||||
pkgs.plasma5Packages.callPackage
|
||||
(
|
||||
{ mkDerivation
|
||||
, cmake
|
||||
, extra-cmake-modules
|
||||
, gst-libav
|
||||
, lz4
|
||||
, mpv
|
||||
, pkg-config
|
||||
, python-ws
|
||||
, plasma-framework
|
||||
, qtdeclarative
|
||||
, qtwebsockets
|
||||
, qtwebchannel
|
||||
, qtx11extras
|
||||
, vulkan-headers
|
||||
, vulkan-loader
|
||||
, vulkan-tools
|
||||
, websockets
|
||||
}:
|
||||
|
||||
mkDerivation {
|
||||
inherit name;
|
||||
cmakeFlags = [ "-DUSE_PLASMAPKG=ON" ];
|
||||
nativeBuildInputs = [ cmake extra-cmake-modules pkg-config ];
|
||||
buildInputs = [
|
||||
lz4
|
||||
mpv
|
||||
plasma-framework
|
||||
python-ws
|
||||
qtdeclarative
|
||||
qtwebchannel
|
||||
qtwebsockets
|
||||
qtx11extras
|
||||
vulkan-headers
|
||||
vulkan-tools
|
||||
vulkan-loader
|
||||
websockets
|
||||
];
|
||||
postInstall = ''
|
||||
chmod +x ../plugin/contents/pyext.py
|
||||
PATH=${python-ws}/bin:$PATH patchShebangs --build ../plugin/contents/pyext.py
|
||||
sed -i "18i \\ \"[ -f \\\\\"${placeholder "out"}/share/\$EXT\\\\\" ] && WKD=\\\\\"${placeholder "out"}/share/\$EXT\\\\\"\"," ../plugin/contents/ui/Pyext.qml
|
||||
sed -i "s/exec python3 //g" ../plugin/contents/ui/Pyext.qml
|
||||
mkdir -p $out/share/plasma/wallpapers/com.github.casout.wallpaperEngineKde/
|
||||
cp -r ../plugin/* $out/share/plasma/wallpapers/com.github.casout.wallpaperEngineKde/
|
||||
'';
|
||||
src = inputs.${name};
|
||||
}
|
||||
)
|
||||
(with pkgs; {
|
||||
inherit (gst_all_1) gst-libav;
|
||||
inherit (python3Packages) websockets;
|
||||
python-ws = python3.withPackages (ps: with ps; [
|
||||
websockets
|
||||
]);
|
||||
})
|
||||
|
||||
|
|
@ -1,48 +1,73 @@
|
|||
{ inputs, name, pkgs }:
|
||||
|
||||
pkgs.kdePackages.callPackage
|
||||
(
|
||||
{ extra-cmake-modules
|
||||
, full
|
||||
, kpackage
|
||||
, libplasma
|
||||
, lib
|
||||
, lz4
|
||||
, mkKdeDerivation
|
||||
, mpv
|
||||
, pkg-config
|
||||
, python-ws
|
||||
{
|
||||
inputs,
|
||||
name,
|
||||
pkgs,
|
||||
}:
|
||||
pkgs.kdePackages.callPackage (
|
||||
{
|
||||
extra-cmake-modules,
|
||||
fetchFromGitHub,
|
||||
kpackage,
|
||||
libplasma,
|
||||
lib,
|
||||
lz4,
|
||||
mkKdeDerivation,
|
||||
mpv,
|
||||
pkg-config,
|
||||
python3,
|
||||
qtbase,
|
||||
qtmultimedia,
|
||||
qtwebchannel,
|
||||
qtwebengine,
|
||||
qtwebsockets,
|
||||
}:
|
||||
|
||||
mkKdeDerivation {
|
||||
extraBuildInputs = [
|
||||
extra-cmake-modules
|
||||
full
|
||||
libplasma
|
||||
lz4
|
||||
mpv
|
||||
];
|
||||
extraCmakeFlags = [ "-DUSE_PLASMAPKG=ON" ];
|
||||
pname = name;
|
||||
version = "latest";
|
||||
|
||||
src = inputs.${name};
|
||||
|
||||
patches = [./${name}.patch];
|
||||
|
||||
extraNativeBuildInputs = [
|
||||
kpackage
|
||||
pkg-config
|
||||
];
|
||||
meta.license = with lib.licenses; [ gpl2 ];
|
||||
pname = name;
|
||||
postInstall = ''
|
||||
chmod +x ../plugin/contents/pyext.py
|
||||
PATH=${python-ws}/bin:$PATH patchShebangs --build ../plugin/contents/pyext.py
|
||||
sed -i "18i \\ \"[ -f \\\\\"${placeholder "out"}/share/\$EXT\\\\\" ] && WKD=\\\\\"${placeholder "out"}/share/\$EXT\\\\\"\"," ../plugin/contents/ui/Pyext.qml
|
||||
sed -i "s/exec python3 //g" ../plugin/contents/ui/Pyext.qml
|
||||
kpackagetool6 -i ../plugin/ -p $out/share/plasma/wallpapers/
|
||||
'';
|
||||
src = inputs.${name};
|
||||
version = "latest";
|
||||
}
|
||||
)
|
||||
{
|
||||
python-ws = pkgs.python3.withPackages (ps: with ps; [
|
||||
websockets
|
||||
]);
|
||||
}
|
||||
|
||||
extraBuildInputs = [
|
||||
extra-cmake-modules
|
||||
libplasma
|
||||
lz4
|
||||
mpv
|
||||
];
|
||||
|
||||
extraCmakeFlags = [
|
||||
"-DQML2_CMAKE_PATH=${
|
||||
lib.makeSearchPath "lib/qt-6/qml" [
|
||||
qtmultimedia
|
||||
qtwebchannel
|
||||
qtwebengine
|
||||
qtwebsockets
|
||||
]
|
||||
}"
|
||||
"-DQt6_DIR=${qtbase}/lib/cmake/Qt6"
|
||||
"-DUSE_PLASMAPKG=ON"
|
||||
];
|
||||
|
||||
postInstall = let
|
||||
py3-ws = python3.withPackages (ps: with ps; [websockets]);
|
||||
in ''
|
||||
cd ../plugin
|
||||
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; {
|
||||
description = "KDE wallpaper plugin integrating Wallpaper Engine";
|
||||
homepage = "https://github.com/catsout/wallpaper-engine-kde-plugin";
|
||||
license = licenses.gpl2Only;
|
||||
};
|
||||
}
|
||||
)
|
||||
{}
|
||||
|
|
|
|||
52
packages/wallpaper-engine-plasma6-plugin.patch
Normal file
52
packages/wallpaper-engine-plasma6-plugin.patch
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index e1298ba..1c9ddec 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}")
|
||||
set(CMAKE_SKIP_INSTALL_ALL_DEPENDENCY true)
|
||||
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
||||
if(NOT OpenGL_GL_PREFERENCE)
|
||||
diff --git a/plugin/contents/pyext.py b/plugin/contents/pyext.py
|
||||
old mode 100644
|
||||
new mode 100755
|
||||
diff --git a/plugin/contents/ui/Pyext.qml b/plugin/contents/ui/Pyext.qml
|
||||
index 1a48f5e..8a9c9c9 100644
|
||||
--- a/plugin/contents/ui/Pyext.qml
|
||||
+++ b/plugin/contents/ui/Pyext.qml
|
||||
@@ -15,7 +15,8 @@ Item {
|
||||
"[ -f /usr/share/$EXT ] && WKD=/usr/share/$EXT",
|
||||
"[ -f \"$HOME/.local/share/$EXT\" ] && WKD=\"$HOME/.local/share/$EXT\"",
|
||||
"[ -f \"$XDG_DATA_HOME/$EXT\" ] && WKD=\"$XDG_DATA_HOME/$EXT\"",
|
||||
- `exec python3 "$WKD" "${ws_server.url}"`
|
||||
+ "[ -f \"NIX_STORE_PACKAGE_PATH/share/$EXT\" ] && WKD=\"NIX_STORE_PACKAGE_PATH/share/$EXT\"",
|
||||
+ `"$WKD" "${ws_server.url}"`
|
||||
].join("\n");
|
||||
return sh;
|
||||
}
|
||||
diff --git a/src/plugin.cpp b/src/plugin.cpp
|
||||
index 5e8a7e2..1709a27 100644
|
||||
--- a/src/plugin.cpp
|
||||
+++ b/src/plugin.cpp
|
||||
@@ -13,6 +13,18 @@ class Port : public QQmlExtensionPlugin {
|
||||
Q_PLUGIN_METADATA(IID QQmlExtensionInterface_iid)
|
||||
|
||||
public:
|
||||
+ void initializeEngine(QQmlEngine *engine, const char *uri) override {
|
||||
+ if (strcmp(uri, "com.github.catsout.wallpaperEngineKde") != 0) return;
|
||||
+ if (!engine) return;
|
||||
+
|
||||
+ QString pathList = QML2_CMAKE_PATH;
|
||||
+ QStringList paths = pathList.split(':', Qt::SkipEmptyParts);
|
||||
+ for (const QString &path : paths) {
|
||||
+ engine->addImportPath(path);
|
||||
+ }
|
||||
+
|
||||
+ QQmlExtensionPlugin::initializeEngine(engine, uri);
|
||||
+ }
|
||||
void registerTypes(const char* uri) override {
|
||||
if (strcmp(uri, "com.github.catsout.wallpaperEngineKde") != 0) return;
|
||||
qmlRegisterType<wekde::PluginInfo>(uri, WPVer[0], WPVer[1], "PluginInfo");
|
||||
|
|
@ -1,8 +1,11 @@
|
|||
{ inputs, name, pkgs, resolution ? "2560x1440" }:
|
||||
|
||||
assert builtins.any (s: resolution == s) [ "1920x1080" "2256x1504" "2560x1440" "3840x2160" ];
|
||||
|
||||
pkgs.stdenv.mkDerivation {
|
||||
{
|
||||
inputs,
|
||||
name,
|
||||
pkgs,
|
||||
resolution ? "2560x1440",
|
||||
}:
|
||||
assert builtins.any (s: resolution == s) ["1920x1080" "2256x1504" "2560x1440" "3840x2160"];
|
||||
pkgs.stdenv.mkDerivation {
|
||||
inherit name;
|
||||
src = inputs.${name};
|
||||
installPhase = ''
|
||||
|
|
@ -11,4 +14,4 @@ pkgs.stdenv.mkDerivation {
|
|||
cp -r yorha-${resolution}/* $out/
|
||||
runHook postInstall
|
||||
'';
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,8 @@
|
|||
{ inputs, name, pkgs }:
|
||||
|
||||
{
|
||||
inputs,
|
||||
name,
|
||||
pkgs,
|
||||
}:
|
||||
pkgs.stdenv.mkDerivation {
|
||||
inherit name;
|
||||
src = inputs.${name};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue