unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#59949] [PATCH] gnu: Add power-profiles-daemon
@ 2022-12-10 21:31 florhizome
  2023-01-08 15:05 ` bug#59949: " Ludovic Courtès
  0 siblings, 1 reply; 2+ messages in thread
From: florhizome @ 2022-12-10 21:31 UTC (permalink / raw)
  To: 59949; +Cc: florhizome

From: florhizome <florhizome@posteo.net>

* gnu/packages/freedesktop.scm (power-profiles-daemon): New variable.
---
 gnu/packages/freedesktop.scm | 57 ++++++++++++++++++++++++++++++++++++
 1 file changed, 57 insertions(+)

diff --git a/gnu/packages/freedesktop.scm b/gnu/packages/freedesktop.scm
index 0267d35c9c..d3d66d5209 100644
--- a/gnu/packages/freedesktop.scm
+++ b/gnu/packages/freedesktop.scm
@@ -1121,6 +1121,63 @@ (define-public packagekit
 manager for the current system.")
     (license license:gpl2+)))
 
+(define-public power-profiles-daemon
+ (package
+    (name "power-profiles-daemon")
+    (version "0.12")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://gitlab.freedesktop.org/hadess/power-profiles-daemon")
+             (commit version)))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32
+         "1wqcajbj358zpyj6y4h1v34y2yncq76wqxd0jm431habcly0bqyr"))))
+    (build-system meson-build-system)
+    (arguments
+     (list #:configure-flags #~(list "-Dsystemdsystemunitdir=false")
+           #:glib-or-gtk? #t
+           #:phases
+           #~(modify-phases %standard-phases
+               (add-before 'install 'fake-pkexec
+                 (lambda _ (setenv "PKEXEC_UID" "-1")))
+               (add-before 'configure 'correct-polkit-dir
+                 (lambda _
+                   (substitute* "meson.build"
+                     (("polkit_gobject_dep\\..*")
+                      (string-append "'" #$output "/share/polkit-1/actions'")))))
+               (add-after 'install 'wrap-program
+                 (lambda _
+                   (wrap-program
+                       (string-append #$output "/bin/powerprofilesctl")
+                     `("GUIX_PYTHONPATH" = (,(getenv "GUIX_PYTHONPATH")))
+                     `("GI_TYPELIB_PATH" = (,(getenv "GI_TYPELIB_PATH")))))))))
+    (native-inputs
+     (list `(,glib "bin") gobject-introspection pkg-config python vala))
+    (inputs
+     (list dbus
+           dbus-glib
+           libgudev
+           glib polkit
+           python
+           python-pygobject
+           upower))
+    (home-page "https://gitlab.freedesktop.org/hadess/power-profiles-daemon")
+    (synopsis "Power profile handling over D-Bus")
+    (description "power-profiles-daemon offers to modify system behaviour based
+ upon user-selected power profiles. There are 3 different power profiles, a
+\"balanced\" default mode, a \"power-saver\" mode, as well as a \"performance\"
+ mode. The first 2 of those are available on every system. The  \"performance\"
+ mode is only available on select systems and is implemented by different \"drivers\"
+ based on the system or systems it targets.
+In addition to those 2 or 3 modes (depending on the system), \"actions\" can be hooked
+up to change the behaviour of a particular device. For example, this can be used
+to disable the fast-charging for some USB devices when in power-saver mode.")
+    (license license:gpl3)))
+
+
 (define-public python-libevdev
   (package
     (name "python-libevdev")
-- 
2.38.1





^ permalink raw reply related	[flat|nested] 2+ messages in thread

* bug#59949: [PATCH] gnu: Add power-profiles-daemon
  2022-12-10 21:31 [bug#59949] [PATCH] gnu: Add power-profiles-daemon florhizome
@ 2023-01-08 15:05 ` Ludovic Courtès
  0 siblings, 0 replies; 2+ messages in thread
From: Ludovic Courtès @ 2023-01-08 15:05 UTC (permalink / raw)
  To: florhizome; +Cc: 59949-done

[-- Attachment #1: Type: text/plain, Size: 255 bytes --]

Hi,

florhizome@posteo.net skribis:

> From: florhizome <florhizome@posteo.net>
>
> * gnu/packages/freedesktop.scm (power-profiles-daemon): New variable.

Applied with the changes below to address ‘guix lint’ warnings.

Thanks,
Ludo’.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 2171 bytes --]

diff --git a/gnu/packages/freedesktop.scm b/gnu/packages/freedesktop.scm
index 3077925454..d63fe8f7ca 100644
--- a/gnu/packages/freedesktop.scm
+++ b/gnu/packages/freedesktop.scm
@@ -1061,7 +1061,8 @@ (define-public power-profiles-daemon
     (native-inputs
      (list `(,glib "bin") gobject-introspection pkg-config python vala))
     (inputs
-     (list dbus
+     (list bash-minimal                           ;for 'wrap-program'
+           dbus
            dbus-glib
            libgudev
            glib polkit
@@ -1070,15 +1071,17 @@ (define-public power-profiles-daemon
            upower))
     (home-page "https://gitlab.freedesktop.org/hadess/power-profiles-daemon")
     (synopsis "Power profile handling over D-Bus")
-    (description "power-profiles-daemon offers to modify system behaviour based
- upon user-selected power profiles. There are 3 different power profiles, a
-\"balanced\" default mode, a \"power-saver\" mode, as well as a \"performance\"
- mode. The first 2 of those are available on every system. The  \"performance\"
- mode is only available on select systems and is implemented by different \"drivers\"
- based on the system or systems it targets.
-In addition to those 2 or 3 modes (depending on the system), \"actions\" can be hooked
-up to change the behaviour of a particular device. For example, this can be used
-to disable the fast-charging for some USB devices when in power-saver mode.")
+    (description
+     "power-profiles-daemon offers to modify system behaviour based upon
+user-selected power profiles.  There are 3 different power profiles, a
+\"balanced\" default mode, a \"power-saver\" mode, as well as a
+\"performance\" mode.  The first 2 of those are available on every system.
+The \"performance\" mode is only available on select systems and is
+implemented by different \"drivers\" based on the system or systems it
+targets.  In addition to those 2 or 3 modes (depending on the system),
+\"actions\" can be hooked up to change the behaviour of a particular device.
+For example, this can be used to disable the fast-charging for some USB
+devices when in power-saver mode.")
     (license license:gpl3)))
 
 

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-01-08 15:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-10 21:31 [bug#59949] [PATCH] gnu: Add power-profiles-daemon florhizome
2023-01-08 15:05 ` bug#59949: " Ludovic Courtès

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).