unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#41431] [PATCH] gnu: Add protonvpn-cli.
@ 2020-05-21  3:29 Ryan Prior via Guix-patches via
  2020-05-23 14:17 ` Ludovic Courtès
  0 siblings, 1 reply; 4+ messages in thread
From: Ryan Prior via Guix-patches via @ 2020-05-21  3:29 UTC (permalink / raw)
  To: 41431

* gnu/packages/vpn.scm (protonvpn-cli): New variable.
---
 gnu/packages/vpn.scm | 34 ++++++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)

diff --git a/gnu/packages/vpn.scm b/gnu/packages/vpn.scm
index da881493bf..b47cad2ae0 100644
--- a/gnu/packages/vpn.scm
+++ b/gnu/packages/vpn.scm
@@ -12,6 +12,7 @@
 ;;; Copyright © 2019 Rutger Helling <rhelling@mykolab.com>
 ;;; Copyright © 2019 Ricardo Wurmus <rekado@elephly.net>
 ;;; Copyright © 2020 Brice Waegeneire <brice@waegenei.re>
+;;; Copyright © 2020 Ryan Prior <rprior@protonmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -55,6 +56,7 @@
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages python)
   #:use-module (gnu packages python-xyz)
+  #:use-module (gnu packages python-web)
   #:use-module (gnu packages tls)
   #:use-module (gnu packages xml))
 
@@ -311,6 +313,38 @@ security protocol that utilizes SSL/TLS for key exchange.  It is capable of
 traversing network address translators (@dfn{NAT}s) and firewalls.")
     (license license:gpl2)))
 
+(define-public protonvpn-cli
+  (package
+    (name "protonvpn-cli")
+    (version "2.2.2")
+    (source
+     (origin
+       ;; PyPI has a ".whl" file but not a proper source release.
+       ;; Thus, fetch code from Git.
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/ProtonVPN/linux-cli.git")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32
+         "0ixjb02kj4z79whm1izd8mrn2h0rp9cmw4im1qvp93rahqxdd4n8"))))
+    (build-system python-build-system)
+    (arguments '(#:tests? #f))
+    (native-inputs
+     `(("docopt" ,python-docopt)))
+    (inputs
+     `(("pythondialog" ,python-pythondialog)
+       ("requests" ,python-requests)))
+    (propagated-inputs
+     `(("openvpn" ,openvpn)))
+    (synopsis "Command-line client for ProtonVPN")
+    (description
+     "ProtonVPN is a secure point-to-point virtual private networking service
+with a gratis tier.")
+    (home-page "https://github.com/ProtonVPN/linux-cli")
+    (license license:gpl3)))
+
 (define-public tinc
   (package
     (name "tinc")
-- 
2.26.2






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

* [bug#41431] [PATCH] gnu: Add protonvpn-cli.
  2020-05-21  3:29 [bug#41431] [PATCH] gnu: Add protonvpn-cli Ryan Prior via Guix-patches via
@ 2020-05-23 14:17 ` Ludovic Courtès
  2020-05-23 19:11   ` Ryan Prior via Guix-patches via
  0 siblings, 1 reply; 4+ messages in thread
From: Ludovic Courtès @ 2020-05-23 14:17 UTC (permalink / raw)
  To: Ryan Prior; +Cc: 41431

Hi,

Ryan Prior <rprior@protonmail.com> skribis:

> * gnu/packages/vpn.scm (protonvpn-cli): New variable.

Overall LGTM, with minor issues:

> +    (arguments '(#:tests? #f))

When enabling the tests, I get:

--8<---------------cut here---------------start------------->8---
starting phase `check'
running "python setup.py" with command "test" and parameters ()
running test
running egg_info
writing protonvpn_cli.egg-info/PKG-INFO
writing dependency_links to protonvpn_cli.egg-info/dependency_links.txt
writing entry points to protonvpn_cli.egg-info/entry_points.txt
writing requirements to protonvpn_cli.egg-info/requires.txt
writing top-level names to protonvpn_cli.egg-info/top_level.txt
reading manifest file 'protonvpn_cli.egg-info/SOURCES.txt'
writing manifest file 'protonvpn_cli.egg-info/SOURCES.txt'
running build_ext
error: [Errno 13] Permission denied: '/.pvpn-cli'
command "python" "-c" "import setuptools, tokenize;__file__='setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\\r\\n', '\\n');f.close();exec(compile(code, __file__, 'exec'))" "test" failed with status 1
--8<---------------cut here---------------end--------------->8---

So there are definitely tests, but for some reason they’re not working
as expected.  Could you take a look?  (In general we don’t disable tests
unless there’s a compelling reason to do so.)

> +    (description
> +     "ProtonVPN is a secure point-to-point virtual private networking service
> +with a gratis tier.")
> +    (home-page "https://github.com/ProtonVPN/linux-cli")
> +    (license license:gpl3)))

This is ‘gpl3+’ AFAICS since nothing says “version 3 only.”

Could you send an updated patch?

Bonus points if you expound the description a bit.  :-)

Thanks,
Ludo’.




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

* [bug#41431] [PATCH] gnu: Add protonvpn-cli.
  2020-05-23 14:17 ` Ludovic Courtès
@ 2020-05-23 19:11   ` Ryan Prior via Guix-patches via
  2020-05-24 20:02     ` bug#41431: " Ludovic Courtès
  0 siblings, 1 reply; 4+ messages in thread
From: Ryan Prior via Guix-patches via @ 2020-05-23 19:11 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 41431

[-- Attachment #1: Type: text/plain, Size: 1094 bytes --]

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Saturday, May 23, 2020 2:17 PM, Ludovic Courtès <ludo@gnu.org> wrote:

> there are definitely tests

What makes you so sure? `grep -r '\Wtest' .` suggests that the only reference to testing in the whole repo is in protonvpn_cli/utils.py (wait_for_network) which tests for a network connection at runtime. I don't think they are shipping any tests; setup.py can test to make sure you can actually install your dependencies, but that's not a meaningful upstream test, it's a default behavior.


> > -   (license license:gpl3)))
>
> This is ‘gpl3+’ AFAICS since nothing says “version 3 only.”

Nothing says "or any later version" either—I had been under the impression that the "plus" was opt-in, but reading GPLv3 again it appears to be opt-out. I don't know, that's not my area of expertise. I've updated the patch to gpl3+ with your recommendation in any case.

> Could you send an updated patch?
>
> Bonus points if you expound the description a bit. :-)

Of course! Here you go.


Thanks,
Ryan

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-gnu-Add-protonvpn-cli.patch --]
[-- Type: text/x-patch; name="0001-gnu-Add-protonvpn-cli.patch", Size: 2595 bytes --]

From e24ca007737ab7f6e7572cee2b827578ff42a36a Mon Sep 17 00:00:00 2001
From: Ryan Prior <rprior@protonmail.com>
Date: Wed, 20 May 2020 22:28:11 -0500
Subject: [PATCH] gnu: Add protonvpn-cli.

* gnu/packages/vpn.scm (protonvpn-cli): New variable.
---
 gnu/packages/vpn.scm | 36 ++++++++++++++++++++++++++++++++++++
 1 file changed, 36 insertions(+)

diff --git a/gnu/packages/vpn.scm b/gnu/packages/vpn.scm
index da881493bf..8f7fb3b577 100644
--- a/gnu/packages/vpn.scm
+++ b/gnu/packages/vpn.scm
@@ -12,6 +12,7 @@
 ;;; Copyright © 2019 Rutger Helling <rhelling@mykolab.com>
 ;;; Copyright © 2019 Ricardo Wurmus <rekado@elephly.net>
 ;;; Copyright © 2020 Brice Waegeneire <brice@waegenei.re>
+;;; Copyright © 2020 Ryan Prior <rprior@protonmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -55,6 +56,7 @@
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages python)
   #:use-module (gnu packages python-xyz)
+  #:use-module (gnu packages python-web)
   #:use-module (gnu packages tls)
   #:use-module (gnu packages xml))
 
@@ -311,6 +313,40 @@ security protocol that utilizes SSL/TLS for key exchange.  It is capable of
 traversing network address translators (@dfn{NAT}s) and firewalls.")
     (license license:gpl2)))
 
+(define-public protonvpn-cli
+  (package
+    (name "protonvpn-cli")
+    (version "2.2.2")
+    (source
+     (origin
+       ;; PyPI has a ".whl" file but not a proper source release.
+       ;; Thus, fetch code from Git.
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/ProtonVPN/linux-cli.git")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32
+         "0ixjb02kj4z79whm1izd8mrn2h0rp9cmw4im1qvp93rahqxdd4n8"))))
+    (build-system python-build-system)
+    (arguments '(#:tests? #f)) ; no tests in repo
+    (native-inputs
+     `(("docopt" ,python-docopt)))
+    (inputs
+     `(("pythondialog" ,python-pythondialog)
+       ("requests" ,python-requests)))
+    (propagated-inputs
+     `(("openvpn" ,openvpn)))
+    (synopsis "Command-line client for ProtonVPN")
+    (description
+     "Official CLI for ProtonVPN, a secure point-to-point virtual private
+networking service with a gratis tier.  It can automatically find and connect
+to the fastest servers or use TOR over VPN.  The gratis tier offers unlimited
+bandwidth for up to 10 devices.")
+    (home-page "https://github.com/ProtonVPN/linux-cli")
+    (license license:gpl3+)))
+
 (define-public tinc
   (package
     (name "tinc")
-- 
2.26.2


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

* bug#41431: [PATCH] gnu: Add protonvpn-cli.
  2020-05-23 19:11   ` Ryan Prior via Guix-patches via
@ 2020-05-24 20:02     ` Ludovic Courtès
  0 siblings, 0 replies; 4+ messages in thread
From: Ludovic Courtès @ 2020-05-24 20:02 UTC (permalink / raw)
  To: Ryan Prior; +Cc: 41431-done

Hi,

Ryan Prior <rprior@protonmail.com> skribis:

> ‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
> On Saturday, May 23, 2020 2:17 PM, Ludovic Courtès <ludo@gnu.org> wrote:
>
>> there are definitely tests
>
> What makes you so sure? `grep -r '\Wtest' .` suggests that the only reference to testing in the whole repo is in protonvpn_cli/utils.py (wait_for_network) which tests for a network connection at runtime. I don't think they are shipping any tests; setup.py can test to make sure you can actually install your dependencies, but that's not a meaningful upstream test, it's a default behavior.

Oh my bad.  I was fooled by the fact that “something” seemed to be
happening when enabling tests.

>> > -   (license license:gpl3)))
>>
>> This is ‘gpl3+’ AFAICS since nothing says “version 3 only.”
>
> Nothing says "or any later version" either—I had been under the impression that the "plus" was opt-in, but reading GPLv3 again it appears to be opt-out. I don't know, that's not my area of expertise. I've updated the patch to gpl3+ with your recommendation in any case.

Right, there’s this paragraph in the license:

    Each version is given a distinguishing version number.  If the
  Program specifies that a certain numbered version of the GNU General
  Public License "or any later version" applies to it, you have the
  option of following the terms and conditions either of that numbered
  version or of any later version published by the Free Software
  Foundation.  If the Program does not specify a version number of the
  GNU General Public License, you may choose any version ever published
  by the Free Software Foundation.

In Guix we encode it by adding “+” as in “or any later version”.

> From: Ryan Prior <rprior@protonmail.com>
> Date: Wed, 20 May 2020 22:28:11 -0500
> Subject: [PATCH] gnu: Add protonvpn-cli.
>
> * gnu/packages/vpn.scm (protonvpn-cli): New variable.

Applied, thanks!

Ludo’.




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

end of thread, other threads:[~2020-05-24 20:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-21  3:29 [bug#41431] [PATCH] gnu: Add protonvpn-cli Ryan Prior via Guix-patches via
2020-05-23 14:17 ` Ludovic Courtès
2020-05-23 19:11   ` Ryan Prior via Guix-patches via
2020-05-24 20:02     ` bug#41431: " Ludovic Courtès

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).