GNU bug report logs - #53319
[PATCH] gnu: Add n2n.

Previous Next

Package: guix-patches;

Reported by: 路辉 <luhux76 <at> gmail.com>

Date: Mon, 17 Jan 2022 14:48:01 UTC

Severity: normal

Tags: patch

Done: Nicolas Goaziou <mail <at> nicolasgoaziou.fr>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 53319 in the body.
You can then email your comments to 53319 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#53319; Package guix-patches. (Mon, 17 Jan 2022 14:48:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to 路辉 <luhux76 <at> gmail.com>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Mon, 17 Jan 2022 14:48:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: 路辉 <luhux76 <at> gmail.com>
To: guix-patches <at> gnu.org
Subject: [PATCH] gnu: Add n2n.
Date: Mon, 17 Jan 2022 14:47:36 +0000
From c9d69917251e377c3291443dda0090cfa5e46956 Mon Sep 17 00:00:00 2001
From: Lu Hui <luhux76 <at> gmail.com>
Date: Mon, 17 Jan 2022 10:48:44 +0800
Subject: [PATCH] gnu: Add n2n.

* gnu/packages/vpn.scm (n2n-2): New variable
---
 gnu/packages/vpn.scm | 37 +++++++++++++++++++++++++++++++++++++
 1 file changed, 37 insertions(+)

diff --git a/gnu/packages/vpn.scm b/gnu/packages/vpn.scm
index 4ad555ef1b..542d6518fd 100644
--- a/gnu/packages/vpn.scm
+++ b/gnu/packages/vpn.scm
@@ -18,6 +18,7 @@
 ;;; Copyright © 2021 Domagoj Stolfa <ds815 <at> gmx.com>
 ;;; Copyright © 2021 Raghav Gururajan <rg <at> raghavgururajan.name>
 ;;; Copyright © 2021 jgart <jgart <at> dismail.de>
+;;; Copyright © 2022 Lu hui <luhux76 <at> gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -1093,3 +1094,39 @@ (define-public xl2tpd
      "xl2tpd is an implementation of the Layer 2 Tunnelling Protocol
(RFC 2661).
 L2TP allows you to tunnel PPP over UDP.")
     (license license:gpl2)))
+
+(define-public n2n-2
+  (package
+    (name "n2n")
+    (version "2.8")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/ntop/n2n")
+                    (commit version)))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "1ph2npvnqh1xnmkp96pdzpxm033jkb8zznd3nc59l9arhn0pq4nv"))))
+    (build-system gnu-build-system)
+    (native-inputs (list autoconf automake))
+    (arguments
+     `(#:make-flags (list (string-append "PREFIX=" %output) "CC=gcc")
+       #:phases
+       (modify-phases %standard-phases
+         (add-before 'bootstrap 'move-configure
+           ;; don't execute configure script in bootstrap
+           (lambda* (#:key inputs #:allow-other-keys)
+             (substitute* "autogen.sh"
+               (("./configure") ""))))
+         (add-before 'configure 'fix-configure
+           (lambda* (#:key inputs #:allow-other-keys)
+             (substitute* "configure"
+               (("/bin/sh") (which "sh"))))))
+       #:tests? #f)) ;there is no check target
+    (home-page "https://github.com/ntop/n2n")
+    (synopsis "Peer-to-peer VPN client and server")
+    (description
+     "A light VPN software which makes it
+easy to create virtual networks bypassing intermediate firewalls.")
+    (license license:gpl3+)))
-- 
2.34.0




Information forwarded to guix-patches <at> gnu.org:
bug#53319; Package guix-patches. (Fri, 28 Jan 2022 10:11:02 GMT) Full text and rfc822 format available.

Message #8 received at 53319 <at> debbugs.gnu.org (full text, mbox):

From: Nicolas Goaziou <mail <at> nicolasgoaziou.fr>
To: 路辉 <luhux76 <at> gmail.com>
Cc: 53319 <at> debbugs.gnu.org
Subject: Re: [bug#53319] [PATCH] gnu: Add n2n.
Date: Fri, 28 Jan 2022 11:10:14 +0100
Hello,

路辉 <luhux76 <at> gmail.com> writes:

> Subject: [PATCH] gnu: Add n2n.

Thank you. Some comments follow.

> +(define-public n2n-2

I think the variable should be "n2n" only.

> +    (native-inputs (list autoconf automake))
> +    (arguments
> +     `(#:make-flags (list (string-append "PREFIX=" %output) "CC=gcc")

CC=gcc is not cross-compilation friendly. Also, %output is being phased
out. I suggest using G-expressions:

  (arguments
   (list
    #:make-flags
    #~(list (string-append "PREFIX=" #$output)
            #$(string-append "CC=" (cc-for-target)))
    ...))

> +       #:phases
> +       (modify-phases %standard-phases

If you use G-expressions, you'll need to start with:

  #~(modify-phases %standard-phases
     ...)

> +         (add-before 'configure 'fix-configure
> +           (lambda* (#:key inputs #:allow-other-keys)
> +             (substitute* "configure"
> +               (("/bin/sh") (which "sh"))))))

Instead of using `which', you can use `search-input-file':

  (("/bin/sh") (search-input-file inputs "/bin/sh"))  

> +       #:tests? #f)) ;there is no check target
> +    (home-page "https://github.com/ntop/n2n")
> +    (synopsis "Peer-to-peer VPN client and server")
> +    (description
> +     "A light VPN software which makes it
> +easy to create virtual networks bypassing intermediate firewalls.")

Description should consist of full sentences. I suggest:

  n2n is a light VPN software which makes it easy to create virtual
  networks bypassing intermediate firewalls.

Also, the package brings third-party software: libnatpmp and libupnp.
Would it be possible to unbundle them, since Guix already ships both?

Could you send an updated patch?

Regards,
-- 
Nicolas Goaziou




Reply sent to Nicolas Goaziou <mail <at> nicolasgoaziou.fr>:
You have taken responsibility. (Tue, 22 Feb 2022 11:21:02 GMT) Full text and rfc822 format available.

Notification sent to 路辉 <luhux76 <at> gmail.com>:
bug acknowledged by developer. (Tue, 22 Feb 2022 11:21:02 GMT) Full text and rfc822 format available.

Message #13 received at 53319-done <at> debbugs.gnu.org (full text, mbox):

From: Nicolas Goaziou <mail <at> nicolasgoaziou.fr>
To: 路辉 <luhux76 <at> gmail.com>
Cc: 53319-done <at> debbugs.gnu.org
Subject: Re: [bug#53319] [PATCH] gnu: Add n2n.
Date: Tue, 22 Feb 2022 12:20:19 +0100
Hello,

路辉 <luhux76 <at> gmail.com> writes:

> Subject: [PATCH] gnu: Add n2n.

Thank you. I applied your patch with the changes below.
>
> +(define-public n2n-2

I renamed it to n2n.

> +    (native-inputs (list autoconf automake))

I added pkg-config and bash-minimal.

> +    (arguments
> +     `(#:make-flags (list (string-append "PREFIX=" %output) "CC=gcc")

Using G-expressions I wrote

#:make-flags
  #~(list (string-append "PREFIX=" #$output)
          (string-append "CC=" #$(cc-for-target)))
...

> +             (substitute* "configure"
> +               (("/bin/sh") (which "sh"))))))

Here I wrote

  (("/bin/sh") (search-inputs-file input "/bin/sh"))

> +       #:tests? #f)) ;there is no check target
> +    (home-page "https://github.com/ntop/n2n")
> +    (synopsis "Peer-to-peer VPN client and server")
> +    (description
> +     "A light VPN software which makes it

I turned the description into complete sentences.

Regards,
-- 
Nicolas Goaziou




Information forwarded to guix-patches <at> gnu.org:
bug#53319; Package guix-patches. (Tue, 22 Feb 2022 11:37:01 GMT) Full text and rfc822 format available.

Message #16 received at 53319 <at> debbugs.gnu.org (full text, mbox):

From: Maxime Devos <maximedevos <at> telenet.be>
To: Nicolas Goaziou <mail <at> nicolasgoaziou.fr>, 路辉
 <luhux76 <at> gmail.com>
Cc: 53319 <at> debbugs.gnu.org
Subject: Re: [bug#53319] [PATCH] gnu: Add n2n.
Date: Tue, 22 Feb 2022 12:36:24 +0100
[Message part 1 (text/plain, inline)]
Nicolas Goaziou schreef op vr 28-01-2022 om 11:10 [+0100]:
> > +         (add-before 'configure 'fix-configure
> > +           (lambda* (#:key inputs #:allow-other-keys)
> > +             (substitute* "configure"
> > +               (("/bin/sh") (which "sh"))))))
> 
> Instead of using `which', you can use `search-input-file':
> 
>   (("/bin/sh") (search-input-file inputs "/bin/sh"))  

'configure' is run during build, so for cross-compilation, a sh from
'native-inputs' shoud be used instead of 'inputs':

  (("/bin/sh") (search-input-file (or native-inputs inputs) "/bin/sh"))

or simpler:

  (("/bin/sh") (which "sh")) 

Also, this package definition packages version 2.8. Why not package
the latest version instead?  In the latest version, 'autogen.sh' does
not run "./configure" and hence 'move-configure' and 'fix-configure'
should not be necessary.

Also, looking at
<https://github.com/ntop/n2n/blob/472a9878f72299466ddbce2a232ea9e081159fa9/configure.seed#L94>,
it seems that n2n might not be bit-for-bit reproducible.

Greetings,
Maxime
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#53319; Package guix-patches. (Tue, 22 Feb 2022 18:50:01 GMT) Full text and rfc822 format available.

Message #19 received at 53319 <at> debbugs.gnu.org (full text, mbox):

From: Nicolas Goaziou <mail <at> nicolasgoaziou.fr>
To: Maxime Devos <maximedevos <at> telenet.be>
Cc: 路辉 <luhux76 <at> gmail.com>, 53319 <at> debbugs.gnu.org
Subject: Re: [bug#53319] [PATCH] gnu: Add n2n.
Date: Tue, 22 Feb 2022 19:49:34 +0100
Hello,

Maxime Devos <maximedevos <at> telenet.be> writes:

> 'configure' is run during build, so for cross-compilation, a sh from
> 'native-inputs' shoud be used instead of 'inputs':
>
>   (("/bin/sh") (search-input-file (or native-inputs inputs) "/bin/sh"))

True, I keep forgetting about this. It would be more natural to use
(search-input-file native-inputs "/bin/sh"), but, IIRC, native-inputs
may be empty if we are not cross-compiling.

I will fix it.

> or simpler:
>
>   (("/bin/sh") (which "sh"))

IIUC, search-input-file is a replacement for `which', so that seems to
be going backwards.

Of course, if `which' is the preferred solution for package style, I'd
love to hear a confirmation about it.

> Also, this package definition packages version 2.8. Why not package
> the latest version instead?

The OP waited one month without any feedback. I consider this is more
respectful to apply the patch in its current version rather than
requesting more changes now. YMMV.

Of course, the update can happen in a later, very welcome, patch.

> Also, looking at
> <https://github.com/ntop/n2n/blob/472a9878f72299466ddbce2a232ea9e081159fa9/configure.seed#L94>,
> it seems that n2n might not be bit-for-bit reproducible.

I agree this package has room for improvement. Hopefully, 路辉 can have
a look at it.

Regards,
-- 
Nicolas Goaziou




Information forwarded to guix-patches <at> gnu.org:
bug#53319; Package guix-patches. (Sun, 20 Mar 2022 12:22:02 GMT) Full text and rfc822 format available.

Message #22 received at 53319 <at> debbugs.gnu.org (full text, mbox):

From: 路辉 <luhux76 <at> gmail.com>
To: Nicolas Goaziou <mail <at> nicolasgoaziou.fr>
Cc: 53319 <at> debbugs.gnu.org, Maxime Devos <maximedevos <at> telenet.be>
Subject: Re: [bug#53319] [PATCH] gnu: Add n2n.
Date: Sun, 20 Mar 2022 12:20:58 +0000
[Message part 1 (text/plain, inline)]
Nicolas Goaziou <mail <at> nicolasgoaziou.fr> 于2022年2月22日周二 18:49写道:
>
> Hello,
>
> Maxime Devos <maximedevos <at> telenet.be> writes:
>
> > 'configure' is run during build, so for cross-compilation, a sh from
> > 'native-inputs' shoud be used instead of 'inputs':
> >
> >   (("/bin/sh") (search-input-file (or native-inputs inputs) "/bin/sh"))
>
> True, I keep forgetting about this. It would be more natural to use
> (search-input-file native-inputs "/bin/sh"), but, IIRC, native-inputs
> may be empty if we are not cross-compiling.
>
> I will fix it.
>
> > or simpler:
> >
> >   (("/bin/sh") (which "sh"))
>
> IIUC, search-input-file is a replacement for `which', so that seems to
> be going backwards.
>
> Of course, if `which' is the preferred solution for package style, I'd
> love to hear a confirmation about it.
>
> > Also, this package definition packages version 2.8. Why not package
> > the latest version instead?
>
> The OP waited one month without any feedback. I consider this is more
> respectful to apply the patch in its current version rather than
> requesting more changes now. YMMV.
>
> Of course, the update can happen in a later, very welcome, patch.
>
> > Also, looking at
> > <https://github.com/ntop/n2n/blob/472a9878f72299466ddbce2a232ea9e081159fa9/configure.seed#L94>,
> > it seems that n2n might not be bit-for-bit reproducible.
>
> I agree this package has room for improvement. Hopefully, 路辉 can have
> a look at it.
>
> Regards,
> --
> Nicolas Goaziou
[0004-gnu-n2n-Update-to-3.0.patch (text/x-patch, attachment)]
[0002-gnu-n2n-remove-hardcodepath.patch (text/x-patch, attachment)]
[0003-gnu-n2n-add-compression-AES-crypto-method-support.patch (text/x-patch, attachment)]
[0001-gnu-n2n-more-reproducible.patch (text/x-patch, attachment)]

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 18 Apr 2022 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 2 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.