[PATCH] gnu: Add python-miniupnpc

  • Done
  • quality assurance status badge
Details
4 participants
  • Ludovic Courtès
  • Nicolas Goaziou
  • Xinglu Chen
  • Stephen Paul Weber
Owner
unassigned
Submitted by
Stephen Paul Weber
Severity
normal
S
S
Stephen Paul Weber wrote on 8 Nov 2021 04:41
(address . guix-patches@gnu.org)(name . Stephen Paul Weber)(address . singpolyma@singpolyma.net)
20211108034117.69082-1-singpolyma@singpolyma.net
* gnu/packages/python-xyz.scm (python-miniupnpc): New variable.
---
gnu/packages/python-xyz.scm | 36 ++++++++++++++++++++++++++++++++++++
1 file changed, 36 insertions(+)

Toggle diff (49 lines)
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 8ba72170c0..558e104cf1 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -3093,6 +3093,42 @@ server.")
"@code{pafy} is a python library to retrieve YouTube content and metadata.")
(license license:lgpl3+)))
+(define-public python-miniupnpc
+ (package
+ (name "python-miniupnpc")
+ (version "2.2.3")
+ (source
+ (origin
+ (method git-fetch)
+ (uri
+ (git-reference
+ (url "https://github.com/miniupnp/miniupnp")
+ (commit "36a65e3d841d4e85904fed690c0b755d5b380043")))
+ (file-name
+ (git-file-name name version))
+ (sha256
+ (base32 "0h7smsp1fnwsmgg3n70813ln9j5y20g61x25s4kn91vzkbbq9188"))))
+ (build-system python-build-system)
+ (arguments
+ `(#:phases
+ (modify-phases %standard-phases
+ (add-after 'unpack 'subdir
+ (lambda _
+ (chdir "miniupnpc")
+ (setenv "CC" ,(cc-for-target))
+ (substitute* "Makefile"
+ (("SH = /bin/sh") (string-append "SH = " (which "bash"))))
+ #t)))))
+ (inputs
+ `(("python" ,python))) ; We are building a Python extension.
+ (native-inputs
+ `(("which" ,which)))
+ (synopsis "UPnP client for Python")
+ (description "A client library for Python programs to set up port forwards
+using UPnP.")
+ (home-page "http://miniupnp.free.fr")
+ (license license:bsd-3)))
+
(define-public python2-funcsigs
(package
(name "python2-funcsigs")
--
2.30.2
L
L
Ludovic Courtès wrote on 17 Nov 2021 16:33
(name . Stephen Paul Weber)(address . singpolyma@singpolyma.net)(address . 51676@debbugs.gnu.org)
87fsruvltz.fsf@gnu.org
Hi Stephen,

Stephen Paul Weber <singpolyma@singpolyma.net> skribis:

Toggle quote (2 lines)
> * gnu/packages/python-xyz.scm (python-miniupnpc): New variable.

[...]

Toggle quote (9 lines)
> + (version "2.2.3")
> + (source
> + (origin
> + (method git-fetch)
> + (uri
> + (git-reference
> + (url "https://github.com/miniupnp/miniupnp")
> + (commit "36a65e3d841d4e85904fed690c0b755d5b380043")))

This commit:

Toggle snippet (6 lines)
$ (cd /tmp/miniupnp/; git checkout 36a65e3d841d4e85904fed690c0b755d5b380043; git describe)
La posició de HEAD anterior era 2df8120 miniupnpc version 2.2.3
HEAD ara és a 36a65e3 miniupnpc/Changelog.txt: VERSION 2.2.3
miniupnpd_2_1-574-g36a65e3

… does not match the tag for 2.2.3:

Toggle snippet (6 lines)
$ (cd /tmp/miniupnp/; git checkout miniupnpc_2_2_3; git log |head -1)
La posició de HEAD anterior era 36a65e3 miniupnpc/Changelog.txt: VERSION 2.2.3
HEAD ara és a 2df8120 miniupnpc version 2.2.3
commit 2df8120326ed4246e049a7a6de707539604cd514

Toggle quote (3 lines)
> + (description "A client library for Python programs to set up port forwards
> +using UPnP.")

Please make it a full sentence, as per:


Could you send an updated patch that addresses these two issues?

Thanks,
Ludo’.
S
S
Stephen Paul Weber wrote on 14 Jan 2022 02:09
[PATCH v2] gnu: Add python-miniupnpc
(address . 51676@debbugs.gnu.org)(name . Stephen Paul Weber)(address . singpolyma@singpolyma.net)
20220114010954.28886-1-singpolyma@singpolyma.net
* gnu/packages/python-xyz.scm (python-miniupnpc): New variable.
---
gnu/packages/python-xyz.scm | 34 ++++++++++++++++++++++++++++++++++
1 file changed, 34 insertions(+)

Toggle diff (47 lines)
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 0091165d37..0ad5dfd85c 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -3150,6 +3150,40 @@ server.")
"@code{pafy} is a python library to retrieve YouTube content and metadata.")
(license license:lgpl3+)))
+(define-public python-miniupnpc
+ (package
+ (name "python-miniupnpc")
+ (version "2.2.3")
+ (source
+ (origin
+ (method git-fetch)
+ (uri
+ (git-reference
+ (url "https://github.com/miniupnp/miniupnp")
+ (commit "miniupnpc_2_2_3")))
+ (file-name
+ (git-file-name name version))
+ (sha256
+ (base32 "0h7smsp1fnwsmgg3n70813ln9j5y20g61x25s4kn91vzkbbq9188"))))
+ (build-system python-build-system)
+ (arguments
+ `(#:phases
+ (modify-phases %standard-phases
+ (add-after 'unpack 'subdir
+ (lambda _
+ (chdir "miniupnpc")
+ (setenv "CC" ,(cc-for-target))
+ (substitute* "Makefile"
+ (("SH = /bin/sh") (string-append "SH = " (which "bash"))))
+ #t)))))
+ (inputs (list python)) ; We are building a Python extension.
+ (native-inputs (list which))
+ (synopsis "UPnP client for Python")
+ (description "Miniupnpc is a client library for Python programs to set up
+port forwards using UPnP.")
+ (home-page "http://miniupnp.free.fr")
+ (license license:bsd-3)))
+
(define-public python2-funcsigs
(package
(name "python2-funcsigs")
--
2.30.2
X
X
Xinglu Chen wrote on 9 Feb 2022 15:07
(name . Stephen Paul Weber)(address . singpolyma@singpolyma.net)
87leykw2to.fsf@yoctocell.xyz
Stephen schrieb am Donnerstag der 13. Januar 2022 um 20:09 -05:

Toggle quote (25 lines)
> * gnu/packages/python-xyz.scm (python-miniupnpc): New variable.
> ---
> gnu/packages/python-xyz.scm | 34 ++++++++++++++++++++++++++++++++++
> 1 file changed, 34 insertions(+)
>
> diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
> index 0091165d37..0ad5dfd85c 100644
> --- a/gnu/packages/python-xyz.scm
> +++ b/gnu/packages/python-xyz.scm
> @@ -3150,6 +3150,40 @@ server.")
> "@code{pafy} is a python library to retrieve YouTube content and metadata.")
> (license license:lgpl3+)))
>
> +(define-public python-miniupnpc
> + (package
> + (name "python-miniupnpc")
> + (version "2.2.3")
> + (source
> + (origin
> + (method git-fetch)
> + (uri
> + (git-reference
> + (url "https://github.com/miniupnp/miniupnp")
> + (commit "miniupnpc_2_2_3")))

The version should not be hard-coded. You could use
‘string-replace-substring’ from (ice-9 string-fun).

(string-replace-substring version "." "_")


Toggle quote (5 lines)
> + (file-name
> + (git-file-name name version))
> + (sha256
> + (base32 "0h7smsp1fnwsmgg3n70813ln9j5y20g61x25s4kn91vzkbbq9188"))))

I am getting a hash mismatch

Toggle snippet (4 lines)
expected hash: 0h7smsp1fnwsmgg3n70813ln9j5y20g61x25s4kn91vzkbbq9188
actual hash: 03q1rlzvfzm15g1bfw2zqzavlsyaypnaf2k3cz6ha7k5rirkdy0l

Toggle quote (11 lines)
> + (build-system python-build-system)
> + (arguments
> + `(#:phases
> + (modify-phases %standard-phases
> + (add-after 'unpack 'subdir
> + (lambda _
> + (chdir "miniupnpc")
> + (setenv "CC" ,(cc-for-target))
> + (substitute* "Makefile"
> + (("SH = /bin/sh") (string-append "SH = " (which "bash"))))

Nitpick: Could we just match on /bin/sh?

Toggle quote (2 lines)
> + #t)))))

Phases don’t have to return #t.

Toggle quote (6 lines)
> + (inputs (list python)) ; We are building a Python extension.
> + (native-inputs (list which))
> + (synopsis "UPnP client for Python")
> + (description "Miniupnpc is a client library for Python programs to set up
> +port forwards using UPnP.")

Acronyms should be expanded at least once, see “17.4.4 Synopses and
Descriptions” in the manual.

@acronym{UPnP, Universal Plug and Play}
-----BEGIN PGP SIGNATURE-----

iQJJBAEBCAAzFiEEAVhh4yyK5+SEykIzrPUJmaL7XHkFAmIDyrMVHHB1YmxpY0B5
b2N0b2NlbGwueHl6AAoJEKz1CZmi+1x5KGIP+wXuD49xoeuQF+Xlcasj8HSVj5t1
f44WVoOHof1PddzKgq2eYDCaCXKtWOhhZb4tnjoStk+CLVPh6hmyjJYyt9wFGiVB
Bpi19oVMRlH8XX68XgYNnL9Kov5LL33RoRIO8wCJeuY9MTUzZMbAewGaCBTGuyNO
wUNCBIjFF7d9ShkNfzFMpoeLaDczTJ8XafNvg5q9HJCnTwn0r6MAYnL87KqCIjet
3uB5ewP4e252jIaUGvUzbgYXsQ5VwtNcWqM7aVVS+BLbTBRWXYeRnXWha95YUhvh
RPrDe11wIYRQoUrvaze69TadW7UIre4MLhFYRaY65qjbzPn5VYd98lT80Eo9Po1A
u/mPary9Jw2D40UYQeT8dpp6s1IubQjYj1YO4B0orfIKdSGMeAMI596Z7gg+jIuX
iSOYgq6zyO7BvGwtcvsYcIXR4Q3Cpuo1BtzeKA4yPnNogXObbSNDWe+NFMU3QExu
L+F8vWRv+L6InyA7hc0xpN9E+f4bIC5G0JDLoqe6FD2zkpPJLAscCvFbcZtoMgTM
BE67pbJL8qvzcm/T3Bk78nqEA5iVy7o7s/6E1Mz+CqiEVGxFT7ePNtxSceWYmimE
+aCnnVbtOXlUKA6LxIbT8PCYhI4AYPBHHCvZIGrPGqZCNW/vR37V6+9F8tGvez70
2DxPxgKt6OT64Rbq
=jz/g
-----END PGP SIGNATURE-----

S
S
Stephen Paul Weber wrote on 9 Feb 2022 15:57
[PATCH v3] gnu: Add python-miniupnpc
(address . 51676@debbugs.gnu.org)(name . Stephen Paul Weber)(address . singpolyma@singpolyma.net)
20220209145708.31704-1-singpolyma@singpolyma.net
* gnu/packages/python-xyz.scm (python-miniupnpc): New variable.
---
gnu/packages/python-xyz.scm | 35 +++++++++++++++++++++++++++++++++++
1 file changed, 35 insertions(+)

Toggle diff (48 lines)
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 537a2eef35..dccaa7b103 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -3156,6 +3156,41 @@ server.")
"@code{pafy} is a python library to retrieve YouTube content and metadata.")
(license license:lgpl3+)))
+(define-public python-miniupnpc
+ (package
+ (name "python-miniupnpc")
+ (version "2.2.3")
+ (source
+ (origin
+ (method git-fetch)
+ (uri
+ (git-reference
+ (url "https://github.com/miniupnp/miniupnp")
+ (commit
+ (string-append
+ "miniupnpc_" (string-replace-substring version "." "_")))))
+ (file-name
+ (git-file-name name version))
+ (sha256
+ (base32 "03q1rlzvfzm15g1bfw2zqzavlsyaypnaf2k3cz6ha7k5rirkdy0l"))))
+ (build-system python-build-system)
+ (arguments
+ `(#:phases
+ (modify-phases %standard-phases
+ (add-after 'unpack 'subdir
+ (lambda _
+ (chdir "miniupnpc")
+ (setenv "CC" ,(cc-for-target))
+ (substitute* "Makefile"
+ (("/bin/sh") (which "bash"))))))))
+ (inputs (list python)) ; We are building a Python extension.
+ (native-inputs (list which))
+ (synopsis "UPnP client for Python")
+ (description "Miniupnpc is a client library for Python programs to set up
+port forwards using @acronym{UPnP, Universal Plug and Play}.")
+ (home-page "http://miniupnp.free.fr")
+ (license license:bsd-3)))
+
(define-public python2-funcsigs
(package
(name "python2-funcsigs")
--
2.30.2
N
N
Nicolas Goaziou wrote on 15 Feb 2022 23:13
(name . Stephen Paul Weber)(address . singpolyma@singpolyma.net)(address . 51676-done@debbugs.gnu.org)
87bkz7pylt.fsf@nicolasgoaziou.fr
Hello,

Stephen Paul Weber <singpolyma@singpolyma.net> writes:

Toggle quote (2 lines)
> * gnu/packages/python-xyz.scm (python-miniupnpc): New variable.

I removed `which' native-inputs, used G-expressions, and
`search-input-files' instead of `which' function.

Applied. Thank you

Regards,
--
Nicolas Goaziou
Closed
?