2023-07-15 17:15:38 +00:00
|
|
|
{ lib, fetchFromGitHub, xorg, libsForQt5, wrapQtAppsHook, python3 }:
|
|
|
|
|
|
|
|
python3.pkgs.buildPythonApplication rec {
|
|
|
|
pname = "lenovo-legion-app";
|
2024-05-15 15:35:15 +00:00
|
|
|
version = "0.0.12";
|
2023-07-15 17:15:38 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "johnfanv2";
|
|
|
|
repo = "LenovoLegionLinux";
|
2024-01-02 11:29:13 +00:00
|
|
|
rev = "v${version}-prerelease";
|
2024-05-15 15:35:15 +00:00
|
|
|
hash = "sha256-BNrRv9EBmNINQbAw+BzVxKl/XoDgH1tsNZHJxfSpNoU=";
|
2023-07-15 17:15:38 +00:00
|
|
|
};
|
|
|
|
|
2023-08-04 22:07:22 +00:00
|
|
|
sourceRoot = "${src.name}/python/legion_linux";
|
2023-07-15 17:15:38 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [ wrapQtAppsHook ];
|
|
|
|
|
|
|
|
propagatedBuildInputs = with python3.pkgs; [
|
|
|
|
pyqt5
|
2024-05-15 15:35:15 +00:00
|
|
|
pyqt6
|
2023-07-15 17:15:38 +00:00
|
|
|
argcomplete
|
|
|
|
pyyaml
|
2023-11-16 04:20:00 +00:00
|
|
|
darkdetect
|
2023-07-15 17:15:38 +00:00
|
|
|
xorg.libxcb
|
|
|
|
libsForQt5.qtbase
|
|
|
|
];
|
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace ./setup.cfg \
|
2024-05-15 15:35:15 +00:00
|
|
|
--replace-fail "_VERSION" "${version}"
|
2023-11-16 04:20:00 +00:00
|
|
|
substituteInPlace ../../extra/service/fancurve-set \
|
2024-05-15 15:35:15 +00:00
|
|
|
--replace-fail "FOLDER=/etc/legion_linux/" "FOLDER=$out/share/legion_linux"
|
2023-11-16 04:20:00 +00:00
|
|
|
substituteInPlace ./legion_linux/legion.py \
|
2024-05-15 15:35:15 +00:00
|
|
|
--replace-fail "/etc/legion_linux" "$out/share/legion_linux"
|
|
|
|
substituteInPlace ./legion_linux/legion_gui.desktop \
|
|
|
|
--replace-fail "Icon=/usr/share/pixmaps/legion_logo.png" "Icon=legion_logo"
|
2023-07-15 17:15:38 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
dontWrapQtApps = true;
|
|
|
|
|
|
|
|
preFixup = ''
|
|
|
|
makeWrapperArgs+=("''${qtWrapperArgs[@]}")
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "An utility to control Lenovo Legion laptop";
|
|
|
|
homepage = "https://github.com/johnfanv2/LenovoLegionLinux";
|
|
|
|
license = lib.licenses.gpl2Only;
|
|
|
|
platforms = lib.platforms.linux;
|
|
|
|
maintainers = [ lib.maintainers.ulrikstrid ];
|
|
|
|
mainProgram = "legion_gui";
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|