From: Pierre Neidhardt <ambrevar@gmail.com>
To: 31178@debbugs.gnu.org
Subject: [bug#31178] [PATCH] gnu: Add inxi.
Date: Mon, 16 Apr 2018 18:08:30 +0530 [thread overview]
Message-ID: <20180416123830.28716-1-ambrevar@gmail.com> (raw)
* 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
next reply other threads:[~2018-04-16 12:39 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-16 12:38 Pierre Neidhardt [this message]
2018-04-22 21:42 ` [bug#31176] [bug#31178] [PATCH] gnu: Add inxi Ludovic Courtès
2018-04-23 4:33 ` Pierre Neidhardt
2018-04-23 5:23 ` Oleg Pykhalov
2018-04-23 5:34 ` [bug#31176] " Pierre Neidhardt
2018-04-28 21:27 ` Ludovic Courtès
2018-04-29 17:38 ` Oleg Pykhalov
2018-04-30 10:07 ` Ludovic Courtès
2018-04-30 12:31 ` [bug#31176] " Pierre Neidhardt
2018-04-30 19:18 ` Oleg Pykhalov
2018-05-01 7:27 ` [bug#31178] [bug#31176] " Oleg Pykhalov
2018-05-06 9:42 ` Pierre Neidhardt
2018-05-06 13:31 ` Oleg Pykhalov
2018-05-07 10:14 ` Peter Neidhardt
2018-05-07 15:29 ` Oleg Pykhalov
2018-05-07 19:52 ` [bug#31176] " Peter Neidhardt
2018-05-08 18:11 ` [bug#31178] " Oleg Pykhalov
2018-04-30 13:17 ` Tobias Geerinckx-Rice
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180416123830.28716-1-ambrevar@gmail.com \
--to=ambrevar@gmail.com \
--cc=31178@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.