;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2016 Chris Marusich ;;; Copyright © 2018, 2020, 2021 Tobias Geerinckx-Rice ;;; Copyright © 2021 Noisytoot ;;; ;;; This file is part of GNU Guix. ;;; ;;; GNU Guix is free software; you can redistribute it and/or modify it ;;; under the terms of the GNU General Public License as published by ;;; the Free Software Foundation; either version 3 of the License, or (at ;;; your option) any later version. ;;; ;;; GNU Guix is distributed in the hope that it will be useful, but ;;; WITHOUT ANY WARRANTY; without even the implied warranty of ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;;; GNU General Public License for more details. ;;; ;;; You should have received a copy of the GNU General Public License ;;; along with GNU Guix. If not, see . (define-module (gnu packages scsi) #:use-module ((guix licenses) #:prefix license:) #:use-module (guix packages) #:use-module (guix download) #:use-module (guix git-download) #:use-module (guix build-system gnu) #:use-module (gnu packages autotools)) (define-public sg3-utils (package (name "sg3-utils") (version "1.48") (source (origin (method url-fetch) (uri (string-append "https://sg.danny.cz/sg/p/sg3_utils-" version ".tar.xz")) (sha256 (base32 "1ynv6kijzjj8xab3z87nks26qcrpvg46mhlr3s6yah6mj0ba9ffn")))) (build-system gnu-build-system) (arguments `(#:configure-flags (list "--disable-static"))) (home-page "https://sg.danny.cz/sg/sg3_utils.html") (synopsis "SCSI device utilities") (description "sg3-utils is a collection of utilities for devices that use the Small Computer System Interface (@dfn{SCSI}) command set. It includes utilities to read data from, write data;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2021, 2022 Maxim Cournoyer <maxim.cournoyer@gmail.com> ;;; ;;; This file is part of GNU Guix. ;;; ;;; GNU Guix is free software; you can redistribute it and/or modify it ;;; under the terms of the GNU General Public License as published by ;;; the Free Software Foundation; either version 3 of the License, or (at ;;; your option) any later version. ;;; ;;; GNU Guix is distributed in the hope that it will be useful, but ;;; WITHOUT ANY WARRANTY; without even the implied warranty of ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;;; GNU General Public License for more details. ;;; ;;; You should have received a copy of the GNU General Public License ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. ;;; Commentary: ;;; ;;; This module contains procedures to interact with D-Bus via the 'dbus-send' ;;; command line utility. Before using any public procedure ;;; ;;; Code: (define-module (gnu build dbus-service) #:use-module (ice-9 match) #:use-module (srfi srfi-1) #:use-module (srfi srfi-19) #:use-module (srfi srfi-26) #:autoload (d-bus protocol connections) (d-bus-conn? d-bus-conn-flush d-bus-connect d-bus-disconnect d-bus-session-bus-address d-bus-system-bus-address) #:autoload (d-bus protocol messages) (MESSAGE_TYPE_METHOD_CALL d-bus-headers-ref d-bus-message-body d-bus-message-headers d-bus-read-message d-bus-write-message header-PATH header-DESTINATION header-INTERFACE header-MEMBER header-SIGNATURE make-d-bus-message) #:export (%dbus-query-timeout initialize-dbus-connection! %current-dbus-connection send-dbus call-dbus-method dbus-available-services dbus-service-available? with-retries)) (define %dbus-query-timeout 2) ;in seconds ;;; Use Fibers' sleep to enable cooperative scheduling in Shepherd >= 0.9.0, ;;; which is required at least for the Jami service. (define sleep* (lambda () ;delay execution (if (resolve-module '(fibers) #f #:ensure #f) (module-ref (resolve-interface '(fibers)) 'sleep) (begin (format #t "Fibers not available -- blocking 'sleep' in use~%") sleep)))) ;;; ;;; Utilities. ;;; (define-syntax-rule (with-retries n delay body ...) "Retry the code in BODY