diff mbox series

[bug#57731,1/1] gnu: Add batsignal.

Message ID 20220911134734.16642-1-matf@disr.it
State Accepted
Headers show
Series Add batsignal package | expand

Checks

Context Check Description
cbaines/comparison success View comparision
cbaines/git-branch success View Git branch
cbaines/applying patch success View Laminar job
cbaines/issue success View issue

Commit Message

Mathieu Sept. 11, 2022, 1:47 p.m. UTC
* gnu/packages/monitoring.scm (batsignal): New variable.
---
 gnu/packages/monitoring.scm | 34 ++++++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)

Comments

Liliana Marie Prikler Sept. 11, 2022, 2:02 p.m. UTC | #1
Hi

Am Sonntag, dem 11.09.2022 um 15:47 +0200 schrieb M:
> * gnu/packages/monitoring.scm (batsignal): New variable.
> ---
>  gnu/packages/monitoring.scm | 34 ++++++++++++++++++++++++++++++++++
>  1 file changed, 34 insertions(+)
> 
> diff --git a/gnu/packages/monitoring.scm
> b/gnu/packages/monitoring.scm
> index 47845700ee..bccf03ae06 100644
> --- a/gnu/packages/monitoring.scm
> +++ b/gnu/packages/monitoring.scm
> @@ -12,6 +12,8 @@
>  ;;; Copyright © 2021 Raphaël Mélotte <raphael.melotte@mind.be>
>  ;;; Copyright © 2022 Paul A. Patience <paul@apatience.com>
>  ;;; Copyright © 2022 Hartmut Goebel <h.goebel@crazy-compilers.com>
> +;;; Copyright © 2022 ( <paren@disroot.org>
> +;;; Copyright © 2022 Mathieu Laparie <mlaparie@disr.it>
Did you two co-author the patch?  If so, add a "Co-authored-by" trailer
to the commit message.  Also, your copyright mail does not match the
sender, you may want to fix that.
>  ;;;
>  ;;; This file is part of GNU Guix.
>  ;;;
> @@ -50,6 +52,7 @@ (define-module (gnu packages monitoring)
>    #:use-module (gnu packages django)
>    #:use-module (gnu packages gd)
>    #:use-module (gnu packages gettext)
> +  #:use-module (gnu packages gnome)
>    #:use-module (gnu packages image)
>    #:use-module (gnu packages mail)
>    #:use-module (gnu packages ncurses)
> @@ -764,3 +767,34 @@ (define-public python-statsd
>      (description "StatsD is a friendly front-end to Graphite.  This
> package
>  provides a simple Python client for the StatsD daemon.")
>      (license license:expat)))
> +
> +(define-public batsignal
> +  (package
> +    (name "batsignal")
> +    (version "1.6.0")
> +    (source (origin
> +              (method git-fetch)
> +              (uri (git-reference
> +                    (url
> "https://github.com/electrickite/batsignal")
> +                    (commit version)))
> +              (file-name (git-file-name name version))
> +              (sha256
> +               (base32
> +               
> "0b1j6mljnqgxwr3id3r9shzhsjk5r0qdh9cxkvy1dm4kzbyc4dxq"))))
> +    (build-system gnu-build-system)
> +    (arguments
> +     (list #:tests? #f ;; batsignal's tests depend on docker
The test appears to be running "batsignal -v", which we could do in the
build container as well.
> +           #:phases
> +           #~(modify-phases %standard-phases (delete 'configure))
By convention #:phases is the last argument to set.
> +           #:make-flags
> +           #~(list (string-append "PREFIX=" #$output)
> +                   (string-append "CC=" #$(cc-for-target)))))
> +    (inputs (list libnotify))
> +    (native-inputs (list pkg-config))
> +    (home-page "https://github.com/electrickite/batsignal")
> +    (synopsis "Simple power monitoring tool")
"Power monitoring tool"
> +    (description
> +     "This package provides a daemon that monitors device power
> +levels, notifying the user and optionally running a command when
> +it reaches user-configured power thresholds.")
> +    (license license:isc)))
Cheers.
M Sept. 11, 2022, 2:31 p.m. UTC | #2
On 11-09-2022 15:47, M wrote:
> +    (arguments
> +     (list #:tests? #f ;; batsignal's tests depend on docker
> +           #:phases
> +           #~(modify-phases %standard-phases (delete 'configure))
> +           #:make-flags
> +           #~(list (string-append "PREFIX=" #$output)
> +                   (string-append "CC=" #$(cc-for-target)))))
> +    (inputs (list libnotify))

The makefile uses pkg-config.  However, when cross-compiling,
TARGET-pkg-config is required instead.  To solve this, you will need to 
'substitute*' pkg-config to #$(pkg-config-for-target).  For an example, 
see opensmtpd-filter-dkimsign.

(Unfortunately the dependency libtirpc is not yet cross-compilable ...)

Greetings,
Maxime.
diff mbox series

Patch

diff --git a/gnu/packages/monitoring.scm b/gnu/packages/monitoring.scm
index 47845700ee..bccf03ae06 100644
--- a/gnu/packages/monitoring.scm
+++ b/gnu/packages/monitoring.scm
@@ -12,6 +12,8 @@ 
 ;;; Copyright © 2021 Raphaël Mélotte <raphael.melotte@mind.be>
 ;;; Copyright © 2022 Paul A. Patience <paul@apatience.com>
 ;;; Copyright © 2022 Hartmut Goebel <h.goebel@crazy-compilers.com>
+;;; Copyright © 2022 ( <paren@disroot.org>
+;;; Copyright © 2022 Mathieu Laparie <mlaparie@disr.it>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -50,6 +52,7 @@  (define-module (gnu packages monitoring)
   #:use-module (gnu packages django)
   #:use-module (gnu packages gd)
   #:use-module (gnu packages gettext)
+  #:use-module (gnu packages gnome)
   #:use-module (gnu packages image)
   #:use-module (gnu packages mail)
   #:use-module (gnu packages ncurses)
@@ -764,3 +767,34 @@  (define-public python-statsd
     (description "StatsD is a friendly front-end to Graphite.  This package
 provides a simple Python client for the StatsD daemon.")
     (license license:expat)))
+
+(define-public batsignal
+  (package
+    (name "batsignal")
+    (version "1.6.0")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/electrickite/batsignal")
+                    (commit version)))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "0b1j6mljnqgxwr3id3r9shzhsjk5r0qdh9cxkvy1dm4kzbyc4dxq"))))
+    (build-system gnu-build-system)
+    (arguments
+     (list #:tests? #f ;; batsignal's tests depend on docker
+           #:phases
+           #~(modify-phases %standard-phases (delete 'configure))
+           #:make-flags
+           #~(list (string-append "PREFIX=" #$output)
+                   (string-append "CC=" #$(cc-for-target)))))
+    (inputs (list libnotify))
+    (native-inputs (list pkg-config))
+    (home-page "https://github.com/electrickite/batsignal")
+    (synopsis "Simple power monitoring tool")
+    (description
+     "This package provides a daemon that monitors device power
+levels, notifying the user and optionally running a command when
+it reaches user-configured power thresholds.")
+    (license license:isc)))