From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49634) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f83PW-0000Ua-Jd for guix-patches@gnu.org; Mon, 16 Apr 2018 08:39:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f83PS-0008UU-EI for guix-patches@gnu.org; Mon, 16 Apr 2018 08:39:06 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:47242) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f83PS-0008UM-8u for guix-patches@gnu.org; Mon, 16 Apr 2018 08:39:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1f83PS-0008Ex-33 for guix-patches@gnu.org; Mon, 16 Apr 2018 08:39:02 -0400 Subject: [bug#31178] [PATCH] gnu: Add inxi. Resent-Message-ID: Received: from eggs.gnu.org ([2001:4830:134:3::10]:49378) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f83PA-0000Eb-TP for guix-patches@gnu.org; Mon, 16 Apr 2018 08:38:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f83P6-0008KW-Pf for guix-patches@gnu.org; Mon, 16 Apr 2018 08:38:44 -0400 Received: from mail-pl0-x244.google.com ([2607:f8b0:400e:c01::244]:45441) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f83P6-0008K5-HF for guix-patches@gnu.org; Mon, 16 Apr 2018 08:38:40 -0400 Received: by mail-pl0-x244.google.com with SMTP id k9-v6so5182549pll.12 for ; Mon, 16 Apr 2018 05:38:40 -0700 (PDT) Received: from localhost.localdomain ([103.61.255.46]) by smtp.gmail.com with ESMTPSA id 186sm24342267pfe.109.2018.04.16.05.38.38 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 16 Apr 2018 05:38:39 -0700 (PDT) From: Pierre Neidhardt Date: Mon, 16 Apr 2018 18:08:30 +0530 Message-Id: <20180416123830.28716-1-ambrevar@gmail.com> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: 31178@debbugs.gnu.org * gnu/packages/admin.scm (inxi): New variable. --- gnu/packages/admin.scm | 92 +++++++++++++++++++++++++++- gnu/packages/patches/inxi-path.patch | 13 ++++ 2 files changed, 104 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/inxi-path.patch diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm index 6a7bed389..811e3d4cf 100644 --- a/gnu/packages/admin.scm +++ b/gnu/packages/admin.scm @@ -67,6 +67,7 @@ #:use-module (gnu packages gnupg) #:use-module (gnu packages bison) #:use-module (gnu packages flex) + #:use-module (gnu packages gl) #:use-module (gnu packages glib) #:use-module (gnu packages openldap) #:use-module (gnu packages mcrypt) @@ -90,7 +91,10 @@ #:use-module (gnu packages gnome) #:use-module (gnu packages kerberos) #:use-module (gnu packages gtk) - #:use-module (gnu packages xml)) + #:use-module (gnu packages xml) + #:use-module (gnu packages curl) + #:use-module (gnu packages file) + #:use-module (gnu packages web)) (define-public aide (package @@ -2505,3 +2509,89 @@ printed instead of after the entire file has been read, which is often too late.") (home-page "https://jwilk.net/software/hungrycat") (license license:expat))) + +(define-public inxi-minimal + (let ((version "3.0.04-1") + (real-name "inxi")) + (package + (name "inxi-minimal") + (version version) + (source + (origin + (method url-fetch) + (uri (string-append "https://github.com/smxi/inxi" + "/archive/" version "/inxi.tar.gz")) + (file-name (string-append real-name "-" version ".tar.gz")) + (sha256 + (base32 + "14zxdsjgh9dbijmpp0hhvg2yiqqfwnqgcc6x8dpl1v15z1h1r7pc")))) + (build-system trivial-build-system) + (inputs + `(("perl" ,perl))) + (native-inputs `(("tar" ,tar) + ("gzip" ,gzip))) + (arguments + `(#:modules + ((guix build utils)) + #:builder + (begin + (use-modules (guix build utils)) + (setenv "PATH" (string-append + (assoc-ref %build-inputs "tar") "/bin" ":" + (assoc-ref %build-inputs "gzip") "/bin")) + (system* "tar" "xvf" (assoc-ref %build-inputs "source")) + (with-directory-excursion ,(string-append real-name "-" version) + (with-fluids ((%default-port-encoding #f)) + (substitute* "inxi" + (("/usr/bin/env perl") + (string-append (assoc-ref %build-inputs "perl") "/bin/perl")))) + (install-file "inxi" (string-append %output "/bin")) + (system* "gzip" "inxi.1") + (install-file "inxi.1.gz" + (string-append %output "/share/doc/man/man1"))) + #t))) + (home-page "https://smxi.org/docs/inxi.htm") + (synopsis "Script to get system information") + (description + "This package provides a script to get system information.") + (license license:gpl3+)))) + +(define-public inxi + ;; Use `inxi --recommends` for a check list of all the external programs + ;; it can use. + ;; TODO: Include additional inputs once their corresponding packages is no + ;; longer missing: hddtemp, dig (from dnsutils), perl-xml-dumper. ipmitool + ;; and ipmi-sensors. + (package + (inherit inxi-minimal) + (name "inxi") + (propagated-inputs + `(("coreutils" ,coreutils) ; uptime + ("curl" ,curl) ; only if dig is missing. + ("dmidecode" ,dmidecode) + ;; ("fdisk" ,fdisk) ; only as fallback, but not sure for what + ("file" ,file) + ("gzip" ,gzip) + ("iproute2" ,iproute) ; ip + ("kmod" ,kmod) ; modinfo + ("lm-sensors" ,lm-sensors) + ("mesa-utils" ,mesa-utils) + ("pciutils" ,pciutils) + ("perl-cpanel-json-xs" ,perl-cpanel-json-xs) + ("perl-http-tiny" ,perl-http-tiny) + ("perl-io-socket-ssl" ,perl-io-socket-ssl) + ("perl-json-xs" ,perl-json-xs) + ("perl-time-hires" ,perl-time-hires) + ("procps" ,procps) + ("tar" ,tar) + ("tree" ,tree) + ("util-linux" ,util-linux) ; lsblk, lsusb, etc. + ;; ("wget" ,wget) ; only if dig and curl are missing. + ("wmctrl" ,wmctrl) + ("xdpyinfo" ,xdpyinfo) + ("xprop" ,xprop) + ("xrandr" ,xrandr))) + (synopsis "Script to get system information") + (description + "This package provides a script to get system information.") + (license license:gpl3+))) diff --git a/gnu/packages/patches/inxi-path.patch b/gnu/packages/patches/inxi-path.patch new file mode 100644 index 000000000..3f0d846bd --- /dev/null +++ b/gnu/packages/patches/inxi-path.patch @@ -0,0 +1,13 @@ +Use dynamic PATH. + +--- a/inxi ++++ b/inxi +@@ -75,5 +75,5 @@ my ($b_sysctl_disk,$b_update,$b_weather) = (1,1,1); + ## System + my ($bsd_type,$language,$os) = ('','',''); + my ($cpu_sleep,$dl_timeout,$limit,$ps_count,$usb_level) = (0.35,4,10,5,0); +-my @paths = qw(/sbin /bin /usr/sbin /usr/bin /usr/local/sbin /usr/local/bin /usr/X11R6/bin); ++my @paths = split /:/, $ENV{'PATH'}; + my $sensors_cpu_nu = 0; + + ## Tools -- 2.17.0