Unverified Commit dda860a8 authored by Aleksana's avatar Aleksana Committed by GitHub
Browse files

better-control: init at 6.11.6 (#408413)

parents 50360eed c399ae31
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -21006,6 +21006,12 @@
    githubId = 807447;
    name = "Robert Scott";
  };
  Rishabh5321 = {
    name = "Rishabh Singh";
    email = "rishabh98818@gmail.com";
    github = "Rishabh5321";
    githubId = 40533251;
  };
  Rishik-Y = {
    name = "Rishik Yalamanchili";
    email = "202301258@daiict.ac.in";
+104 −0
Original line number Diff line number Diff line
{
  lib,
  python3Packages,
  fetchFromGitHub,
  gtk3,
  bash,
  networkmanager,
  bluez,
  brightnessctl,
  power-profiles-daemon,
  gammastep,
  libpulseaudio,
  desktop-file-utils,
  wrapGAppsHook3,
  gobject-introspection,
  upower,
  nix-update-script,
}:

python3Packages.buildPythonApplication rec {
  pname = "better-control";
  version = "v6.11.6";
  pyproject = false;

  src = fetchFromGitHub {
    owner = "quantumvoid0";
    repo = "better-control";
    tag = version;
    hash = "sha256-+2hY+o+GPyJHXpQFVW8BOUEiIBGQ1hItOVpA/AVas2Q=";
  };

  build-system = with python3Packages; [
    setuptools
  ];

  nativeBuildInputs = [
    desktop-file-utils
    wrapGAppsHook3
    gobject-introspection
  ];

  buildInputs = [
    bash
    gtk3
  ];

  # Check src/utils/dependencies.py
  runtimeDeps = [
    libpulseaudio
    networkmanager
    bluez
    brightnessctl
    power-profiles-daemon
    gammastep
    upower
  ];

  dependencies = with python3Packages; [
    pygobject3
    dbus-python
    psutil
    qrcode
    requests
    setproctitle
    pillow
    pycairo
  ];

  makeFlags = [ "PREFIX=${placeholder "out"}" ];

  dontWrapGApps = true;

  makeWrapperArgs = [
    "\${gappsWrapperArgs[@]}"
    "--prefix PATH : ${lib.makeBinPath runtimeDeps}"
  ];

  postInstall = ''
    rm $out/bin/betterctl
    chmod +x $out/share/better-control/better_control.py
    substituteInPlace $out/bin/* \
      --replace-fail "python3 " ""
    substituteInPlace $out/share/applications/better-control.desktop \
      --replace-fail "/usr/bin/" ""
  '';

  # Project has no tests
  doCheck = false;

  postFixup = ''
    wrapPythonProgramsIn "$out/share/better-control" "$out $pythonPath"
  '';

  passthru.updateScript = nix-update-script { };

  meta = {
    description = "Simple control panel for linux based on GTK";
    homepage = "https://github.com/quantumvoid0/better-control";
    license = lib.licenses.gpl3Only;
    maintainers = with lib.maintainers; [ Rishabh5321 ];
    platforms = lib.platforms.linux;
    mainProgram = "control"; # Users use both "control" and "better-control" to launch
  };
}