nix-custom/packages/wallpaper-engine-plasma6-plugin.nix
2024-09-15 18:34:27 -07:00

73 lines
1.5 KiB
Nix

{
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 {
pname = name;
version = "latest";
src = inputs.${name};
patches = [./${name}.patch];
extraNativeBuildInputs = [
kpackage
pkg-config
];
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;
};
}
)
{}