From 4dcd08c9d4c84e2f5d94bc0344bdfd55f876ce0e Mon Sep 17 00:00:00 2001 From: éclairevoyant <848000+eclairevoyant@users.noreply.github.com> Date: Wed, 17 Apr 2024 14:06:51 +0000 Subject: plasmahud: fix runtime errors and other cleanup (#271479) * plasma-hud: fix runtime errors * plasma-hud: clean up installPhase * plasma-hud: fix scoping for `propagatedBuildInputs` * plasma-hud: formatting * plasma-hud: clean up src * plasma-hud: remove `with lib;` * plasma-hud: fix potential splicing issue (see #211340) --- pkgs/misc/plasma-hud/default.nix | 48 +++++++++++++++++++++++++--------------- 1 file changed, 30 insertions(+), 18 deletions(-) diff --git a/pkgs/misc/plasma-hud/default.nix b/pkgs/misc/plasma-hud/default.nix index c0cf771da8499..b0adf0e1efc69 100644 --- a/pkgs/misc/plasma-hud/default.nix +++ b/pkgs/misc/plasma-hud/default.nix @@ -1,42 +1,54 @@ -{ lib, python3, fetchFromGitHub, rofi, gobject-introspection }: +{ wrapGAppsHook +, lib +, python3Packages +, fetchFromGitHub +, rofi +, gobject-introspection +}: -python3.pkgs.buildPythonApplication rec{ +python3Packages.buildPythonApplication rec { pname = "plasma-hud"; version = "19.10.1"; + format = "other"; src = fetchFromGitHub { owner = "Zren"; - repo = pname; + repo = "plasma-hud"; rev = version; - sha256 = "19vlc156jfdamw7q1pc78fmlf0h3sff5ar3di9j316vbb60js16l"; + hash = "sha256-1AQtgVlrmzBkim1kVZzTAwJHq0OH3YAPr6o5aUpgdKc="; }; - propagatedBuildInputs = with python3.pkgs; [ - rofi + nativeBuildInputs = [ + gobject-introspection + wrapGAppsHook + ]; + + propagatedBuildInputs = (with python3Packages; [ dbus-python + pygobject3 setproctitle xlib - pygobject3 - gobject-introspection - ]; - format = "other"; + ]) ++ [ rofi ]; + postPatch = '' sed -i "s:/usr/lib/plasma-hud:$out/bin:" etc/xdg/autostart/plasma-hud.desktop ''; installPhase = '' - patchShebangs $out/bin/plasma-hud - mkdir -p $out/bin $out/etc/xdg/autostart - cp -r $src/usr/lib/plasma-hud/plasma-hud $out/bin/plasma-hud - cp -r $src/etc $out/etc + runHook preInstall + + install -Dm555 usr/lib/plasma-hud/plasma-hud -t $out/bin + cp -r etc -t $out + + runHook postInstall ''; - meta = with lib;{ - license = licenses.gpl2Only; + meta = { + license = lib.licenses.gpl2Only; homepage = "https://github.com/Zren/plasma-hud"; - platforms = platforms.unix; + platforms = lib.platforms.unix; description = "Run menubar commands, much like the Unity 7 Heads-Up Display (HUD)"; - maintainers = with maintainers; [ pasqui23 ]; + maintainers = with lib.maintainers; [ pasqui23 ]; mainProgram = "plasma-hud"; }; } -- cgit 1.4.1