From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36347) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fDEKI-0006ci-AJ for guix-patches@gnu.org; Mon, 30 Apr 2018 15:19:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fDEKE-0002Eq-Nx for guix-patches@gnu.org; Mon, 30 Apr 2018 15:19:06 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:36334) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fDEKE-0002EU-Jr for guix-patches@gnu.org; Mon, 30 Apr 2018 15:19:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fDEKE-0006Tx-Dd for guix-patches@gnu.org; Mon, 30 Apr 2018 15:19:02 -0400 Subject: [bug#31178] [PATCH] gnu: Add inxi. Resent-Message-ID: From: Oleg Pykhalov References: <20180416123830.28716-1-ambrevar@gmail.com> <87r2n6gbpg.fsf@gnu.org> <87sh7mr17w.fsf@gmail.com> <87in8ifqdc.fsf@gmail.com> <87r2n6qydr.fsf@gmail.com> <87po2j81jn.fsf@gnu.org> <8736zd7w0s.fsf@gmail.com> <877eop0zzn.fsf@gnu.org> <87sh7c7u4w.fsf@gmail.com> Date: Mon, 30 Apr 2018 22:18:13 +0300 In-Reply-To: <87sh7c7u4w.fsf@gmail.com> (Pierre Neidhardt's message of "Mon, 30 Apr 2018 18:01:43 +0530") Message-ID: <874ljstsei.fsf@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" 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: Pierre Neidhardt Cc: 31178@debbugs.gnu.org, 31176@debbugs.gnu.org --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hello Pierre, Pierre Neidhardt writes: > Oleg, if I understood correctly, your concern was about inputs. > To re-quote myself: > >> If I understand correctly, relying on native-inputs would mean that if t= he user >> runs `guix gc`, then all of inxi "optional" dependencies would go. >> Is this correct? All =E2=80=9Creferences=E2=80=9D should survive =E2=80=98guix gc=E2=80=99: =2D-8<---------------cut here---------------start------------->8--- guix gc --references $(env GUIX_PACKAGE_PATH=3D guix build --no-grafts inxi) =2D-8<---------------cut here---------------end--------------->8--- > What's your take on inputs then? If there is anything else, please go > ahead, I can try to address those issues. OK, here is a new recipe, which works even in a container (unlike old =E2=80=98inxi=E2=80=99 which is a Shell script and not Perl). =2D-8<---------------cut here---------------start------------->8--- ~/src/guix/pre-inst-env env GUIX_PACKAGE_PATH=3D guix environment --no-graf= ts --container --ad-hoc inxi =2D-8<---------------cut here---------------end--------------->8--- I've succeeded to test it by invoking =E2=80=98inxi=E2=80=99 and =E2=80=98i= nxi --full=E2=80=99, but please test it more for your use cases. --=-=-= Content-Type: text/x-patch; charset=utf-8 Content-Disposition: attachment; filename=0001-gnu-Add-inxi.patch Content-Transfer-Encoding: quoted-printable Content-Description: gnu: Add inxi. From=2049afb43e03b1de34741c0812cc45fe48c06c404b Mon Sep 17 00:00:00 2001 From: Pierre Neidhardt Date: Mon, 16 Apr 2018 18:08:30 +0530 Subject: [PATCH] gnu: Add inxi. * gnu/packages/admin.scm (inxi): New variable. =2D-- gnu/packages/admin.scm | 115 +++++++++++++++++- .../patches/inxi-minimal-fix-syntax.patch | 18 +++ 2 files changed, 132 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/inxi-minimal-fix-syntax.patch diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm index 5e2cf2d7a..7081f7f08 100644 =2D-- a/gnu/packages/admin.scm +++ b/gnu/packages/admin.scm @@ -50,8 +50,11 @@ #:use-module (guix build-system trivial) #:use-module (gnu packages) #:use-module (gnu packages base) + #:use-module (gnu packages bash) #:use-module (gnu packages check) #:use-module (gnu packages cyrus-sasl) + #:use-module (gnu packages dns) + #:use-module (gnu packages file) #:use-module (gnu packages ncurses) #:use-module (gnu packages readline) #:use-module (gnu packages linux) @@ -70,6 +73,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) @@ -97,7 +101,8 @@ #:use-module (gnu packages xml) #:use-module (gnu packages boost) #:use-module (gnu packages elf) =2D #:use-module (gnu packages mpi)) + #:use-module (gnu packages mpi) + #:use-module (gnu packages web)) =20 (define-public aide (package @@ -2649,3 +2654,111 @@ Python loading in HPC environments.") ;; This package supports x86_64 and PowerPC64 (supported-systems '("x86_64-linux")) (license license:lgpl2.1))) + +(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")) + (patches (search-patches "inxi-minimal-fix-syntax.patch")))) + (build-system trivial-build-system) + (inputs + `(("bash" ,bash) + ("perl" ,perl))) + (native-inputs + `(("gzip" ,gzip) + ("tar" ,tar) + ("xz" ,xz))) + (arguments + `(#:modules + ((guix build utils) + (ice-9 match) + (srfi srfi-26)) + #:builder + (begin + (use-modules (guix build utils) + (ice-9 match) + (srfi srfi-26)) + (setenv "PATH" (string-append + (assoc-ref %build-inputs "bash") "/bin" ":" + (assoc-ref %build-inputs "gzip") "/bin" ":" + (assoc-ref %build-inputs "perl") "/bin" ":" + (assoc-ref %build-inputs "tar") "/bin" ":" + (assoc-ref %build-inputs "xz") "/bin")) + (invoke "tar" "xvf" (assoc-ref %build-inputs "source")) + (with-directory-excursion ,(string-append real-name "-" version) + (substitute* "inxi" (("/usr/bin/env perl") (which "perl"))) + (let ((bin (string-append %output "/bin"))) + (install-file "inxi" bin) + (wrap-program (string-append bin "/inxi") + `("PATH" ":" =3D + ("$PATH" + ,@(map (lambda (input) + (string-append (match input + ((name . store) store)) + "/bin")) + %build-inputs))) + `("PERL5LIB" ":" =3D + ,(delete + "" + (map (match-lambda + (((? (cut string-prefix? "perl-" <>) name) . d= ir) + (string-append dir "/lib/perl5/site_perl")) + (_ "")) + %build-inputs))))) + (invoke "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 "Full featured system information script") + (description "Inxi is a system information script that can display +various things about your hardware and software to users in an IRC chatroo= m or +support forum. It runs with the /exec command in most IRC clients. ") + (license license:gpl3+)))) + +(define-public inxi + (package + (inherit inxi-minimal) + (name "inxi") + (inputs + `(("dmidecode" ,dmidecode) + ("file" ,file) + ("bind:utils" ,isc-bind "utils") ; dig + ("gzip" ,gzip) + ("iproute2" ,iproute) ; ip + ("kmod" ,kmod) ; modinfo + ("lm-sensors" ,lm-sensors) + ("mesa-utils" ,mesa-utils) + ("pciutils" ,pciutils) + ("procps" ,procps) + ("tar" ,tar) + ("tree" ,tree) + ("util-linux" ,util-linux) ; lsblk, lsusb, etc. + ("wmctrl" ,wmctrl) + ("xdpyinfo" ,xdpyinfo) + ("xprop" ,xprop) + ("xrandr" ,xrandr) + ("coreutils" ,coreutils) ; uptime + ;; TODO: Add more inputs: + ;; ipmi-sensors + ;; hddtemp + ;; perl-xml-dumper + ;; ipmitool + ,@(package-inputs inxi-minimal))) + (propagated-inputs + `(("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))))) diff --git a/gnu/packages/patches/inxi-minimal-fix-syntax.patch b/gnu/packa= ges/patches/inxi-minimal-fix-syntax.patch new file mode 100644 index 000000000..ca5cde328 =2D-- /dev/null +++ b/gnu/packages/patches/inxi-minimal-fix-syntax.patch @@ -0,0 +1,18 @@ +Copyright =C2=A9 2018 Oleg Pykhalov + +This patch fixes =E2=80=9CQuantifier follows nothing in regex=E2=80=9D err= or. + +--- a/inxi 2018-04-30 20:51:47.665352075 +0300 ++++ b/inxi 2018-04-30 20:52:21.721804635 +0300 +@@ -4602,11 +4602,6 @@ + sub cleaner { + my ($item) =3D @_; + return $item if !$item;# handle cases where it was 0 or '' +- $item =3D~ s/chipset|components|computing|computer|corporation|communica= tions|electronics|electrical|electric|gmbh|group|incorporation|industrial|i= nternational|nee|revision|semiconductor|software|technologies|technology|lt= d\.||\bltd\b|inc\.||\binc\b|intl\.|co\.||corp\.||\(tm\)= |\(r\)|=C2=AE|\(rev ..\)|\'|\"|\sinc\s*$|\?//gi; +- $item =3D~ s/,|\*/ /g; +- $item =3D~ s/\s\s+/ /g; +- $item =3D~ s/^\s+|\s+$//g; +- return $item; + } +=20 + sub dmi_cleaner { =2D-=20 2.17.0 --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable [=E2=80=A6] > I think it's better to have a package that behaves well in the general > case than not having a package at all. I agree. We have an old =E2=80=98inxi=E2=80=99 (Shell script version), whi= ch should not produce collisions because of unnecessary =E2=80=98propagated-inputs=E2=80= =99. Oleg. --=-=-=-- --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEc+OyAXw1EaDPCmAPckbhHGm3lWkFAlrna/UACgkQckbhHGm3 lWmdExAAu6uyv+wcBAJ7HKWUl97xT1a1k8dF2Y9OfslckSYFeTEs4ZsZ9Kke3fld dM0FxCK8rMQkNc2agtbakEoq1rH3lCB+VMdDCnN9pX1xyUrnZRGkEnlsLuZCuvAS IKah2r56O1r5cugsOI9/diWFVFZEUWwaGyldf5tQtxSx8WJA0kHgdqs5Owu5tcj6 sbtPqYJhgKyomZY+7kDo0BjJFoyu3pbFbGbPnGrVwWQWmF8D5Zk1VhkWm3gU5KP+ SmNiKn5JD4Qw1arUS+rOUO5lvp5ZvwBMj2Lzwxr4oyKTLbg0OKsb5zudx/fmyGAh eMERxQOa1Z2NZrTMqM+SZz01Rb9xMz/XBlo6FFgiUk7xti7ERckadcfu4sm6YgPH 598lThViRULCaznnb9ZUXwI8575On+S4LdQ2cnNkJ9Y95o6mmPzBRV8yRVJmE4E5 XIl9pc4+fvKLL1ppR+t1bax0kZFX0eWl+oMYXMlcR/03chn34JN3ZOCC1seo9cj0 P+aqt+L4Vg/jb2eAtn6ZrL4q64zXpijd+3ZcOOR+mEz8PT9U6giKZ1HlcRHJN2/f ydXJ5s2nWAq7HnMTl9cp50oMHexQC9flFr78hD0YQfuFFlrrUryLhYw4fzH7T9MF Dh3tGbUI8UQkLTsuz+tTnfeNtSSv+18gkxPJXpUDrr7k6NH3msU= =hNCP -----END PGP SIGNATURE----- --==-=-=--