Unverified Commit a1b23cf1 authored by Ulrik Strid's avatar Ulrik Strid Committed by GitHub
Browse files

lenovo-legion: 0.0.12 -> 0.0.18 with patches in master (#348417)

parents 8bddc04f f9d8517d
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -3816,6 +3816,13 @@
    githubId = 98980;
    name = "Chmouel Boudjnah";
  };
  chn = {
    name = "Haonan Chen";
    email = "chn@chn.moe";
    matrix = "@chn:chn.moe";
    github = "CHN-beta";
    githubId = 35858462;
  };
  choochootrain = {
    email = "hurshal@imap.cc";
    github = "choochootrain";
+21 −10
Original line number Diff line number Diff line
{ lib, fetchFromGitHub, xorg, libsForQt5, wrapQtAppsHook, python3 }:
{
  lib,
  fetchFromGitHub,
  xorg,
  wrapQtAppsHook,
  python3,
}:

python3.pkgs.buildPythonApplication rec {
  pname = "lenovo-legion-app";
  version = "0.0.12";
  version = "0.0.18";

  src = fetchFromGitHub {
    owner = "johnfanv2";
    repo = "LenovoLegionLinux";
    rev = "v${version}-prerelease";
    hash = "sha256-BNrRv9EBmNINQbAw+BzVxKl/XoDgH1tsNZHJxfSpNoU=";
    rev = "e9c1d8157a7b25e4334d0b1d887338c670e39f6a";
    hash = "sha256-6JYOTDzz9/flyEDQo1UPjWT5+Cuea5fsdbdc6AooDxU=";
  };

  sourceRoot = "${src.name}/python/legion_linux";
@@ -16,22 +22,24 @@ python3.pkgs.buildPythonApplication rec {
  nativeBuildInputs = [ wrapQtAppsHook ];

  propagatedBuildInputs = with python3.pkgs; [
    pyqt5
    pyqt6
    argcomplete
    pyyaml
    darkdetect
    xorg.libxcb
    libsForQt5.qtbase
  ];

  postPatch = ''
    # only fixup application (legion-linux-gui), service (legiond) currently not installed so do not fixup
    # version
    substituteInPlace ./setup.cfg \
      --replace-fail "_VERSION" "${version}"
    substituteInPlace ../../extra/service/fancurve-set \
      --replace-fail "FOLDER=/etc/legion_linux/" "FOLDER=$out/share/legion_linux"

    # /etc
    substituteInPlace ./legion_linux/legion.py \
      --replace-fail "/etc/legion_linux" "$out/share/legion_linux"

    # /usr
    substituteInPlace ./legion_linux/legion_gui.desktop \
      --replace-fail "Icon=/usr/share/pixmaps/legion_logo.png" "Icon=legion_logo"
  '';
@@ -47,8 +55,11 @@ python3.pkgs.buildPythonApplication rec {
    homepage = "https://github.com/johnfanv2/LenovoLegionLinux";
    license = lib.licenses.gpl2Only;
    platforms = lib.platforms.linux;
    maintainers = [ lib.maintainers.ulrikstrid ];
    maintainers = with lib.maintainers; [
      ulrikstrid
      realsnick
      chn
    ];
    mainProgram = "legion_gui";
  };
}