This commit is contained in:
Invariantspace 2024-09-15 18:34:27 -07:00
parent b7bde14d75
commit 246483e3d9
No known key found for this signature in database
GPG key ID: EBC4A20067373921
8 changed files with 187 additions and 178 deletions

View file

@ -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;
};
}
)
{}