unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#31178] [PATCH] gnu: Add inxi.
@ 2018-04-16 12:38 Pierre Neidhardt
  2018-04-22 21:42 ` [bug#31176] " Ludovic Courtès
  2018-04-30 13:17 ` Tobias Geerinckx-Rice
  0 siblings, 2 replies; 18+ messages in thread
From: Pierre Neidhardt @ 2018-04-16 12:38 UTC (permalink / raw)
  To: 31178

* 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

^ permalink raw reply related	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2018-05-08 18:12 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-16 12:38 [bug#31178] [PATCH] gnu: Add inxi Pierre Neidhardt
2018-04-22 21:42 ` [bug#31176] " 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

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).