nix-custom/packages/wallpaper-engine-plasma6-plugin.nix
2025-01-25 15:42:15 +08:00

69 lines
1.5 KiB
Nix

{
inputs,
name,
pkgs,
}:
pkgs.kdePackages.callPackage (
{
extra-cmake-modules,
kpackage,
libplasma,
lib,
lz4,
mkKdeDerivation,
mpv,
pkg-config,
python3,
qtbase,
qtmultimedia,
qtwebchannel,
qtwebengine,
qtwebsockets,
}:
mkKdeDerivation {
pname = name;
version = "latest";
src = inputs.${name};
patches = [./${name}.patch];
extraNativeBuildInputs = [
kpackage
pkg-config
];
extraBuildInputs = [
extra-cmake-modules
libplasma
lz4
mpv
];
extraCmakeFlags = [
(lib.cmakeFeature "QML_LIB" (lib.makeSearchPathOutput "out" "lib/qt-6/qml" [
qtmultimedia
qtwebchannel
qtwebengine
qtwebsockets
]))
(lib.cmakeFeature "Qt6_DIR" "${qtbase}/lib/cmake/Qt6")
];
postInstall = let
py3-ws = python3.withPackages (ps: with ps; [websockets]);
in ''
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"}
'';
meta = with lib; {
description = "KDE wallpaper plugin integrating Wallpaper Engine";
homepage = "https://github.com/catsout/wallpaper-engine-kde-plugin";
license = licenses.gpl2Only;
};
}
)
{}