guix-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug#31176] [bug#31178] [PATCH] gnu: Add inxi.


From: Oleg Pykhalov
Subject: [bug#31176] [bug#31178] [PATCH] gnu: Add inxi.
Date: Sun, 06 May 2018 16:31:08 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux)

Hello Pierre,

Pierre Neidhardt <address@hidden> writes:

> Oleg Pykhalov <address@hidden> writes:
>
>>>> If I understand correctly, relying on native-inputs would mean that if the 
>>>> user
>>>> runs `guix gc`, then all of inxi "optional" dependencies would go.
>>>> Is this correct?
>>
>> All “references” should survive ‘guix gc’:
>> --8<---------------cut here---------------start------------->8---
>> guix gc --references $(env GUIX_PACKAGE_PATH= guix build --no-grafts inxi)
>> --8<---------------cut here---------------end--------------->8---
>
> OK, so if I understand correctly, only native-inputs get
> garbage-collected, right?

Not quite, missing inputs (*not only* ‘(native-inputs …)’) in the output
of mentioned ‘guix gc’ command get garbage-collected.

Also a good test for missing run-time dependencies is a ‘guix
environment --no-grafts --container --ad-hoc PACKAGE’ command.

[…]

> See comments on patch below:
>
>> From 49afb43e03b1de34741c0812cc45fe48c06c404b Mon Sep 17 00:00:00 2001
>> From: Pierre Neidhardt <address@hidden>
>> Date: Mon, 16 Apr 2018 18:08:30 +0530
>> Subject: [PATCH] gnu: Add inxi.
>>
>> * gnu/packages/admin.scm (inxi): New variable.
>> ---
>>  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
>> --- a/gnu/packages/admin.scm
>> +++ b/gnu/packages/admin.scm

[…]

>> +               (wrap-program (string-append bin "/inxi")
>> +                 `("PATH" ":" =
>> +                   ("$PATH"
>> +                    ,@(map (lambda (input)
>> +                             (string-append (match input
>> +                                              ((name . store) store))
>> +                                            "/bin"))
>> +                           %build-inputs)))
>> +                 `("PERL5LIB" ":" =
>> +                   ,(delete
>> +                     ""
>> +                     (map (match-lambda
>> +                            (((? (cut string-prefix? "perl-" <>) name) . 
>> dir)
>> +                             (string-append dir "/lib/perl5/site_perl"))
>> +                            (_ ""))
>> +                          %build-inputs)))))
>
> I'm not too familiar with Perl, so can you explain why you need to tweak
> PERL5LIB?
> Is it the same as PATH but for perl-cpanel-json-xs, etc.?

I cannot say PERL5LIB is the same as PATH, because PATH is for
executables, but I could lie PERL5LIB is the same in ‘inxi’ case.
Because of ‘inxi’ is Perl program, it requires to find run-time
libraries with a help of PERL5LIB.  As you could see ‘inxi --recommends’
will complain about missing Perl libraries without PERL5LIB.

> If so, why are the perl plugins propagated-inputs and not just inputs?

Good catch.  Yes, we could have Perl packages in ‘propagated-inputs’.

[…]

>> +      (description "Inxi is a system information script that can display
>> +various things about your hardware and software to users in an IRC chatroom 
>> or
>> +support forum.  It runs with the /exec command in most IRC clients. ")
>
> Spurious trailing space.

Oh, thanks.

Hm, ‘guix lint’ was quite.  Probably a possible place for improvements.

[…]

>> diff --git a/gnu/packages/patches/inxi-minimal-fix-syntax.patch
>> b/gnu/packages/patches/inxi-minimal-fix-syntax.patch
>> new file mode 100644
>> index 000000000..ca5cde328
>> --- /dev/null
>> +++ b/gnu/packages/patches/inxi-minimal-fix-syntax.patch
>> @@ -0,0 +1,18 @@
>> +Copyright © 2018 Oleg Pykhalov <address@hidden>
>> +
>> +This patch fixes “Quantifier follows nothing in regex” error.
>> +
>> +--- 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) = @_;
>> +    return $item if !$item;# handle cases where it was 0 or ''
>> +- $item =~
>> s/chipset|components|computing|computer|corporation|communications|electronics|electrical|electric|gmbh|group|incorporation|industrial|international|nee|revision|semiconductor|software|technologies|technology|ltd\.|<ltd>|\bltd\b|inc\.|<inc>|\binc\b|intl\.|co\.|<co>|corp\.|<corp>|\(tm\)|\(r\)|®|\(rev
>> ..\)|\'|\"|\sinc\s*$|\?//gi;
>> +-   $item =~ s/,|\*/ /g;
>> +-   $item =~ s/\s\s+/ /g;
>> +-   $item =~ s/^\s+|\s+$//g;
>> +-   return $item;
>> + }
>> + 
>> + sub dmi_cleaner {
>
> I'm not sure I get the purpose of this patch.  Unless we are talking
> about a different error, I had initially fixed it with
>
>              (with-fluids ((%default-port-encoding #f))
>
> so that the "®" in the above regexp would not get garbled during the
> substitution.

I believe I tried this ‘with-fluids’ tip, but not succeeded.

Well another attempt seems to work.  Thank you for noticed this.

> Does your patch does something else / more?

No, it doesn't.

Here is a new patch.

Attachment: 0001-gnu-Add-inxi.patch
Description: gnu: Add inxi.

Oleg.

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]