From patchwork Sun Sep 11 19:29:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu X-Patchwork-Id: 42508 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 753F127BBEA; Sun, 11 Sep 2022 20:30:42 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 30C7127BBE9 for ; Sun, 11 Sep 2022 20:30:42 +0100 (BST) Received: from localhost ([::1]:41812 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oXSfB-0004sF-9e for patchwork@mira.cbaines.net; Sun, 11 Sep 2022 15:30:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44414) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oXSeY-0004s5-IY for guix-patches@gnu.org; Sun, 11 Sep 2022 15:30:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:54884) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oXSeY-00043b-9G for guix-patches@gnu.org; Sun, 11 Sep 2022 15:30:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oXSeY-0003Sz-05 for guix-patches@gnu.org; Sun, 11 Sep 2022 15:30:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#57731] [PATCH v4] gnu: Add batsignal. References: <20220911134305.14581-1-matf@disr.it> In-Reply-To: <20220911134305.14581-1-matf@disr.it> Resent-From: M Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 11 Sep 2022 19:30:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57731 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 57731@debbugs.gnu.org Cc: "\(" , M Received: via spool by 57731-submit@debbugs.gnu.org id=B57731.166292456613259 (code B ref 57731); Sun, 11 Sep 2022 19:30:01 +0000 Received: (at 57731) by debbugs.gnu.org; 11 Sep 2022 19:29:26 +0000 Received: from localhost ([127.0.0.1]:43583 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oXSdy-0003Rn-3J for submit@debbugs.gnu.org; Sun, 11 Sep 2022 15:29:26 -0400 Received: from knopi.disroot.org ([178.21.23.139]:59480) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oXSds-0003Rc-VS for 57731@debbugs.gnu.org; Sun, 11 Sep 2022 15:29:24 -0400 Received: from localhost (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id 2E57249FE3; Sun, 11 Sep 2022 21:29:20 +0200 (CEST) X-Virus-Scanned: SPAM Filter at disroot.org Received: from knopi.disroot.org ([127.0.0.1]) by localhost (disroot.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id C9HlKazRVodz; Sun, 11 Sep 2022 21:29:18 +0200 (CEST) From: M DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disr.it; s=mail; t=1662924558; bh=omwSQ82hFluwndpkP4l2ZmV82R03AbQZN0z93BqNLSk=; h=From:To:Cc:Subject:Date; b=tfbOhBfpjcxP4yeLAnci9FjuNj2UZHNYcUPDNWpedEgoOZtohZgk5dwolnQJVj+rr yp6YDC6+kAdZevQJYddPC2Cnu5MQuhRxOVBilgygvytU6HuaZ8ZAVmW0ZG0APB7K75 +N+c1Bw74pdRCFGQoxu51ZuHbhQQcCIGaRHlfTC6Ugin7L24fBa9LBJglXAjsi0w6w nOevHNla5I1Y/1cRqiZRbGUbU0z4T1xyPHrE84jcLctAtG/15Y3ILJbf6zS8RSzIRH 7ttopzYCPHnzeCs0u9JwcMPxuPI8p6u0g8vLEaSejZMOZf7bOG/ppnywrvGneWIgpQ H2iIO9BbnzglQ== Date: Sun, 11 Sep 2022 21:29:05 +0200 Message-Id: <20220911192905.13238-1-matf@disr.it> Mime-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * gnu/packages/monitoring.scm (batsignal): New variable. Co-authored-by: ( --- gnu/packages/monitoring.scm | 43 +++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/gnu/packages/monitoring.scm b/gnu/packages/monitoring.scm index 47845700ee..608973f9c2 100644 --- a/gnu/packages/monitoring.scm +++ b/gnu/packages/monitoring.scm @@ -764,3 +764,46 @@ (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 #:make-flags + #~(list (string-append "PREFIX=" #$output) + (string-append "CC=" #$(cc-for-target))) + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'fix-cross-compile + (lambda _ + (substitute* "Makefile" + (("pkg-config") + #$(pkg-config-for-target))))) + (delete 'configure) + (replace 'check + (lambda* (#:key tests? #:allow-other-keys) + (when tests? + (invoke "./batsignal" "-v"))))))) + (inputs (list libnotify)) + (native-inputs (list pkg-config)) + (home-page "https://github.com/electrickite/batsignal") + (synopsis "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. This can be used to force powering off a +laptop when the battery gets below critical levels, instead of damaging the +battery.") + (license license:isc))) +