diff mbox

gnu: Add perl-socket6.

Message ID 20160726224331.52883f8a@scratchpost.org
State New
Headers show

Commit Message

Danny Milosavljevic July 26, 2016, 8:43 p.m. UTC
From: Danny Milosavljevic <dannym@scratchpost.org>

* gnu/packages/networking.scm (perl-socket6): New variable.
---
 gnu/packages/networking.scm | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)

Comments

non such July 28, 2016, 9:13 a.m. UTC | #1
Hi,

could you fix the commit message the same way pointed out in the
previous (perl-net-dns) package and rebase it on master?

This one fails at line 399 of networking.scm, I can not apply it.

Danny Milosavljevic <dannym@scratchpost.org> writes:

> From: Danny Milosavljevic <dannym@scratchpost.org>
>
> * gnu/packages/networking.scm (perl-socket6): New variable.
> ---
>  gnu/packages/networking.scm | 33 +++++++++++++++++++++++++++++++++
>  1 file changed, 33 insertions(+)
>
> diff --git a/gnu/packages/networking.scm b/gnu/packages/networking.scm
> index a271543..c56ec36 100644
> --- a/gnu/packages/networking.scm
> +++ b/gnu/packages/networking.scm
> @@ -399,3 +399,36 @@ network frames.")
>      "Perl Interface to the Domain Name System")
>    (description "Net::DNS is the Perl Interface to the Domain Name System.")
>    (license license:x11)))
> +
> +(define-public perl-socket6
> + (package
> +  (name "perl-socket6")
> +  (version "0.28")
> +  (source
> +    (origin
> +      (method url-fetch)
> +      (uri (string-append
> +             "mirror://cpan/authors/id/U/UM/UMEMOTO/Socket6-"
> +             version
> +             ".tar.gz"))
> +      (sha256
> +        (base32
> +          "11j5jzqbzmwlws9zals43ry2f1nw9qy6im7yhn9ck5rikywrmm5z"))))
> +  (build-system perl-build-system)
> +  (arguments
> +   `(#:phases
> +     (modify-phases %standard-phases
> +         (replace 'configure
> +           (lambda* (#:key outputs #:allow-other-keys)
> +             (let* ((out (assoc-ref outputs "out"))
> +                    (args `("Makefile.PL"
> +                            ,(string-append "PREFIX=" out)
> +                            "INSTALLDIRS=site")))
> +                   (setenv "CONFIG_SHELL" (which "sh"))
> +                   (zero? (apply system* "perl" args))))))))
> +  (home-page "http://search.cpan.org/dist/Socket6")
> +  (synopsis
> +    "IPv6 related part of the C socket.h defines and structure manipulators for Perl")
> +  (description "Socket6 binds the IPv6 related part of the C socket header
> +definitions and structure manipulators for Perl.")
> +  (license license:bsd-3)))
>
Danny Milosavljevic July 28, 2016, 11 a.m. UTC | #2
> could you fix the commit message the same way pointed out in the
> previous (perl-net-dns) package and 

>rebase it on master?

Sorry, I cannot do that manually for like 20 packages. 

This is Scheme we are talking about - one of the most regular languages there is. There should be a patching and diffing program which works on the tree level and we should be using that.

*shakes head* This is not C or anything where we would have to live with that.

Anyway, for the time being I wrote a small script to automate the process of reapplying these from the mailing list and then resubmit. It's running right now.

Even after I resubmitted all the patches, they will still only apply when applied in chronological order. Therefore, I will submit a patch series.

Script is attached for reference.
non such July 28, 2016, 11:36 a.m. UTC | #3
Danny Milosavljevic <dannym@scratchpost.org> writes:

>> could you fix the commit message the same way pointed out in the
>> previous (perl-net-dns) package and 
>
>>rebase it on master?
>
> Sorry, I cannot do that manually for like 20 packages. 

I did not see that they are all related, only the 3 of them I looked
at.

> This is Scheme we are talking about - one of the most regular languages there is. There should be a patching and diffing program which works on the tree level and we should be using that.
>
> *shakes head* This is not C or anything where we would have to live with that.
>
> Anyway, for the time being I wrote a small script to automate the process of reapplying these from the mailing list and then resubmit. It's running right now.
>
> Even after I resubmitted all the patches, they will still only apply when applied in chronological order. Therefore, I will submit a patch series.
>
> Script is attached for reference.

Thanks,

I'm relatively new to scheme, so this should be useful for future
reference for myself and other newcomers.

I'll review them later today, as soon as I have time.
Danny Milosavljevic July 28, 2016, noon UTC | #4
Hi,

On Thu, 28 Jul 2016 11:36:03 +0000
ng0 <ng0@we.make.ritual.n0.is> wrote:

>I did not see that they are all related, only the 3 of them I looked at.

Yeah, that was my fault. I should have done a patch series in the first place - given that these perl package patches touch the same files and so probably won't apply out-of-order.

> I'm relatively new to scheme, so this should be useful for future
> reference for myself and other newcomers.

The Python script I attached (new version attached again) can only handle the special case of a patch which patches well-formatted (i.e. newline where it should be etc) scm files which adds packages and removes nothing.

It uses heuristics and is not the right fix - but half a solution is better than none.

What it can do is you give it a patch or E-Mail name on the commandline and it will read it and extract the "+" blocks and just append them to the guix git master. There are also a few special cases handled like adapting the define-module form if necessary but it's not really safe in general - i.e. you have to verify the result manually.

Still beats rewriting all the patches manually :)

For example you give it a patch containing

  diff a/foo.scm b/foo.scm
  +++ b/foo.scm
  @@ 22 number doesn't matter
  +(define foo 2)

and it will append

  (define foo 2)

to the end of the file "foo.scm" in a fixed directory ~/src/guix-master/guix .

A better solution would be to add something like "guix edit" to guix which extracts the package and returns an S-Expression to send to the list - not forgetting eventually required module header changes (imports etc). Otherwise it will always depend on the order the patches from different people are applied. That won't scale.
diff mbox

Patch

diff --git a/gnu/packages/networking.scm b/gnu/packages/networking.scm
index a271543..c56ec36 100644
--- a/gnu/packages/networking.scm
+++ b/gnu/packages/networking.scm
@@ -399,3 +399,36 @@  network frames.")
     "Perl Interface to the Domain Name System")
   (description "Net::DNS is the Perl Interface to the Domain Name System.")
   (license license:x11)))
+
+(define-public perl-socket6
+ (package
+  (name "perl-socket6")
+  (version "0.28")
+  (source
+    (origin
+      (method url-fetch)
+      (uri (string-append
+             "mirror://cpan/authors/id/U/UM/UMEMOTO/Socket6-"
+             version
+             ".tar.gz"))
+      (sha256
+        (base32
+          "11j5jzqbzmwlws9zals43ry2f1nw9qy6im7yhn9ck5rikywrmm5z"))))
+  (build-system perl-build-system)
+  (arguments
+   `(#:phases
+     (modify-phases %standard-phases
+         (replace 'configure
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (args `("Makefile.PL"
+                            ,(string-append "PREFIX=" out)
+                            "INSTALLDIRS=site")))
+                   (setenv "CONFIG_SHELL" (which "sh"))
+                   (zero? (apply system* "perl" args))))))))
+  (home-page "http://search.cpan.org/dist/Socket6")
+  (synopsis
+    "IPv6 related part of the C socket.h defines and structure manipulators for Perl")
+  (description "Socket6 binds the IPv6 related part of the C socket header
+definitions and structure manipulators for Perl.")
+  (license license:bsd-3)))